Skip to main content

FastF1 Documentation

Access and analyze Formula 1 timing data, telemetry, and race results with a powerful Python package built for data scientists and motorsport enthusiasts.

Python

Quick Start

Get up and running with FastF1 in minutes

1

Install FastF1

Install the package using pip or conda:
pip install fastf1
FastF1 requires Python 3.10 or higher and includes all necessary dependencies including pandas, matplotlib, and numpy.
2

Enable caching

Configure caching to improve performance and avoid repeated API requests:
import fastf1

# Enable cache in a local directory
fastf1.Cache.enable_cache('path/to/cache')
Caching is highly recommended as session data can be 50-100MB. The cache stores data locally to speed up subsequent loads.
3

Load a session

Load session data using year, event name, and session identifier:
# Load the 2024 Monaco Grand Prix race
session = fastf1.get_session(2024, 'Monaco', 'R')
session.load()

# Access lap data
laps = session.laps
print(f"Total laps: {len(laps)}")
Session identifiers: 'FP1', 'FP2', 'FP3', 'Q' (Qualifying), 'S' (Sprint), 'R' (Race)
4

Analyze telemetry data

Extract and analyze detailed telemetry from any lap:
# Get fastest lap from a specific driver
verstappen_laps = laps.pick_driver('VER')
fastest_lap = verstappen_laps.pick_fastest()

# Get telemetry data
telemetry = fastest_lap.get_telemetry()

# Access speed, throttle, brake, and GPS data
print(telemetry[['Speed', 'Throttle', 'Brake', 'X', 'Y']])
Telemetry includes speed, RPM, gear, throttle, brake, DRS, and GPS position data at high resolution.

Explore by Topic

Find what you need to build powerful F1 data analysis tools

Sessions & Events

Learn how to access race weekends, sessions, and event schedules

Telemetry Data

Work with high-resolution telemetry including speed, throttle, and GPS data

Lap Timing

Analyze lap times, sectors, and driver performance metrics

Data Visualization

Create stunning visualizations with matplotlib integration

Ergast API

Access historical F1 data through the jolpica-f1 API

Caching

Optimize performance with intelligent caching strategies

Key Features

Everything you need for Formula 1 data analysis

Real-time & Historical Data

Access live timing data during race weekends and complete historical data from 2018 onwards through multiple data sources

Pandas DataFrames

All data is provided as extended Pandas DataFrames with F1-specific methods for easy manipulation and analysis

Matplotlib Integration

Built-in plotting utilities with team colors, driver styling, and tire compound colors for publication-ready visualizations

Intelligent Caching

Automatic caching of API requests reduces load times and enables offline analysis of previously loaded data

Ready to get started?

Install FastF1 and start analyzing Formula 1 data in minutes. Join thousands of data scientists and F1 enthusiasts using FastF1 for race analysis.