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

Group: Leagues

The teams taking part in one season of the league — also for cups and competitions without a table.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | our numeric id (positive integer) |
| `season` | query | yes | a season id from /v2/leagues/{id}/seasons |

## Response

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

## Errors

- 403 history_not_in_plan — the season ended before your plan’s history
- 404 not_found — season is not one of this league’s seasons

Plus the common errors (https://sportsapi.app/markdown/en/docs.md#errors).

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.sportsapi.app/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, &sportsapi.LeaguesTeamsParams{Season: season})
```

CLI:

```bash
$ sportsapi 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.sportsapi.app. Send your API key as `Authorization: Bearer <key>` on every /v2 request; keys are created in the dashboard (https://sportsapi.app/dashboard).
HTML: https://sportsapi.app/docs/leagues/teams · All docs: https://sportsapi.app/markdown/en/docs.md
