Overview
The typical workflow for loading F1 data starts with identifying an event and session:Getting a Session
The primary entry point isget_session(), which returns a Session object based on year, event, and session identifier.
Function: get_session()
Championship year (e.g., 2021, 2023)
Event name as a string or round number as an integer. String matching uses fuzzy search by default.Examples:
'bahrain', 'Silverstone', 1 (first round)Session identifier - can be:
- Session name:
'Race','Qualifying','Practice 1' - Abbreviation:
'R','Q','FP1','FP2','FP3','S'(Sprint),'SQ'(Sprint Qualifying) - Session number:
1,2,3,4,5
Data source backend:
'fastf1': FastF1’s own backend (default, 2018-present)'f1timing': F1 live timing API (2018-present)'ergast': Ergast database (1950-present, limited features)
If
True, requires exact event name match instead of fuzzy searchUsage Examples
get_session() returns a Session object but does not load any data yet. You must call session.load() to fetch timing, telemetry, and other session-specific data.Getting an Event
You can also access the event object directly usingget_event().
Function: get_event()
Event object representing a complete race weekend.
Championship year
Event name (string) or round number (integer)
Event Class
TheEvent class represents a single race weekend and provides methods to access individual sessions.
Event Methods
get_session(identifier)
get_session(identifier)
Returns a
Session object for the specified session.get_race()
get_race()
Returns the race session.
get_qualifying()
get_qualifying()
Returns the qualifying session.
get_sprint()
get_sprint()
Returns the sprint session (if applicable).
get_practice(number)
get_practice(number)
Returns the specified practice session.
is_testing()
is_testing()
Returns
True if this is a testing event.Event Schedules
Getting the Event Schedule
EventSchedule object containing all events for a season.
EventSchedule Class
TheEventSchedule class extends pandas DataFrame and provides additional methods:
get_event_by_round(round)
get_event_by_round(round)
Get an event by its round number.
get_event_by_name(name, exact_match=False)
get_event_by_name(name, exact_match=False)
Get an event by name using fuzzy matching.
is_testing()
is_testing()
Returns a boolean Series indicating which events are testing events.
Available Event Data
Each event in the schedule contains:RoundNumber- Round number in the championshipCountry- Country where the event takes placeLocation- Specific location/circuitEventName- Short name of the eventOfficialEventName- Official full nameEventDate- Date of the event (usually race day)EventFormat- Format type:'conventional','sprint','sprint_shootout','sprint_qualifying', or'testing'Session1throughSession5- Names of each sessionSession1DatethroughSession5Date- Local timestamps for each sessionSession1DateUtcthroughSession5DateUtc- UTC timestamps for each sessionF1ApiSupport- Whether F1 API data is available
Testing Sessions
Pre-season testing sessions require special functions:Session Object
Once you have aSession object, you can access its properties:
Related Topics
- Loading Data - Learn how to load session data
- Lap Timing - Working with lap timing data
- Telemetry - Accessing telemetry data
