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

Group: Players

Football: a player’s match heatmaps summed over one league season to show where they were active — each point with the number of samples recorded on it — plus the matches included.

Plans: Requires Pro, Business or Enterprise; a Free or Starter key receives 403 endpoint_not_in_plan.

Note: x / y range from 0 to 100 as in the match heatmap, with x running along the pitch in the direction the player’s team attacks. Use count to weight the density. Limited to football in covered leagues.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | DataSportsAPI player id, a positive integer |
| `league` | query | yes | league id, as listed by /v2/players/{id}/seasons |
| `season` | query | yes | season id, as listed by /v2/leagues/{id}/seasons |

## Response

- `data`: `SeasonHeatmap`
- `meta`: league, season, count (number of points)
- Objects: SeasonHeatmap (https://datasportsapi.com/markdown/reference.md#seasonheatmap)

## Errors

- 403 history_not_in_plan — the season finished before your plan’s history window begins
- 404 no_data — for this player, league and season the source has no season heatmap; 404 not_found — the season id belongs to a different league

Plus the common errors (https://datasportsapi.com/markdown/docs.md#errors).

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.datasportsapi.com/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, &datasportsapi.PlayersHeatmapParams{League: league, Season: season})
```

CLI:

```bash
$ dsa 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.datasportsapi.com. Authenticate each /v2 call with the header `Authorization: Bearer <key>` (secret keys begin with `sk_live_`).
HTML: https://datasportsapi.com/docs/players/heatmap/ · All docs: https://datasportsapi.com/markdown/docs.md · Data reference: https://datasportsapi.com/markdown/reference.md
