# GET /v2/players/{id}/shot-chart

Group: Players

Basketball: every field-goal attempt a player took in one league season, grouped by spot with the number made and missed at each — the season shot chart (ice hockey too, where our data source keeps one).

Plans: Every plan, Free included.

Note: x and y give the distance from the basket in tenths of a foot, matching the frame of the match shot map (/v2/fixtures/{id}/shotmap). For the league’s shooting percentage per zone, see /v2/leagues/{id}/shooting-zones.

## 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 |
| `type` | query | no | overall \| home \| away \| regularSeason \| playoffs \| mainDraw (a tennis tournament’s main draw). When omitted, the season’s native type applies: overall if the season has one (football), otherwise regularSeason (NBA, NHL, …); meta.type reports the one applied |

## Response

- `data`: `SeasonShotChart`
- `meta`: league, season, type (as applied), count (number of spots)
- Objects: SeasonShotChart (https://datasportsapi.com/markdown/reference.md#seasonshotchart)

## Errors

- 403 history_not_in_plan — the season finished before your plan’s history window begins
- 404 no_data — no shot chart exists for this player, league and season

Plus the errors every /v2 call shares (https://datasportsapi.com/markdown/docs/errors.md).

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.datasportsapi.com/v2/players/{id}/shot-chart?league=…&season=…"
```

TypeScript:

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

Python:

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

Go:

```go
res, err := client.Players.ShotChart(ctx, id, &datasportsapi.PlayersShotChartParams{League: league, Season: season})
```

CLI:

```bash
$ dsa players shot-chart <id> --league <league> --season <season>
```

## Example response

```json
{ "data": { "spots": [ { "x": -243, "y": 36, "made": 1, "missed": 0 }, { "x": -240, "y": 32, "made": 0, "missed": 1 }, … ] },
  "meta": { "league": 132, "season": 100772, "type": "regularSeason", "count": 313 } }
```

---

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/shot-chart/ · Group: https://datasportsapi.com/markdown/docs/players.md · All docs: https://datasportsapi.com/markdown/docs.md · Data model: https://datasportsapi.com/markdown/reference.md
