> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sportrix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /leagues — List Leagues Passed Through for a Sport

> GET /v1/pinnacle/leagues returns the leagues currently passed through for a sport, each with an id, name, and grouping. Filter with the sport query parameter.

Returns the leagues currently held for a sport. Use the `id` values to narrow [`GET /matches`](/passthrough/matches).

```text theme={null}
GET https://passthrough.sportrix.ai/v1/pinnacle/leagues?sport=12
```

**Scope:** `odds` · **Sportsbook grant:** `pinnacle`

## Query parameters

| Parameter | Type    | Required | Description                                                                                                                         |
| --------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `sport`   | integer | No       | Restrict to one sport id, from [`GET /sports`](/passthrough/sports). Omit it, or pass `0`, to return every league across all sports |

<Note>
  A `sport` value that is not a number is read as `0`, which returns **all** leagues rather than an error. Validate the parameter on your side if you need a strict filter.
</Note>

<Note>
  Results are filtered by your key's [per-sport grants](/passthrough/authentication#per-sport-grants). With no `sport` filter, leagues in ungranted sports are silently absent. With `?sport=<id>` for a sport you do not hold, this endpoint returns `403 {"error": "API key not permitted for sport <id>"}`.
</Note>

## Request

```bash theme={null}
curl "https://passthrough.sportrix.ai/v1/pinnacle/leagues?sport=12" \
  -H "X-API-Key: sk_your_api_key_here"
```

## Response

A bare JSON array, sorted ascending by `id`. A sport with no leagues held returns `[]`.

```json theme={null}
[
  {
    "id": 100,
    "sport_id": 12,
    "name": "CS2 - ESL Pro League",
    "group": "Counter-Strike 2",
    "sequence": 1
  }
]
```

### League object

| Field      | Type    | Description                                                                               |
| ---------- | ------- | ----------------------------------------------------------------------------------------- |
| `id`       | integer | The sportsbook's league id. Pass it as `league` to [`GET /matches`](/passthrough/matches) |
| `sport_id` | integer | The sport this league belongs to                                                          |
| `name`     | string  | League name as the sportsbook publishes it                                                |
| `group`    | string  | The sportsbook's grouping for the league, typically the game or region                    |
| `sequence` | integer | The sportsbook's display ordering hint. Not unique, and not a sort key on its own         |

## Errors

| Status | Cause                                                                                                    |
| ------ | -------------------------------------------------------------------------------------------------------- |
| `401`  | Missing, unknown, or inactive API key                                                                    |
| `403`  | Key lacks the `odds` scope or the `pinnacle` grant                                                       |
| `403`  | `?sport=<id>` names a sport the key is not granted — `{"error": "API key not permitted for sport <id>"}` |
| `503`  | Authentication backend unavailable                                                                       |
