For the complete documentation index, see llms.txt. This page is also available as Markdown.

Leagues and seasons

This guide covers how leagues and seasons are structured in the Motorsport API, how to retrieve them, and how to use them to navigate to the rest of the data hierarchy.

When to use this

Use leagues and seasons when you want to:

  • Find the league ID and current season ID before making other requests

  • Build a season selector for a race calendar or standings page

  • Check whether a season is current, pending, or finished

  • Retrieve all seasons for a given championship

The hierarchy

League (championship)
  └── Season (calendar year)
        └── Stage (race weekend)
              └── Fixture (individual session)

A League is the championship, for example the Formula 1 World Championship. A Season is a calendar year within that championship. Most other requests in the API require a season_id or league_id, so retrieving these first is the usual starting point.

Retrieving leagues

Get all leagues in your subscription:

GET https://api.sportmonks.com/v3/motorsport/leagues
?api_token={your_token}

A league response looks like this:

To get the current season alongside the league in one call:

Retrieving seasons

Get all seasons for a specific league using the seasonLeagues filter:

A season response looks like this:

is_current indicates the active season. finished and pending let you determine whether a season is complete or yet to begin.

To get the current season only, filter for is_current after fetching the list, or use the currentSeason include on the league:

Working with the data

Find the current season ID

Build a season selector

Common pitfalls

Using league_id where season_id is required. Most data endpoints (fixtures, standings, stages) filter by season_id, not league_id. Always resolve the current season_id first rather than passing the league ID to a downstream request.

Assuming is_current returns a boolean. The is_current field returns an integer: 1 for the current season, 0 otherwise. Use === 1 rather than a truthy check in strictly typed code.

Not paginating the seasons list. A championship with many years of history can have more seasons than the default page size. Use cursor-based pagination to retrieve the full list. See Pagination.

tie_breaker_rule_id and games_in_current_week are not used in the Motorsport API. These fields exist on the Season entity for cross-sport compatibility but are not applicable to motorsport data. Treat them as null.

Common errors

Status
Likely cause

401

Missing or invalid api_token

404

The league or season ID does not exist in your subscription

See also

Related tutorials

Reference

FAQ

What is the Formula 1 league ID? The league ID for Formula 1 is 3468, as shown in the example response above. You can confirm this by calling GET /motorsport/leagues with your token.

How do I get the season ID for a specific year? Filter seasons by league, then match on the name field which contains the calendar year (e.g. "2025").

Is there always exactly one current season? In practice yes, but defensively code for the possibility of zero results from the is_current filter in case the season transition has not yet been applied on Sportmonks' side.

What does standings_recalculated_at mean? It is the timestamp of the last standings recalculation for that season. Useful for knowing whether standings data is fresh after a race weekend.

Last updated

Was this helpful?