> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sportsapipro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# H2H, History, Commentary & Rankings

> Head-to-head, recent form, text live commentary, and FIFA / database rankings

## Match H2H & History

```text theme={null}
GET /api/v1/match/{matchId}/h2h
GET /api/v1/match/{matchId}/history
```

Returns head-to-head and recent form for both teams in a specific match.

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.sportsapipro.com/v6/football/match/ezk96i3gzz5a1kn/h2h"
```

**Cache TTL:** 60 s.

## H2H by Team IDs

```text theme={null}
GET /api/v1/h2h?home={homeTeamId}&away={awayTeamId}&sport_id=1
```

Returns historical matchups between any two teams (not tied to a specific match).

| Parameter  | Required | Description                               |
| ---------- | -------- | ----------------------------------------- |
| `home`     | yes      | Home team ID                              |
| `away`     | yes      | Away team ID                              |
| `sport_id` | no       | `1` football (default), `2` basketball, … |

```bash theme={null}
# Argentina vs Brazil — 151+ historical matches
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.sportsapipro.com/v6/football/h2h?home=8vmqy9i232b4k9r&away=zzz...&sport_id=1"
```

## Match Commentary

```text theme={null}
GET /api/v1/match/{matchId}/commentary
```

Text-based live commentary stream (when available for the match).

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.sportsapipro.com/v6/football/match/ezk96i3gzz5a1kn/commentary"
```

**Cache TTL:** 5 s (live data).

## Match Standings Context

```text theme={null}
GET /api/v1/match/{matchId}/tables
```

Returns the standings rows relevant to the two teams in this match.

## FIFA Rankings

```text theme={null}
GET /api/v1/fifa/rankings
```

211 national teams ranked by FIFA points and grouped by confederation.

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.sportsapipro.com/v6/football/fifa/rankings"
```

```json theme={null}
{
  "success": true,
  "regions": [
    { "id": 1, "name": "UEFA" }, { "id": 2, "name": "CONMEBOL" },
    { "id": 3, "name": "CONCACAF" }, { "id": 4, "name": "CAF" },
    { "id": 5, "name": "AFC" }, { "id": 6, "name": "OFC" }
  ],
  "fifaRankings": [
    { "team": { "id": "8vmqy9i232b4k9r", "name": "Argentina" }, "points": 1877 },
    { "team": { "name": "Spain"  }, "points": 1874 },
    { "team": { "name": "France" }, "points": 1870 }
  ]
}
```

## Database Rankings (with History)

```text theme={null}
GET /api/v1/rankings?sport_id=1
```

Same 211 teams **plus 348 historical publication timestamps** in `pubTimes[]` for tracking ranking changes over time.

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.sportsapipro.com/v6/football/rankings?sport_id=1"
```

**Cache TTL:** 1 hour for both ranking endpoints.
