# GET /v2/leagues/{id}/seasons

Group: Leagues

Lists the league’s seasons, most recent first. year is the label to display, while startYear / endYear hold the numeric years — identical when a season runs within one calendar year.

Plans: Every plan, Free included.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | league id issued by DataSportsAPI, a positive integer |

## Response

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

## Errors

- 404 no_data — our data source keeps no season list for this 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/leagues/{id}/seasons"
```

TypeScript:

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

Python:

```python
res = client.leagues.seasons(id)
```

Go:

```go
res, err := client.Leagues.Seasons(ctx, id)
```

CLI:

```bash
$ dsa leagues seasons <id>
```

## Example response

```json
{ "data": [ { "id": 200386, "name": "Premier League 26/27", "year": "26/27", "startYear": 2026, "endYear": 2027 }, … ],
  "meta": { "count": 34 } }
```

---

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