PitchAPIDocumentationLeagues

Leagues API

The catalogue, one competition at a time, and the fixtures inside it.

GET /v1/leagues is the catalogue: every competition the API serves, with its ID, name, country and image. It is small, changes rarely, and is the right thing to fetch once and keep rather than request per page view.

One league is available by its l_ ID, and its matches by the same ID with an optional season and status. The season format differs: most European competitions run autumn to spring, while many elsewhere run a calendar year. The league record says which, and the fixtures endpoint accepts the season string the record uses.

The catalogue is the authoritative list. A league that is not in it has no matches to return, and a competition's name alone is not unique — several countries have a Premier League and more than one has a Serie A. Use the ID, or the country-qualified slug on the public league pages.

API reference

Endpoints

Every request takes an X-API-KEY header and returns the JSON envelope described on the overview.

GET/v1/leagues

List leagues

Every league, each with the seasons available. Seasons older than the current one and the previous one need Pro; the list shows the whole archive so a client can see what exists before it asks for it. The is_free flag is true for every league and is kept only so clients written against the old paid tier keep parsing.

Auth API keyResponse JSON
curl https://api.pitchapi.dev/v1/leagues \
  -H "X-API-KEY: $PITCH_KEY"
GET/v1/leagues/{id}

Retrieve a league

One league and its current season.

Auth API keyResponse JSON
idstringrequired

League ID, for example l_4Kd0Wq

curl https://api.pitchapi.dev/v1/leagues/{id} \
  -H "X-API-KEY: $PITCH_KEY"
GET/v1/leagues/{id}/matches

List league matches

Results for a season, and its upcoming fixtures. Pass `season` to pick one: 2025/2026 for fall-spring leagues, 2026 for calendar-year leagues. Defaults to the current season. The free plan reads the current season and the one before it; an older season answers `403 PLAN_UPGRADE_REQUIRED` and is served on Pro and Data. By default only played matches are returned; pass `status=upcoming` or `status=all` for the fixtures.

Auth API keyResponse JSONQuery 2
idstringrequired

League ID, for example l_4Kd0Wq

seasonstring

Season to fetch, for example 2025/2026. Defaults to the current season. Older than the current season and the one before it needs Pro.

statusstring

Which matches to return: played (default — settled results only), upcoming (fixtures not yet played, with a null score and status not_started), or all. Omit it to keep the historical played-only response.

curl https://api.pitchapi.dev/v1/leagues/{id}/matches \
  -H "X-API-KEY: $PITCH_KEY"
Questions

Common questions

How do I find a league ID?
Fetch /v1/leagues once and look the competition up by name and country. The ID is stable across seasons and is what every league endpoint accepts.
Why do season strings look different?
Competitions that run across a new year use a season like 2025/2026; calendar-year competitions use a single year. Use the format the league record returns rather than assuming one.
Something missing or wrong? That is a bug in the docs.Get a free key
On this page