# GET /v2/players/{id}/last-year

Group: Players

A player’s past twelve months as one timeline, oldest first: every match he played with his rating, minutes, goals, assists and expected goals, the matches he sat on the bench or missed (with the reason), his injuries and his transfers, plus the leagues those lines refer to.

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

Note: Each line has a type (match, bench, missing, injury, transfer). The match figures are filled on match lines only and are null on the others; missingReason is set on missing lines. Football and ice hockey only, for the players the source tracks this way; anyone else gets two empty lists. Lines dated before your plan’s history are left out, and meta.historyFrom then gives the first day included.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | DataSportsAPI player id, a positive integer |

## Response

- `data`: `PlayerYearSummary`
- `meta`: count (lines), and historyFrom if your plan caused older lines to be dropped
- Objects: PlayerYearSummary (https://datasportsapi.com/markdown/reference.md#playeryearsummary)

## Errors

- 404 not_found — DataSportsAPI has never issued this player id

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}/last-year"
```

TypeScript:

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

Python:

```python
res = client.players.last_year(id)
```

Go:

```go
res, err := client.Players.LastYear(ctx, id)
```

CLI:

```bash
$ dsa players last-year <id>
```

## Example response

```json
{ "data": { "entries": [ { "type": "match", "at": "2025-12-02T20:00:00.000Z", "fixtureId": 201554, "playedForId": 4402, "leagueId": 200008,
      "rating": 5.4, "minutesPlayed": 67, "goals": 0, "assists": 0, "expectedGoals": 1.23, "goalsConceded": 1, "saves": 0, "missingReason": null },
      { "type": "missing", "at": "2026-03-03T20:00:00.000Z", "fixtureId": 201990, …, "missingReason": "injury" }, … ],
    "leagues": [ { "id": 200008, "name": "LaLiga", … } ] },
  "meta": { "count": 69 } }
```

---

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