FastF1 — Formula 1 Data
Setup
F1 requires extra dependencies (fastf1 + pandas). Install with:
which sports-skills || pip install sports-skills[f1]
If already installed without F1 support, add the extra:
pip install sports-skills[f1]
If pip install fails with a Python version error, the package requires Python 3.10+. Find a compatible Python:
python3 --version # check version # If < 3.10, try: python3.12 -m pip install sports-skills[f1] # On macOS with Homebrew: /opt/homebrew/bin/python3.12 -m pip install sports-skills[f1]
No API keys required.
Quick Start
Prefer the CLI — it avoids Python import path issues:
sports-skills f1 get_race_schedule --year=2025 sports-skills f1 get_race_results --year=2025 --event=Monza
Python SDK (alternative):
from sports_skills import f1 schedule = f1.get_race_schedule(year=2025) results = f1.get_race_results(year=2025, event="Monza")
Commands
get_race_schedule
Get race schedule for a season.
- •
year(int, required): Season year
get_race_results
Get race results (positions, times, points).
- •
year(int, required): Season year - •
event(str, required): Event name (e.g., "Monza", "Silverstone")
get_session_data
Get detailed session data (qualifying, race, practice).
- •
session_year(int, required): Year - •
session_name(str, required): Event name - •
session_type(str, optional): "Q" (qualifying), "R" (race), "FP1", etc. Default: "Q"
get_driver_info
Get driver information for a season.
- •
year(int, required): Season year - •
driver(str, optional): Driver code or name. Omit for all drivers.
get_team_info
Get team information for a season.
- •
year(int, required): Season year - •
team(str, optional): Team name. Omit for all teams.
get_lap_data
Get lap-by-lap timing data.
- •
year(int, required): Season year - •
event(str, required): Event name - •
session_type(str, optional): Session type. Default: "R" - •
driver(str, optional): Driver code. Omit for all drivers.
Examples
User: "Show me the 2025 F1 calendar"
- •Call
get_race_schedule(year=2025) - •Present schedule with event names, dates, and circuits
User: "How did Verstappen do at Monza?"
- •Call
get_race_results(year=2025, event="Monza")for final classification - •Call
get_lap_data(year=2025, event="Monza", session_type="R", driver="VER")for lap times - •Present finishing position, gap to leader, fastest lap, and tire strategy
User: "Compare qualifying times at Silverstone"
- •Call
get_session_data(session_year=2025, session_name="Silverstone", session_type="Q") - •Call
get_lap_data(year=2025, event="Silverstone", session_type="Q")for all drivers - •Present Q1/Q2/Q3 times sorted by position
Troubleshooting
- •
sports-skillscommand not found: Package not installed. Runpip install sports-skills[f1]. If pip fails with a Python version error, you need Python 3.10+ — see Setup section. - •
ModuleNotFoundError: No module named 'sports_skills': Same as above — install the package. Prefer the CLI over Python imports to avoid path issues. - •ImportError on
from sports_skills import f1: F1 module requires extra dependencies beyond the base package. Runpip install sports-skills[f1]to add fastf1 + pandas. - •No data for future events: FastF1 only returns data for completed sessions. Future races appear in the schedule but have no session data.
- •Slow first request: FastF1 downloads and caches session data locally. First call for a given session may take 10-30 seconds. Subsequent calls are fast.
- •Event name not found: Use the exact event name from
get_race_schedule(). Common circuit names like "Monza" or "Silverstone" usually work as aliases. - •
fastest_lapfalse /fastest_lap_timeempty in race results: FastF1 doesn't always populate these fields. To find the actual fastest lap, useget_lap_data()and find the minimumlap_timeacross all drivers.