LiveF1 API - livef1

Functions

get_season(season)

Retrieve data for a specified Formula 1 season.

get_meeting(season[, meeting_identifier, ...])

Retrieve data for a specific meeting in a given season.

get_session(season[, meeting_identifier, ...])

Retrieve data for a specific session within a meeting and season.

livef1.api.get_meeting(season: int, meeting_identifier: str = None, meeting_key: int = None) Meeting[source]

Retrieve data for a specific meeting in a given season.

Parameters:
seasonint

The year of the season to retrieve the meeting from.

meeting_identifierstr

The identifier (e.g., circuit name, grand prix name) of the meeting. The identifier is going to be searched in the season’s meeting table columns:

  • “Meeting Official Name”

  • “Meeting Name”

  • “Circuit Short Name”

Therefore, it is suggested to use keywords that is distinguishable among meetings. Another suggestion is using circuit names for querying.

meeting_keyint

The key of the meeting to get the desired meeting whose key is matching.

Returns:
Meeting

A Meeting object containing sessions and metadata for the specified meeting.

Raises:
livef1Exception

If the meeting cannot be found based on the provided parameters.

livef1.api.get_season(season: int) Season[source]

Retrieve data for a specified Formula 1 season.

Parameters:
seasonint

The year of the season to retrieve.

Returns:
Season

A Season object containing all meetings and sessions for the specified year.

Raises:
livef1Exception

If no data is available for the specified season.

livef1.api.get_session(season: int, meeting_identifier: str = None, session_identifier: str = None, meeting_key: int = None, session_key: int = None) Session[source]

Retrieve data for a specific session within a meeting and season.

Parameters:
seasonint

The year of the season.

meeting_identifierstr

The identifier (e.g., circuit name, grand prix name) of the meeting. The identifier is going to be searched in the season’s meeting table columns:

  • “Meeting Official Name”

  • “Meeting Name”

  • “Circuit Short Name”

Therefore, it is suggested to use keywords that is distinguishable among meetings. Another suggestion is using circuit names for querying.

meeting_keyint

The key of the meeting to get the desired meeting whose key is matching.

session_identifierstr

The identifier of the session (e.g., “Practice 1”, “Qualifying”). The identifier is going to be searched in the meeting’s sessions table.

session_keyint

The key of the session to get the desired session whose key is matching.

Returns:
Session

A Session object containing data about the specified session.

Raises:
livef1Exception

If the session cannot be found based on the provided parameters.