Overview
FastF1’s live timing module allows you to connect to Formula 1’s live timing data stream during sessions and record the data for later analysis. The data is streamed over the SignalR protocol.SignalRClient
Client for receiving and recording F1 timing data streamed live via SignalR.Constructor
Parameters
Filename (optionally with path) for the output file where data will be saved.
File mode for writing:
'w': Overwrite existing file'a': Append to existing file (useful if client restarts during a session)
Number of seconds after which the client automatically exits when no message data is received. Set to
0 to disable timeout.Custom logger instance. If
None, errors are logged to console using default configuration.If
True, attempts to connect without authentication. May only work for some sessions or return partial/empty data.Authentication is recommended for complete data access.
start()
Connect to the live timing stream and start recording data to file.- The session ends
- Timeout is reached (if configured)
- User interrupts with Ctrl+C
Example
Connection URL and Topics
The client connects to:Heartbeat- Connection heartbeatAudioStreams- Audio stream informationDriverList- List of drivers in sessionExtrapolatedClock- Session time extrapolationRaceControlMessages- Race control messages (flags, investigations, etc.)SessionInfo- Session metadataSessionStatus- Session status (started, finished, etc.)SessionData- General session dataTeamRadio- Team radio messagesTimingAppData- Timing app dataTimingData- Lap timing dataTimingStats- Timing statisticsTrackStatus- Track status (yellow flags, SC, VSC, red flags)WeatherData- Weather informationPosition.z- Car position data (compressed)CarData.z- Car telemetry data (compressed)ContentStreams- Content stream informationTopThree- Top 3 classificationRcmSeries- Race control message seriesLapCount- Current lap count
LiveTimingData
Data object for loading and accessing recorded live timing data.Constructor
Parameters
One or more filenames of recorded live timing data. Files should be in chronological order but may overlap.
If files overlap (e.g., last 5 minutes of file1 match first 5 minutes of file2), duplicates are automatically removed during loading.
load()
Read all files, parse the data, and organize it by category.Usually not called manually - automatically invoked when you first call
get(), has(), or list_categories().get()
Return data for a specific category.Parameters
Name of the data category (e.g., ‘TimingData’, ‘Position.z’, ‘WeatherData’)
Returns
List of[timedelta, message_data] pairs for that category
Automatically calls
load() on first access.has()
Check if data exists for a specific category.Parameters
Name of the category to check
Returns
bool - True if category exists, False otherwise
Automatically calls
load() on first access.list_categories()
List all available data categories in the loaded files.Returns
list[str] - List of category names
Automatically calls
load() on first access.Properties
Tuple of filenames that were provided to the constructor
Dictionary of parsed data, organized by category. Each category contains a list of
[timedelta, message] pairs.Number of JSON parsing errors encountered while loading data
Complete Workflow
Recording Live Data
Loading Recorded Data
After recording, load the data with FastF1’s standard API:Multiple Files
If you recorded data in multiple files (e.g., due to connection issues), you can load them all:Inspecting Data Categories
Advanced Usage
Custom Logger
Append Mode (Resume Recording)
No Authentication (Limited Data)
Data Format
Recorded data is saved as text with one message per line:- Category name (string)
- Message data (object)
- Timestamp (ISO 8601 string)
The format is not meant for direct consumption. Use
LiveTimingData to load and parse it.Helper Functions
messages_from_raw()
Extract data messages from raw recorded SignalR data (debug mode format, no longer used).Parameters
Iterable containing raw SignalR response data
Returns
tuple[list, int] - List of extracted messages and error count
This is primarily for legacy debug mode data. Modern recordings don’t need this.
Examples
Basic Live Recording
Load and Analyze Recorded Data
Record with Auto-Timeout
Troubleshooting
Connection fails or returns no data
Connection fails or returns no data
- Ensure you’re connecting during a live F1 session
- Try without
no_auth=True(authentication may be required) - Check your internet connection
- Check F1’s live timing is actually active
Client times out too quickly
Client times out too quickly
Increase the timeout value:
High error count when loading
High error count when loading
Some parsing errors are normal, but if
errorcount is very high:- Check if the file was corrupted
- Ensure recording completed successfully
- Try re-recording the session
Loading takes a long time
Loading takes a long time
Loading and parsing live timing data can take time for long sessions. This is normal. The data is automatically cached after the first load.
Notes
Authentication is handled automatically via F1’s auth system. You may need to be in a region where F1 TV is available.
Recorded data can be large for full race sessions (10-100 MB). Ensure you have adequate storage.
See Also
- Live Timing Guide - Comprehensive guide with examples
- Cache - Caching works with loaded live timing data
- Session - Use
session.load(livedata=...)to load recorded data
