# GET /v2/players/{id}/heatmap

Group: Players

Where a player was active over one league season (football): his match heatmaps added up — every point with how many samples fell on it — and the matches it covers.

Plans: Pro + Business only (other plans get 403 endpoint_not_in_plan).

Note: x / y are 0–100 like the match heatmap (x along the pitch in his team’s attacking direction). Weight the density by count. Football in covered leagues only.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | our numeric id (positive integer) |
| `league` | query | yes | a league id from /v2/players/{id}/seasons |
| `season` | query | yes | a season id from /v2/leagues/{id}/seasons |

## Response

- `data`: `SeasonHeatmap`
- `meta`: league, season, count (points)
- Objects: SeasonHeatmap (https://sportsapi.app/markdown/en/reference.md#seasonheatmap)

## Errors

- 403 history_not_in_plan — the season ended before your plan’s history
- 404 no_data — the source has no season heatmap for this player, league and season; 404 not_found — season is not one of this league’s seasons

Plus the common errors (https://sportsapi.app/markdown/en/docs.md#errors).

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.sportsapi.app/v2/players/{id}/heatmap?league=…&season=…"
```

TypeScript:

```ts
const { data, meta } = await client.players.heatmap(id, { league, season });
```

Python:

```python
res = client.players.heatmap(id, league=league, season=season)
```

Go:

```go
res, err := client.Players.Heatmap(ctx, id, &sportsapi.PlayersHeatmapParams{League: league, Season: season})
```

CLI:

```bash
$ sportsapi players heatmap <id> --league <league> --season <season>
```

## Example response

```json
{ "data": { "points": [ { "x": 69, "y": 9, "count": 1 }, { "x": 69, "y": 11, "count": 2 }, … ], "fixtureCount": 7, "fixtureIds": [701120, 701061, …] },
  "meta": { "league": 195828, "season": 200386, "count": 397 } }
```

---

Base URL: https://api.sportsapi.app. Send your API key as `Authorization: Bearer <key>` on every /v2 request; keys are created in the dashboard (https://sportsapi.app/dashboard).
HTML: https://sportsapi.app/docs/players/heatmap · All docs: https://sportsapi.app/markdown/en/docs.md
