
Fastf1
- 340 installs
- 201 repo stars
- Updated August 5, 2026
- machina-sports/sports-skills
Integrate FastF1 Python data for lap times, telemetry, standings, and race events into sports dashboards, models, or automated F1 analysis pipelines.
About
FastF1 integration skill for Formula 1 data: fetch lap times, telemetry, session results, and standings via Python to power sports analytics dashboards, content tools, and modeling pipelines.
- Lap, sector, and stint timing extraction
- Telemetry and car-performance metrics
- Session, event, and standings lookups
- Pandas-friendly race-weekend workflows
- Reusable patterns for F1 analytics apps
Fastf1 by the numbers
- 340 all-time installs (skills.sh)
- +7 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #553 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/machina-sports/sports-skills --skill fastf1Add your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 340 |
|---|---|
| repo stars | ★ 201 |
| Last updated | August 5, 2026 |
| Repository | machina-sports/sports-skills ↗ |
What it does
Integrate FastF1 Python data for lap times, telemetry, standings, and race events into sports dashboards, models, or automated F1 analysis pipelines.
Files
FastF1 — Formula 1 Data
Before writing queries, consult references/api-reference.md for endpoints, ID conventions, and data shapes.
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=MonzaPython SDK (alternative):
from sports_skills import f1
schedule = f1.get_race_schedule(year=2025)
results = f1.get_race_results(year=2025, event="Monza")CRITICAL: Before Any Query
CRITICAL: Before calling any data endpoint, verify:
- Year is derived from the system prompt's
currentDate— never hardcoded. - In January or February, use
year = current_year - 1(pre-season; the new F1 season has not started yet).
Choosing the Year
Derive the current year from the system prompt's date (e.g., currentDate: 2026-02-16 → current year is 2026).
- If the user specifies a year, use it as-is.
- If the user says "latest", "recent", "last season", or doesn't specify: The F1 season runs roughly March–December. If the current month is January or February, use
year = current_year - 1. From March onward, use the current year.
Workflows
Race Weekend Analysis
1. get_race_schedule --year=<year> — find the event name and date 2. get_race_results --year=<year> --event=<name> — final classification (positions, times, points) 3. get_lap_data --year=<year> --event=<name> --session_type=R — lap-by-lap pace analysis 4. get_tire_analysis --year=<year> --event=<name> — strategy breakdown (compounds, stint lengths, degradation)
Driver/Team Comparison
1. get_championship_standings --year=<year> — championship context (points, wins, podiums) 2. get_team_comparison --year=<year> --team1=<t1> --team2=<t2> OR get_driver_comparison --year=<year> --driver1=<d1> --driver2=<d2> 3. get_season_stats --year=<year> — aggregate performance (fastest laps, top speeds)
Season Overview
1. get_race_schedule --year=<year> — full calendar with dates and circuits 2. get_championship_standings --year=<year> — driver and constructor standings 3. get_season_stats --year=<year> — season-wide fastest laps, top speeds, points leaders 4. get_driver_info --year=<year> — current grid (driver numbers, teams, nationalities)
Commands
| Command | Description |
|---|---|
get_race_schedule | Full season calendar with dates and circuits |
get_race_results | Final race classification (positions, times, points) |
get_session_data | Raw session info (Q, FP1, FP2, FP3, R) |
get_driver_info | Driver details from the grid |
get_team_info | Team info with driver lineup |
get_lap_data | Lap-by-lap timing with sectors and tire data |
get_pit_stops | Pit stop durations and team averages |
get_speed_data | Speed trap and intermediate speed data |
get_championship_standings | Driver and constructor championship standings |
get_season_stats | Aggregate season performance |
get_team_comparison | Team head-to-head: qualifying, race pace, sectors |
get_driver_comparison | Driver head-to-head: qualifying H2H, race H2H, pace delta |
get_tire_analysis | Tire strategy, stint lengths, degradation rates |
See references/api-reference.md for full parameter lists and return shapes.
Examples
Example 1: F1 calendar User says: "Show me the F1 calendar" Actions: 1. Derive year from currentDate 2. Call get_race_schedule(year=<derived_year>) Result: Full calendar with event names, dates, and circuits
Example 2: Driver race performance User says: "How did Verstappen do at Monza?" Actions: 1. Derive year from currentDate (or from context) 2. Call get_race_results(year=<year>, event="Monza") for final classification 3. Call get_lap_data(year=<year>, event="Monza", session_type="R", driver="VER") for lap times Result: Finishing position, gap to leader, fastest lap, and tire strategy
Example 3: Latest results queried in pre-season User says: "What were the latest F1 results?" (asked in February 2026) Actions: 1. Current month is February → season not yet started → use year = 2025 2. Call get_race_schedule(year=2025) to find the last event of that season 3. Call get_race_results(year=2025, event=<last_event>) for the final race results Result: Results of the final 2025 race
Commands that DO NOT exist — never call these
- ~~
get_qualifying~~ / ~~get_practice~~ — does not exist. Useget_session_datawithsession_type="Q"for qualifying orsession_type="FP1"/"FP2"/"FP3"for practice. - ~~
get_standings~~ — does not exist. Useget_championship_standingsinstead. - ~~
get_results~~ — does not exist. Useget_race_resultsinstead. - ~~
get_calendar~~ — does not exist. Useget_race_scheduleinstead.
If a command is not listed in the Commands table above, it does not exist.
Troubleshooting
Error: Event name not found Cause: Event name spelling does not match FastF1's internal naming Solution: Call get_race_schedule(year=<year>) first to get the exact event names, then retry with the correct name
Error: Session data is empty Cause: The session has not happened yet Solution: FastF1 only returns data for completed sessions. Check get_race_schedule for when the session is scheduled
Error: get_race_results returns no fastest_lap_time Cause: Some races do not include fastest lap data in the results endpoint Solution: Use get_lap_data(session_type="R") and find the minimum lap_time across all drivers
Error: Querying the current year in January or February returns no data Cause: The new F1 season has not started yet Solution: Use year = current_year - 1 for any pre-March query; do not query the current year before March
FastF1 — API Reference
Commands
| Command | Required | Optional | Description |
|---|---|---|---|
get_race_schedule | year | Full season calendar with dates and circuits | |
get_race_results | year, event | Final race classification (positions, times, points) | |
get_session_data | session_year, session_name, session_type | Raw session info (Q, FP1, FP2, FP3, R) | |
get_driver_info | year, driver | Driver details from the grid | |
get_team_info | year, team | Team info with driver lineup | |
get_lap_data | year, event, session_type, driver | Lap-by-lap timing with sectors and tire data | |
get_pit_stops | year, event, driver | Pit stop durations and team averages | |
get_speed_data | year, event, driver | Speed trap and intermediate speed data | |
get_championship_standings | year | Driver and constructor championship standings | |
get_season_stats | year | Aggregate season performance (fastest laps, top speeds) | |
get_team_comparison | year, team1, team2, event | Team head-to-head: qualifying, race pace, sectors | |
get_driver_comparison | year, driver1, driver2, event | Driver head-to-head: qualifying H2H, race H2H, pace delta | |
get_tire_analysis | year, event, driver | Tire strategy, stint lengths, and degradation rates |
See references/commands.md and references/schemas.md for detailed parameter descriptions and return schemas.
Session Types
| Code | Session |
|---|---|
R | Race |
Q | Qualifying |
FP1 | Free Practice 1 |
FP2 | Free Practice 2 |
FP3 | Free Practice 3 |
Year Selection Rules
The F1 season runs roughly March–December.
- January or February: Use
year = current_year - 1(pre-season; new season not started). - March onward: Use
current_year(season has started or is imminent). - Always derive from the system prompt's
currentDate.
FastF1 — Valid Commands & Common Mistakes
Valid Commands
These are the ONLY valid commands. Do not invent or guess command names:
get_race_scheduleget_race_resultsget_session_dataget_driver_infoget_team_infoget_lap_dataget_pit_stopsget_speed_dataget_championship_standingsget_season_statsget_team_comparisonget_driver_comparisonget_tire_analysis
Commands That DO NOT Exist (Commonly Hallucinated)
- ~~
get_driver_results~~ — useget_race_resultsand filter by driver, or useget_lap_datawith thedriverparameter. - ~~
get_standings~~ — useget_championship_standings. - ~~
get_fastest_laps~~ — useget_lap_dataand find the minimumlap_time, or useget_season_statsfor season-wide fastest laps. - ~~
get_tire_strategy~~ — useget_tire_analysisfor full tire strategy and degradation data. - ~~
get_circuit_info~~ — circuit details are included inget_race_scheduleoutput.
If you're unsure whether a command exists, check this list. Do not try commands that aren't listed above.
Command Parameter Reference
get_race_schedule
year(int, required): Season year
get_race_results
year(int, required): Season yearevent(str, required): Event name (e.g., "Monza", "Silverstone")
get_session_data
session_year(int, required): Yearsession_name(str, required): Event namesession_type(str, optional): "Q" (qualifying), "R" (race), "FP1", etc. Default: "Q"
get_driver_info
year(int, required): Season yeardriver(str, optional): Driver code or name. Omit for all drivers.
get_team_info
year(int, required): Season yearteam(str, optional): Team name. Omit for all teams.
get_lap_data
year(int, required): Season yearevent(str, required): Event namesession_type(str, optional): Session type. Default: "R"driver(str, optional): Driver code. Omit for all drivers.
get_pit_stops
year(int, required): Season yearevent(str, optional): Event name. Omit for full season.driver(str, optional): Driver code. Omit for all drivers.
get_speed_data
year(int, required): Season yearevent(str, optional): Event name. Omit for full season.driver(str, optional): Driver code. Omit for all drivers.
get_championship_standings
year(int, required): Season year
get_season_stats
year(int, required): Season year
get_team_comparison
year(int, required): Season yearteam1(str, required): First team name (e.g., "Red Bull")team2(str, required): Second team name (e.g., "McLaren")event(str, optional): Event name. Omit for full season.
get_driver_comparison
year(int, required): Season yeardriver1(str, required): Driver code or name (e.g., "NOR", "Norris")driver2(str, required): Driver code or name (e.g., "PIA", "Piastri")event(str, optional): Event name. Omit for full season. Supports "last" for most recent race.
get_tire_analysis
year(int, required): Season yearevent(str, optional): Event name. Omit for full season.driver(str, optional): Driver code. Omit for all drivers.
FastF1 — Return Schemas
get_race_results
Returns data[] list. Fields: position (int), driver (abbreviation), full_name, team, grid_position (int), points (int), status, time, fastest_lap (bool), fastest_lap_time.
Note: fastest_lap and fastest_lap_time are not always populated by FastF1. To find the actual fastest lap, use get_lap_data() and find the minimum lap_time across all drivers.
get_driver_info
Returns data as a list of driver objects (not a dict). Fields: driver_number, driver_code, full_name, team_name, country_code, headshot_url.
get_team_info
Returns data as a list of team objects. Fields: team_name, team_color, drivers[].
get_championship_standings
Returns data.driver_standings[] with fields: position, driver_code, full_name, team, points, wins, podiums.
Returns data.constructor_standings[] with fields: position, team, points, wins.
get_race_schedule
Returns schedule entries with event names, dates, circuits, and session times.
get_session_data
Returns detailed session data including lap times, sector times, and speed trap data for qualifying, race, or practice sessions.
get_lap_data
Returns lap-by-lap timing data with lap numbers, lap times, sector times, and compound information.
get_pit_stops
Returns pit stop data with pit-in/pit-out times, durations, and lap numbers.
get_speed_data
Returns speed trap data with intermediate speeds, speed trap values, and finish line speeds.
get_season_stats
Returns aggregated season statistics: fastest laps, top speeds, points, wins, and podiums per driver/team.
get_team_comparison
Returns head-to-head comparison data: qualifying deltas, race pace differences, sector comparisons, and points.
get_driver_comparison
Returns head-to-head driver comparison data: qualifying H2H record, race H2H record, pace deltas, and per-race breakdowns. Works for teammates and cross-team matchups.
get_tire_analysis
Returns tire strategy data: compound usage, stint lengths, degradation rates, and pit stop strategies.
#!/bin/bash
# Validates fastf1 parameters
MONTH=$(date +%m)
YEAR=$(date +%Y)
# Season timing check
if [[ $MONTH -le 2 ]]; then
echo "INFO: F1 season hasn't started yet. Use year=$((YEAR - 1)) for most recent completed season."
fi
# Year parameter check
if [[ "$*" == *"--year="* ]]; then
Y=$(echo "$*" | grep -o '\-\-year=[^ ]*' | cut -d= -f2)
if [[ $Y -gt $YEAR ]]; then
echo "WARNING: Year $Y is in the future. No data will be available."
fi
fi
echo "OK"