# GET /v2/teams/{id}/position-history

Group: Teams

Tracks a team’s league position week by week through one season, starting at week 1: the position at the end of each week and the fixtures played in it.

Plans: Every plan, Free included.

Note: Works only for league competitions that have a table, not for cups. In a week without a match, the previous week’s position carries over.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | DataSportsAPI team id, a positive integer |
| `league` | query | yes | league id, for instance one returned by /v2/teams/{id}/leagues |
| `season` | query | yes | season id, as listed by /v2/leagues/{id}/seasons |

## Response

- `data`: `PositionHistoryPoint[]`
- `meta`: league, season, count
- Objects: PositionHistoryPoint (https://datasportsapi.com/markdown/reference.md#positionhistorypoint)

## Errors

- 400 bad_request — league or season is absent or malformed
- 403 history_not_in_plan — the season finished before your plan’s history window begins
- 404 no_data — the source holds no position history for this team, league and season (an id DataSportsAPI never assigned gives 404 not_found instead)
- 404 not_found — the season id does not belong to this league; the error message names the offending parameter, and /v2/leagues/{id}/seasons lists the valid ones

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/teams/{id}/position-history?league=…&season=…"
```

TypeScript:

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

Python:

```python
res = client.teams.position_history(id, league=league, season=season)
```

Go:

```go
res, err := client.Teams.PositionHistory(ctx, id, &datasportsapi.TeamsPositionHistoryParams{League: league, Season: season})
```

CLI:

```bash
$ dsa teams position-history <id> --league <league> --season <season>
```

## Example response

```json
{ "data": [ { "week": 1, "from": "2026-08-21", "to": "2026-08-27", "position": 2, "fixtureIds": [201101] },
    { "week": 2, "from": "2026-08-28", "to": "2026-09-03", "position": 1, "fixtureIds": [201188] }, … ],
  "meta": { "league": 195828, "season": 200386, "count": 9 } }
```

---

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/teams/position-history/ · All docs: https://datasportsapi.com/markdown/docs.md · Data reference: https://datasportsapi.com/markdown/reference.md
