Ergast#
- class fastf1.ergast.Ergast(result_type='pandas', auto_cast=True, limit=None)[source]#
The main object that acts as an interface to the Ergast API.
For each API endpoint, there is a separate method implemented to request data.
- Parameters:
result_type (
Literal['raw','pandas']) –Determines the default type of the returned result object
’raw’:
ErgastRawResponse’pandas’:
ErgastSimpleResponseorErgastMultiResponsedepending on endpoint
auto_cast (
bool) – Determines whether result values are cast from there default string representation to a better matching typelimit (
Optional[int]) – The maximum number of results returned by the API. Defaults to 30 if not set. Maximum: 1000. See also “Response Paging” on https://ergast.com/mrd/.
Methods:
get_seasons([circuit, constructor, driver, ...])Get a list of seasons.
get_race_schedule(season[, round, circuit, ...])Get a list of races.
get_driver_info([season, round, circuit, ...])Get a list of drivers.
get_constructor_info([season, round, ...])Get a list of constructors.
get_circuits([season, round, constructor, ...])Get a list of circuits.
get_finishing_status([season, round, ...])Get a list of finishing status codes.
get_race_results([season, round, circuit, ...])Get race results for one or multiple races.
get_qualifying_results([season, round, ...])Get qualifying results for one or multiple qualifying sessions.
get_sprint_results([season, round, circuit, ...])Get sprint results for one or multiple sprints.
get_driver_standings([season, round, ...])Get driver standings at specific points of a season.
get_constructor_standings([season, round, ...])Get constructor standings at specific points of a season.
get_lap_times(season, round[, lap_number, ...])Get sprint results for one or multiple sprints.
get_pit_stops(season, round[, stop_number, ...])Get pit stop information for one or multiple sessions.
- get_seasons(circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get a list of seasons.
See: https://ergast.com/mrd/methods/seasons/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, url: seasonUrl <str> } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:season <int> seasonUrl <str>
- Parameters:
circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
- Returns:
ErgastSimpleResponseorErgastRawResponse, depending on theresult_typeparameter
- get_race_schedule(season, round=None, circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get a list of races.
See: https://ergast.com/mrd/methods/schedule/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, url: raceUrl <str>, raceName: raceName <str>, date: raceDate <Optional>, time: raceTime <Optional>, Circuit: { circuitId: circuitId <str>, url: circuitUrl <str>, circuitName: circuitName <str>, Location: { lat: lat <float>, long: long <float>, locality: locality <str>, country: country <str> } }, FirstPractice: { date: fp1Date <Optional>, time: fp1Time <Optional> }, SecondPractice: { date: fp2Date <Optional>, time: fp2Time <Optional> }, ThirdPractice: { date: fp3Date <Optional>, time: fp3Time <Optional> }, Qualifying: { date: qualifyingDate <Optional>, time: qualifyingTime <Optional> }, Sprint: { date: sprintDate <Optional>, time: sprintTime <Optional> } } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:season <int> round <int> raceUrl <str> raceName <str> raceDate <Optional> raceTime <Optional> circuitId <str> circuitUrl <str> circuitName <str> lat <float> long <float> locality <str> country <str> fp1Date <Optional> fp1Time <Optional> fp2Date <Optional> fp2Time <Optional> fp3Date <Optional> fp3Time <Optional> qualifyingDate <Optional> qualifyingTime <Optional> sprintDate <Optional> sprintTime <Optional>
- Parameters:
season (
Union[Literal['current'],int]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
- Returns:
ErgastSimpleResponseorErgastRawResponse, depending on theresult_typeparameter
- get_driver_info(season=None, round=None, circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get a list of drivers.
See: https://ergast.com/mrd/methods/drivers/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { driverId: driverId <str>, permanentNumber: driverNumber <int>, code: driverCode <str>, url: driverUrl <str>, givenName: givenName <str>, familyName: familyName <str>, dateOfBirth: dateOfBirth <Optional>, nationality: driverNationality <str> } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:driverId <str> driverNumber <int> driverCode <str> driverUrl <str> givenName <str> familyName <str> dateOfBirth <Optional> driverNationality <str>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
- Returns:
ErgastSimpleResponseorErgastRawResponse, depending on theresult_typeparameter
- get_constructor_info(season=None, round=None, circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get a list of constructors.
See: https://ergast.com/mrd/methods/constructors/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { constructorId: constructorId <str>, url: constructorUrl <str>, name: constructorName <str>, nationality: constructorNationality <str> } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:constructorId <str> constructorUrl <str> constructorName <str> constructorNationality <str>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
- Returns:
ErgastSimpleResponseorErgastRawResponse, depending on theresult_typeparameter
- get_circuits(season=None, round=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get a list of circuits.
See: https://ergast.com/mrd/methods/circuits/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { circuitId: circuitId <str>, url: circuitUrl <str>, circuitName: circuitName <str>, Location: { lat: lat <float>, long: long <float>, locality: locality <str>, country: country <str> } } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:circuitId <str> circuitUrl <str> circuitName <str> lat <float> long <float> locality <str> country <str>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
- Returns:
ErgastSimpleResponseorErgastRawResponse, depending on theresult_typeparameter
- get_finishing_status(season=None, round=None, circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get a list of finishing status codes.
See: https://ergast.com/mrd/methods/status/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { statusId: statusId <int>, count: count <int>, status: status <str> } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:statusId <int> count <int> status <str>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
- Returns:
ErgastSimpleResponseorErgastRawResponse, depending on theresult_typeparameter
- get_race_results(season=None, round=None, circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get race results for one or multiple races.
See: https://ergast.com/mrd/methods/results/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, url: raceUrl <str>, raceName: raceName <str>, date: raceDate <Optional>, time: raceTime <Optional>, Circuit: { circuitId: circuitId <str>, url: circuitUrl <str>, circuitName: circuitName <str>, Location: { lat: lat <float>, long: long <float>, locality: locality <str>, country: country <str> } }, Results: [ { number: number <int>, position: position <int>, positionText: positionText <str>, points: points <float>, grid: grid <int>, laps: laps <int>, status: status <str>, Driver: { driverId: driverId <str>, permanentNumber: driverNumber <int>, code: driverCode <str>, url: driverUrl <str>, givenName: givenName <str>, familyName: familyName <str>, dateOfBirth: dateOfBirth <Optional>, nationality: driverNationality <str> }, Constructor: { constructorId: constructorId <str>, url: constructorUrl <str>, name: constructorName <str>, nationality: constructorNationality <str> }, Time: { millis: totalRaceTimeMillis <int>, time: totalRaceTime <Optional> }, FastestLap: { rank: fastestLapRank <int>, lap: fastestLapNumber <int>, Time: { millis: fastestLapTimeMillis <int>, time: fastestLapTime <Optional> }, AverageSpeed: { units: fastestLapAvgSpeedUnits <str>, speed: fastestLapAvgSpeed <float> } }, AverageSpeed: { units: fastestLapAvgSpeedUnits <str>, speed: fastestLapAvgSpeed <float> } } ] } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:ErgastMultiResponse.descriptionseason <int> round <int> raceUrl <str> raceName <str> raceDate <Optional> raceTime <Optional> circuitId <str> circuitUrl <str> circuitName <str> lat <float> long <float> locality <str> country <str>
ErgastMultiResponse.content(contains data from subkeyRaceResults)number <int> position <int> positionText <str> points <float> grid <int> laps <int> status <str> driverId <str> driverNumber <int> driverCode <str> driverUrl <str> givenName <str> familyName <str> dateOfBirth <Optional> driverNationality <str> constructorId <str> constructorUrl <str> constructorName <str> constructorNationality <str> totalRaceTimeMillis <int> totalRaceTime <Optional> fastestLapRank <int> fastestLapNumber <int> fastestLapTimeMillis <int> fastestLapTime <Optional> fastestLapAvgSpeedUnits <str> fastestLapAvgSpeed <float>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
Union[ErgastMultiResponse,ErgastRawResponse]- Returns:
ErgastMultiResponseorErgastRawResponse, depending on theresult_typeparameter
- get_qualifying_results(season=None, round=None, circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, fastest_rank=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get qualifying results for one or multiple qualifying sessions.
See: https://ergast.com/mrd/methods/qualifying/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, url: raceUrl <str>, raceName: raceName <str>, date: raceDate <Optional>, time: raceTime <Optional>, Circuit: { circuitId: circuitId <str>, url: circuitUrl <str>, circuitName: circuitName <str>, Location: { lat: lat <float>, long: long <float>, locality: locality <str>, country: country <str> } }, QualifyingResults: [ { number: number <int>, position: position <int>, Q1: Q1 <Optional>, Q2: Q2 <Optional>, Q3: Q3 <Optional>, Driver: { driverId: driverId <str>, permanentNumber: driverNumber <int>, code: driverCode <str>, url: driverUrl <str>, givenName: givenName <str>, familyName: familyName <str>, dateOfBirth: dateOfBirth <Optional>, nationality: driverNationality <str> }, Constructor: { constructorId: constructorId <str>, url: constructorUrl <str>, name: constructorName <str>, nationality: constructorNationality <str> } } ] } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:ErgastMultiResponse.descriptionseason <int> round <int> raceUrl <str> raceName <str> raceDate <Optional> raceTime <Optional> circuitId <str> circuitUrl <str> circuitName <str> lat <float> long <float> locality <str> country <str>
ErgastMultiResponse.content(contains data from subkeyQualifyingResults)number <int> position <int> Q1 <Optional> Q2 <Optional> Q3 <Optional> driverId <str> driverNumber <int> driverCode <str> driverUrl <str> givenName <str> familyName <str> dateOfBirth <Optional> driverNationality <str> constructorId <str> constructorUrl <str> constructorName <str> constructorNationality <str>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)fastest_rank (
Optional[int]) – select fastest by rank number (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
Union[ErgastMultiResponse,ErgastRawResponse]- Returns:
ErgastMultiResponseorErgastRawResponse, depending on theresult_typeparameter
- get_sprint_results(season=None, round=None, circuit=None, constructor=None, driver=None, grid_position=None, results_position=None, status=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get sprint results for one or multiple sprints.
See: https://ergast.com/mrd/methods/sprint/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, url: raceUrl <str>, raceName: raceName <str>, date: raceDate <Optional>, time: raceTime <Optional>, Circuit: { circuitId: circuitId <str>, url: circuitUrl <str>, circuitName: circuitName <str>, Location: { lat: lat <float>, long: long <float>, locality: locality <str>, country: country <str> } }, SprintResults: [ { number: number <int>, position: position <int>, positionText: positionText <str>, points: points <float>, grid: grid <int>, laps: laps <int>, status: status <str>, Driver: { driverId: driverId <str>, permanentNumber: driverNumber <int>, code: driverCode <str>, url: driverUrl <str>, givenName: givenName <str>, familyName: familyName <str>, dateOfBirth: dateOfBirth <Optional>, nationality: driverNationality <str> }, Constructor: { constructorId: constructorId <str>, url: constructorUrl <str>, name: constructorName <str>, nationality: constructorNationality <str> }, Time: { millis: totalRaceTimeMillis <int>, time: totalRaceTime <Optional> }, FastestLap: { rank: fastestLapRank <int>, lap: fastestLapNumber <int>, Time: { millis: fastestLapTimeMillis <int>, time: fastestLapTime <Optional> }, AverageSpeed: { units: fastestLapAvgSpeedUnits <str>, speed: fastestLapAvgSpeed <float> } }, AverageSpeed: { units: fastestLapAvgSpeedUnits <str>, speed: fastestLapAvgSpeed <float> } } ] } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:ErgastMultiResponse.descriptionseason <int> round <int> raceUrl <str> raceName <str> raceDate <Optional> raceTime <Optional> circuitId <str> circuitUrl <str> circuitName <str> lat <float> long <float> locality <str> country <str>
ErgastMultiResponse.content(contains data from subkeySprintResults)number <int> position <int> positionText <str> points <float> grid <int> laps <int> status <str> driverId <str> driverNumber <int> driverCode <str> driverUrl <str> givenName <str> familyName <str> dateOfBirth <Optional> driverNationality <str> constructorId <str> constructorUrl <str> constructorName <str> constructorNationality <str> totalRaceTimeMillis <int> totalRaceTime <Optional> fastestLapRank <int> fastestLapNumber <int> fastestLapTimeMillis <int> fastestLapTime <Optional> fastestLapAvgSpeedUnits <str> fastestLapAvgSpeed <float>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)circuit (
Optional[str]) – select a circuit by its circuit id (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)grid_position (
Optional[int]) – select a grid position by its number (default: all)results_position (
Optional[int]) – select a finishing result by its position (default: all)status (
Optional[str]) – select by finishing status (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
Union[ErgastMultiResponse,ErgastRawResponse]- Returns:
ErgastMultiResponseorErgastRawResponse, depending on theresult_typeparameter
- get_driver_standings(season=None, round=None, driver=None, standings_position=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get driver standings at specific points of a season.
See: https://ergast.com/mrd/methods/standings/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, DriverStandings: [ { position: position <int>, positionText: positionText <str>, points: points <float>, wins: wins <int>, Driver: { driverId: driverId <str>, permanentNumber: driverNumber <int>, code: driverCode <str>, url: driverUrl <str>, givenName: givenName <str>, familyName: familyName <str>, dateOfBirth: dateOfBirth <Optional>, nationality: driverNationality <str> }, Constructors: [ { constructorId: constructorIds <str>, url: constructorUrls <str>, name: constructorNames <str>, nationality: constructorNationalities <str> } ] } ] } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:ErgastMultiResponse.descriptionseason <int> round <int>
ErgastMultiResponse.content(contains data from subkeyDriverStandings)position <int> positionText <str> points <float> wins <int> driverId <str> driverNumber <int> driverCode <str> driverUrl <str> givenName <str> familyName <str> dateOfBirth <Optional> driverNationality <str> constructorIds [<str>] constructorUrls [<str>] constructorNames [<str>] constructorNationalities [<str>]
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)standings_position (
Optional[int]) – select a result by position in the standings (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
Union[ErgastMultiResponse,ErgastRawResponse]- Returns:
ErgastMultiResponseorErgastRawResponse, depending on theresult_typeparameter
- get_constructor_standings(season=None, round=None, constructor=None, standings_position=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get constructor standings at specific points of a season.
See: https://ergast.com/mrd/methods/standings/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, ConstructorStandings: [ { position: position <int>, positionText: positionText <str>, points: points <float>, wins: wins <int>, Constructor: { constructorId: constructorId <str>, url: constructorUrl <str>, name: constructorName <str>, nationality: constructorNationality <str> } } ] } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:ErgastMultiResponse.descriptionseason <int> round <int>
ErgastMultiResponse.content(contains data from subkeyConstructorStandings)position <int> positionText <str> points <float> wins <int> constructorId <str> constructorUrl <str> constructorName <str> constructorNationality <str>
- Parameters:
season (
Union[Literal['current'],int,None]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int,None]) – select a round by its number (default: all)constructor (
Optional[str]) – select a constructor by its constructor id (default: all)standings_position (
Optional[int]) – select a result by position in the standings (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
Union[ErgastMultiResponse,ErgastRawResponse]- Returns:
ErgastMultiResponseorErgastRawResponse, depending on theresult_typeparameter
- get_lap_times(season, round, lap_number=None, driver=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get sprint results for one or multiple sprints.
See: https://ergast.com/mrd/methods/laps/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, url: raceUrl <str>, raceName: raceName <str>, date: raceDate <Optional>, time: raceTime <Optional>, Circuit: { circuitId: circuitId <str>, url: circuitUrl <str>, circuitName: circuitName <str>, Location: { lat: lat <float>, long: long <float>, locality: locality <str>, country: country <str> } }, Laps: [ { number: number <int>, Timings: [ { driverId: driverId <str>, position: position <int>, time: time <Optional> } ] } ] } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:ErgastMultiResponse.descriptionseason <int> round <int> raceUrl <str> raceName <str> raceDate <Optional> raceTime <Optional> circuitId <str> circuitUrl <str> circuitName <str> lat <float> long <float> locality <str> country <str>
ErgastMultiResponse.content(contains data from subkeyLaps)number <int> driverId <str> position <int> time <Optional>
- Parameters:
season (
Union[Literal['current'],int]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int]) – select a round by its number (default: all)lap_number (
Optional[int]) – select lap times by a specific lap number (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
Union[ErgastMultiResponse,ErgastRawResponse]- Returns:
ErgastMultiResponseorErgastRawResponse, depending on theresult_typeparameter
- get_pit_stops(season, round, stop_number=None, lap_number=None, driver=None, result_type=None, auto_cast=None, limit=None, offset=None)[source]#
Get pit stop information for one or multiple sessions.
See: https://ergast.com/mrd/methods/standings/
API Mapping
Structure of the raw response, renamed key names for flattening and dtypes for automatic type casting:[ { season: season <int>, round: round <int>, url: raceUrl <str>, raceName: raceName <str>, date: raceDate <Optional>, time: raceTime <Optional>, Circuit: { circuitId: circuitId <str>, url: circuitUrl <str>, circuitName: circuitName <str>, Location: { lat: lat <float>, long: long <float>, locality: locality <str>, country: country <str> } }, PitStops: [ { driverId: driverId <str>, stop: stop <int>, lap: lap <int>, time: time <Optional>, duration: duration <Optional>, Driver: { driverId: driverId <str>, permanentNumber: driverNumber <int>, code: driverCode <str>, url: driverUrl <str>, givenName: givenName <str>, familyName: familyName <str>, dateOfBirth: dateOfBirth <Optional>, nationality: driverNationality <str> }, Constructors: [ { constructorId: constructorIds <str>, url: constructorUrls <str>, name: constructorNames <str>, nationality: constructorNationalities <str> } ] } ] } ]DataFrame Description
DataFrame column names and dtypes for automatic typecasting:ErgastMultiResponse.descriptionseason <int> round <int> raceUrl <str> raceName <str> raceDate <Optional> raceTime <Optional> circuitId <str> circuitUrl <str> circuitName <str> lat <float> long <float> locality <str> country <str>
ErgastMultiResponse.content(contains data from subkeyPitStops)driverId <str> stop <int> lap <int> time <Optional> duration <Optional> driverNumber <int> driverCode <str> driverUrl <str> givenName <str> familyName <str> dateOfBirth <Optional> driverNationality <str> constructorIds [<str>] constructorUrls [<str>] constructorNames [<str>] constructorNationalities [<str>]
- Parameters:
season (
Union[Literal['current'],int]) – select a season by its year (default: all, oldest first)round (
Union[Literal['last'],int]) – select a round by its number (default: all)lap_number (
Optional[int]) – select pit stops by a specific lap number (default: all)stop_number (
Optional[int]) – select pit stops by their stop number (default: all)driver (
Optional[str]) – select a driver by its driver id (default: all)result_type (
Optional[Literal['pandas','raw']]) – Overwrites the default result typeauto_cast (
Optional[bool]) – Overwrites the default value forauto_castlimit (
Optional[int]) – Overwrites the default value forlimitoffset (
Optional[int]) – An offset into the result set for response paging. Defaults to 0 if not set. See also “Response Paging”, https://ergast.com/mrd/.
- Return type:
Union[ErgastMultiResponse,ErgastRawResponse]- Returns:
ErgastMultiResponseorErgastRawResponse, depending on theresult_typeparameter