> ## 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 All Leagues and Active Leagues

> GET /leagues and GET /leagues/active return paginated lists of leagues for a given sport. Requires the fixtures scope and a sport query parameter.

The leagues endpoints let you browse the competition catalog for a given sport. Use `GET /leagues` to retrieve the full list of leagues your account can access, or `GET /leagues/active` to narrow the list to only leagues that currently have something happening — at least one match that is `NOT_STARTED`, `STARTED`, or `CLOSE_OF_PLAY` (a multi-day cricket Test between days).

## Endpoints

```
GET https://api.sportrixdata.com/api/leagues
GET https://api.sportrixdata.com/api/leagues/active
```

`/leagues/active` accepts the same parameters and returns the same shape as `/leagues`, but filters results to leagues with at least one live or upcoming match.

## Authentication and Scope

Both endpoints require the `fixtures` scope. Include your API key in the `X-API-Key` header.

## Query Parameters

<ParamField query="sport" type="integer" required>
  The sport id to list leagues for. Obtain this value from [`GET /sports`](/api/sports). Must be within your account's enabled sports allowlist.
</ParamField>

<ParamField query="limit" type="integer">
  Number of leagues to return per page. Default `100`, maximum `200`. Values above 200 are clamped to 200.
</ParamField>

<ParamField query="offset" type="integer">
  Number of leagues to skip before returning results. Default `0`. Use with `limit` to page through results.
</ParamField>

## Response

Both endpoints return a [pagination envelope](/concepts/pagination). Each item in `items` is a league object with the following fields:

| Field  | Type    | Description                                                  |
| ------ | ------- | ------------------------------------------------------------ |
| `id`   | integer | League id — use this as the `league` parameter in `/matches` |
| `name` | string  | Display name of the league                                   |

## Example Requests

```bash theme={null}
# All leagues for soccer (sport id 1)
curl "https://api.sportrixdata.com/api/leagues?sport=1" \
  -H "X-API-Key: $KEY"

# Only leagues with live or upcoming matches
curl "https://api.sportrixdata.com/api/leagues/active?sport=1" \
  -H "X-API-Key: $KEY"
```

## Example Response

```json theme={null}
{
  "items": [
    { "id": 172, "name": "USA USL W-League Women" }
  ],
  "total": 1,
  "limit": 100,
  "offset": 0,
  "count": 1,
  "page": 1,
  "total_pages": 1,
  "has_more": false
}
```

See the [Pagination guide](/concepts/pagination) for a full description of the envelope fields and how to page through results.
