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

Group: Leagues

Lists the participants of a single league season; works just as well for cups and other competitions that have no table.

Plans: Every plan, Free included.

## Parameters

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

## Response

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

## Errors

- 403 history_not_in_plan — your plan’s history window begins after this season ended
- 404 not_found — the season id does not belong to 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}/teams?season=…"
```

TypeScript:

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

Python:

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

Go:

```go
res, err := client.Leagues.Teams(ctx, id, &datasportsapi.LeaguesTeamsParams{Season: season})
```

CLI:

```bash
$ dsa leagues teams <id> --season <season>
```

## Example response

```json
{ "data": [ { "id": 18, "name": "Arsenal", "code": "ARS", … }, { "id": 17, "name": "Leeds United", "code": "LEE", … }, … ], "meta": { "season": 200386, "count": 20 } }
```

---

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