# GET /v2/leagues

Group: Discovery

The league directory: every league of one category, or of one sport in one country.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `category` | query | no | a category id from /v2/categories (alone — not with country) |
| `sport` | query | no | a sport slug — with country |
| `country` | query | no | a two-letter Country.code (EN, ES, US, …; any case) — with sport |

## Response

- `data`: `LeagueRef[]`
- `meta`: with category: category, count; with sport + country: sport, country, categoryIds (the categories of that country), count, complete (false when some category’s list could not be fetched right now — retry shortly)
- Objects: LeagueRef (https://sportsapi.app/markdown/en/reference.md#leagueref)

## Errors

- 400 bad_request — neither category nor sport + country, category together with country, a country that is not two letters, unknown sport
- 404 not_supported — a race-sport category or sport (motorsport, cycling): they have series, not leagues; the message names /v2/series?category=
- 503 upstream_unavailable — none of the country’s category lists could be fetched

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"
```

TypeScript:

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

Python:

```python
res = client.leagues.list()
```

Go:

```go
res, err := client.Leagues.List(ctx, &sportsapi.LeaguesListParams{})
```

CLI:

```bash
$ sportsapi leagues list
```

## Example response

```json
$ curl -H "Authorization: Bearer sk_live_…" "https://api.sportsapi.app/v2/leagues?sport=football&country=EN"

{ "data": [ { "id": 195828, "name": "Premier League", "slug": "premier-league", "sport": "football", "category": "England",
                "country": { "code": "EN", "name": "England" }, "image": "…" },
    { "id": 195836, "name": "Championship", … }, { "id": 195840, "name": "FA Cup", … }, … ],
  "meta": { "sport": "football", "country": "EN", "categoryIds": [456], "count": 41, "complete": true } }
```

---

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/discovery/leagues-list · All docs: https://sportsapi.app/markdown/en/docs.md
