Skip to content

Formula 1

F1 standings, results, calendars, lap times, and session timing as SQL tables

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/f1/index.md to help me query Formula 1 with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

The current championship top ten.

Example output Β· captured
Connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
SELECT position, driver_name, constructor_name, points, wins
FROM f1.main.current_driver_standings
ORDER BY position
LIMIT 10
Result Β· first 5 rows
position driver_name constructor_name points wins
1 Andrea Kimi Antonelli Mercedes 427 10
2 Max Verstappen Red Bull 316 4
3 George Russell Mercedes 282 3
4 Lewis Hamilton Ferrari 275 1
5 Lando Norris McLaren 274 3

Quick start

Choose where to run Formula 1, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'f1' AS f1 (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-f1'
);

3. Run a query

query.sql
SELECT position, driver_name, constructor_name, points, wins
FROM f1.main.current_driver_standings
ORDER BY position
LIMIT 10
More example queries β†’
Technical details
Verified connector release
v0.3.1
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'f1' AS f1 (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-f1'
);

Overview

Read-only Formula 1 results, standings, calendars, and session timing from Jolpica-F1 and OpenF1

Catalog

Everything f1 exposes once attached β€” read straight from the worker's released build.

f1 1 schema
main 5 tables Β· 27 functions

Formula 1 championships, results, calendars, and session timing

Schema examples (6)
Examples (6)

The current championship top ten.

SELECT position, driver_name, constructor_name, points, wins
FROM f1.main.current_driver_standings
ORDER BY position
LIMIT 10;
Result Β· first 5 rows
position driver_name constructor_name points wins
1 Andrea Kimi Antonelli Mercedes 427 10
2 Max Verstappen Red Bull 316 4
3 George Russell Mercedes 282 3
4 Lewis Hamilton Ferrari 275 1
5 Lando Norris McLaren 274 3

Points gap from each driver to the leader.

SELECT driver_name, points, max(points) OVER () - points AS gap_to_leader
FROM f1.main.current_driver_standings
ORDER BY position;

Championship top ten with each driver's finish and points in the latest Grand Prix.

SELECT s.position, s.driver_name, s.points, r.position AS last_race_finish,
  coalesce(r.points, 0) AS last_race_points
FROM f1.main.current_driver_standings s
LEFT JOIN f1.main.last_race_results r USING (driver_id)
ORDER BY s.position
LIMIT 10;

Sprint winner against Grand Prix winner on every 2024 sprint weekend.

WITH sp AS (SELECT round, race_name, driver_name AS sprint_winner FROM f1.main.sprint_results(2024) WHERE position = 1), gp AS (SELECT round, driver_name AS grand_prix_winner FROM f1.main.race_results(2024) WHERE position = 1) SELECT round, race_name, sprint_winner, grand_prix_winner, sprint_winner = grand_prix_winner AS won_both
FROM sp
JOIN gp USING (round)
ORDER BY round;
2 more examples

Max Verstappen's pace per stint in the 2024 Chinese Grand Prix, splitting his laps at each pit stop and leaving out in- and out-laps.

WITH stops AS (SELECT lap FROM f1.main.pit_stops(2024, 5) WHERE driver_id = 'max_verstappen'), laps AS (SELECT l.lap, l.lap_time_seconds, 1 + (SELECT count(*) FROM stops WHERE stops.lap < l.lap) AS stint FROM f1.main.lap_times(2024, 5, driver_id := 'max_verstappen') l) SELECT stint, min(lap) AS first_lap, max(lap) AS last_lap, min(lap_time_seconds) AS best_lap_seconds, median(lap_time_seconds) AS median_lap_seconds
FROM laps
WHERE lap NOT IN (SELECT lap FROM stops) AND lap NOT IN (SELECT lap + 1 FROM stops)
GROUP BY stint
ORDER BY stint;

Every driver's tyre sequence in the 2024 Bahrain Grand Prix (session 9472), in finishing order.

SELECT r.position, d.name_acronym, d.team_name, count(*) AS stints,
  string_agg(st.compound, ' > ' ORDER BY st.stint_number) AS strategy
FROM f1.main.session_stints(9472) st
JOIN f1.main.session_drivers(9472) d USING (driver_number)
JOIN f1.main.session_result(9472) r USING (driver_number)
GROUP BY r.position, d.name_acronym, d.team_name
ORDER BY r.position NULLS LAST, d.name_acronym;
Tables
current_constructor_standings 1 example9 cols

Current-season constructors' championship standings, one row per team

Columns
season INTEGER
Championship season year.
round INTEGER
Round number after which these standings apply.
position INTEGER
Constructors' championship position (1 = leader); null when unclassified.
position_text VARCHAR
Championship position as published.
points DECIMAL(7,2)
Count of constructors' championship points as an exact decimal.
wins INTEGER
Number of Grand Prix wins so far this season.
constructor_idnot null VARCHAR
Stable Jolpica/Ergast constructor identifier.
constructor_name VARCHAR
Constructor (team) name.
constructor_nationality VARCHAR
Nationality the team races under, as a demonym, for example Italian.
ConstraintsPRIMARY KEY (constructor_id)
Example

Current constructors' table.

SELECT position, constructor_name, points, wins
FROM f1.main.current_constructor_standings
ORDER BY position;
Link
current_driver_standings 3 examples15 cols

Current-season drivers' championship standings, one row per driver

Columns
season INTEGER
Championship season year.
round INTEGER
Round number after which these standings apply.
position INTEGER
Championship position (1 = leader); null when unclassified.
position_text VARCHAR
Championship position as published, '-' when unclassified.
points DECIMAL(7,2)
Count of championship points as an exact decimal (half points exist).
wins INTEGER
Number of Grand Prix wins so far this season.
driver_idnot null VARCHAR
Stable Jolpica/Ergast driver identifier.
driver_code VARCHAR
Three-letter driver code.
permanent_number INTEGER
Driver's permanent car number (chosen race number).
driver_name VARCHAR
Driver's full name.
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British.
constructor_id VARCHAR
Constructor identifier when the driver raced for exactly one team; null otherwise.
constructor_name VARCHAR
Constructor name when the driver raced for exactly one team; null otherwise.
constructor_ids VARCHAR
Comma-separated constructor identifiers this season.
constructor_names VARCHAR
Comma-separated constructor names this season.
ConstraintsPRIMARY KEY (driver_id)
Examples (3)

The current championship top ten.

SELECT position, driver_name, constructor_name, points, wins
FROM f1.main.current_driver_standings
ORDER BY position
LIMIT 10;
Result Β· first 5 rows
position driver_name constructor_name points wins
1 Andrea Kimi Antonelli Mercedes 427 10
2 Max Verstappen Red Bull 316 4
3 George Russell Mercedes 282 3
4 Lewis Hamilton Ferrari 275 1
5 Lando Norris McLaren 274 3

Points gap from each driver to the leader.

SELECT driver_name, points, max(points) OVER () - points AS gap_to_leader
FROM f1.main.current_driver_standings
ORDER BY position;

Championship top ten with each driver's finish and points in the latest Grand Prix.

SELECT s.position, s.driver_name, s.points, r.position AS last_race_finish,
  coalesce(r.points, 0) AS last_race_points
FROM f1.main.current_driver_standings s
LEFT JOIN f1.main.last_race_results r USING (driver_id)
ORDER BY s.position
LIMIT 10;
Link
current_schedule 1 example17 cols

Current-season race calendar, one row per round

Columns
season INTEGER
Championship season year.
roundnot null INTEGER
Round number within the season (1 = first race).
race_name VARCHAR
Grand Prix name.
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier.
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza.
locality VARCHAR
City or locality of the circuit.
country VARCHAR
Country of the circuit.
race_date DATE
Calendar date of the Grand Prix (local to the circuit).
race_start_utc TIMESTAMP WITH TIME ZONE
Scheduled race start in UTC; null when no time is published.
first_practice_utc TIMESTAMP WITH TIME ZONE
First practice start in UTC.
second_practice_utc TIMESTAMP WITH TIME ZONE
Second practice start in UTC.
third_practice_utc TIMESTAMP WITH TIME ZONE
Third practice start in UTC; null on sprint weekends.
sprint_qualifying_utc TIMESTAMP WITH TIME ZONE
Sprint qualifying (or sprint shootout) start in UTC.
sprint_utc TIMESTAMP WITH TIME ZONE
Sprint race start in UTC; null on non-sprint weekends.
qualifying_utc TIMESTAMP WITH TIME ZONE
Grand Prix qualifying start in UTC.
is_sprint_weekend BOOLEAN
Whether the weekend includes a sprint race.
wikipedia_url VARCHAR
Wikipedia article for the race.
ConstraintsPRIMARY KEY (round)
Example

Remaining races this season.

SELECT round, race_name, country, race_start_utc
FROM f1.main.current_schedule
WHERE race_date >= current_date
ORDER BY round;
Link
last_race_results 2 examples28 cols

Classification of the most recent Grand Prix, one row per driver

Columns
season INTEGER
Championship season year.
round INTEGER
Round number within the season (1 = first race).
race_name VARCHAR
Grand Prix name, for example Bahrain Grand Prix.
race_date DATE
Calendar date of the Grand Prix (local to the circuit).
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier.
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza.
country VARCHAR
Country of the circuit.
position INTEGER
Finishing position (classification order, including retirements).
position_text VARCHAR
Published classification: a number, or R retired, D disqualified, E excluded, W withdrawn, F failed to qualify, N not classified.
classified BOOLEAN
Whether position_text is numeric, i.e. the driver was classified.
points DECIMAL(7,2)
Championship points scored in this race.
car_number INTEGER
Race number displayed on the car (not a position).
driver_idnot null VARCHAR
Stable Jolpica/Ergast driver identifier, for example hamilton.
driver_code VARCHAR
Three-letter driver code, for example HAM.
driver_name VARCHAR
Driver's full name.
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British.
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier.
constructor_name VARCHAR
Constructor (team) name.
grid INTEGER
Starting grid position (1 = pole); 0 means a pit-lane start.
laps INTEGER
Number of laps completed.
status VARCHAR
Finishing status, for example Finished, +1 Lap, or Engine.
race_time_millis BIGINT
Elapsed race time in milliseconds as published; usually null for lapped or retired cars, but the archive also records it for some of them.
race_time VARCHAR
Published race time: absolute for the winner, a gap such as +5.123 for others; null when none is published.
fastest_lap_rank INTEGER
Rank of this driver's fastest lap among all drivers (1 = fastest).
fastest_lap_number INTEGER
Lap number on which the driver set their fastest lap.
fastest_lap_time VARCHAR
Fastest lap time as published, for example 1:32.608.
fastest_lap_seconds DECIMAL(10,3)
Fastest lap time in seconds as an exact decimal.
fastest_lap_avg_speed_kph DOUBLE
Average speed of the fastest lap in km/h; null where the archive does not publish it (sprints and races from 2025 onwards).
ConstraintsPRIMARY KEY (driver_id)
Examples (2)

Podium of the latest Grand Prix.

SELECT race_name, position, driver_name, constructor_name, race_time
FROM f1.main.last_race_results
WHERE position <= 3
ORDER BY position;

Biggest gainers from grid to finish in the latest race.

SELECT driver_name, grid, position, grid - position AS places_gained
FROM f1.main.last_race_results
WHERE classified AND grid > 0
ORDER BY places_gained DESC
LIMIT 5;
Link
seasons 1 example2 cols

Every Formula 1 World Championship season since 1950

Columns
seasonnot null INTEGER
Championship season year.
wikipedia_url VARCHAR
Wikipedia article for the season.
ConstraintsPRIMARY KEY (season)
Example

Seasons held so far.

SELECT count(*) AS seasons, max(season) AS latest FROM f1.main.seasons;
Link
Table functions
all_current_constructor_standings () 1 example

Current F1 constructors' championship standings (scan behind current_constructor_standings)

No arguments
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number after which these standings apply
position INTEGER
Constructors' championship position (1 = leader); null when unclassified
position_text VARCHAR
Championship position as published
points DECIMAL(7,2)
Count of constructors' championship points as an exact decimal
wins INTEGER
Number of Grand Prix wins so far this season
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
constructor_nationality VARCHAR
Nationality the team races under, as a demonym, for example Italian
Example

Current constructors' leader from the backing scan.

SELECT constructor_name, points
FROM f1.main.all_current_constructor_standings()
WHERE position = 1;
Link
all_current_driver_standings () 1 example

Current F1 drivers' championship standings (scan behind current_driver_standings)

No arguments
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number after which these standings apply
position INTEGER
Championship position (1 = leader); null when unclassified
position_text VARCHAR
Championship position as published, '-' when unclassified
points DECIMAL(7,2)
Count of championship points as an exact decimal (half points exist)
wins INTEGER
Number of Grand Prix wins so far this season
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier
driver_code VARCHAR
Three-letter driver code
permanent_number INTEGER
Driver's permanent car number (chosen race number)
driver_name VARCHAR
Driver's full name
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British
constructor_id VARCHAR
Constructor identifier when the driver raced for exactly one team; null otherwise
constructor_name VARCHAR
Constructor name when the driver raced for exactly one team; null otherwise
constructor_ids VARCHAR
Comma-separated constructor identifiers this season
constructor_names VARCHAR
Comma-separated constructor names this season
Example

Current championship top five from the backing scan.

SELECT position, driver_name, points
FROM f1.main.all_current_driver_standings()
ORDER BY position
LIMIT 5;
Link
all_current_schedule () 1 example

Current F1 season calendar (scan behind current_schedule)

No arguments
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
locality VARCHAR
City or locality of the circuit
country VARCHAR
Country of the circuit
race_date DATE
Calendar date of the Grand Prix (local to the circuit)
race_start_utc TIMESTAMP WITH TIME ZONE
Scheduled race start in UTC; null when no time is published
first_practice_utc TIMESTAMP WITH TIME ZONE
First practice start in UTC
second_practice_utc TIMESTAMP WITH TIME ZONE
Second practice start in UTC
third_practice_utc TIMESTAMP WITH TIME ZONE
Third practice start in UTC; null on sprint weekends
sprint_qualifying_utc TIMESTAMP WITH TIME ZONE
Sprint qualifying (or sprint shootout) start in UTC
sprint_utc TIMESTAMP WITH TIME ZONE
Sprint race start in UTC; null on non-sprint weekends
qualifying_utc TIMESTAMP WITH TIME ZONE
Grand Prix qualifying start in UTC
is_sprint_weekend BOOLEAN
Whether the weekend includes a sprint race
wikipedia_url VARCHAR
Wikipedia article for the race
Example

Sprint weekends this season from the backing scan.

SELECT round, race_name
FROM f1.main.all_current_schedule()
WHERE is_sprint_weekend;
Link
all_last_race_results () 1 example

Classification of the most recent F1 Grand Prix (scan behind last_race_results)

No arguments
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name, for example Bahrain Grand Prix
race_date DATE
Calendar date of the Grand Prix (local to the circuit)
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
country VARCHAR
Country of the circuit
position INTEGER
Finishing position (classification order, including retirements)
position_text VARCHAR
Published classification: a number, or R retired, D disqualified, E excluded, W withdrawn, F failed to qualify, N not classified
classified BOOLEAN
Whether position_text is numeric, i.e. the driver was classified
points DECIMAL(7,2)
Championship points scored in this race
car_number INTEGER
Race number displayed on the car (not a position)
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier, for example hamilton
driver_code VARCHAR
Three-letter driver code, for example HAM
driver_name VARCHAR
Driver's full name
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
grid INTEGER
Starting grid position (1 = pole); 0 means a pit-lane start
laps INTEGER
Number of laps completed
status VARCHAR
Finishing status, for example Finished, +1 Lap, or Engine
race_time_millis BIGINT
Elapsed race time in milliseconds as published; usually null for lapped or retired cars, but the archive also records it for some of them
race_time VARCHAR
Published race time: absolute for the winner, a gap such as +5.123 for others; null when none is published
fastest_lap_rank INTEGER
Rank of this driver's fastest lap among all drivers (1 = fastest)
fastest_lap_number INTEGER
Lap number on which the driver set their fastest lap
fastest_lap_time VARCHAR
Fastest lap time as published, for example 1:32.608
fastest_lap_seconds DECIMAL(10,3)
Fastest lap time in seconds as an exact decimal
fastest_lap_avg_speed_kph DOUBLE
Average speed of the fastest lap in km/h; null where the archive does not publish it (sprints and races from 2025 onwards)
Example

Podium of the most recent race from the backing scan.

SELECT position, driver_name, constructor_name
FROM f1.main.all_last_race_results()
WHERE position <= 3
ORDER BY position;
Link
all_seasons () 1 example

Every Formula 1 World Championship season since 1950 (scan behind seasons)

No arguments
Returns columns
season INTEGER
Championship season year
wikipedia_url VARCHAR
Wikipedia article for the season
Example

Number of championship seasons from the backing scan.

SELECT count(*) AS seasons FROM f1.main.all_seasons();
Link
circuits (season := INTEGER) 1 example

Circuits used in a season, or every World Championship circuit

Named arguments
season := INTEGER
Season year. NULL returns every season since 1950. Β· default null
Returns columns
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
locality VARCHAR
City or locality of the circuit
country VARCHAR
Country of the circuit
latitude DOUBLE
Latitude in decimal degrees
longitude DOUBLE
Longitude in decimal degrees
wikipedia_url VARCHAR
Wikipedia article for the circuit
Example

Circuits on the 2024 calendar by country.

SELECT circuit_name, locality, country
FROM f1.main.circuits(season := 2024)
ORDER BY country;
Link
constructor_standings (season INTEGER, round := INTEGER) 1 example

Constructors' championship standings for a season (1958 onwards), optionally after a round

Positional arguments
season INTEGER
Championship season year, 1950 or later.
Named arguments
round := INTEGER
Round number within the season. NULL returns every round of the season. Β· default null
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number after which these standings apply
position INTEGER
Constructors' championship position (1 = leader); null when unclassified
position_text VARCHAR
Championship position as published
points DECIMAL(7,2)
Count of constructors' championship points as an exact decimal
wins INTEGER
Number of Grand Prix wins so far this season
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
constructor_nationality VARCHAR
Nationality the team races under, as a demonym, for example Italian
Example

Final 2024 constructors' championship.

SELECT position, constructor_name, points, wins
FROM f1.main.constructor_standings(2024)
ORDER BY position;
Link
constructors (season := INTEGER) 1 example

Constructors that entered a season, or every constructor since 1950

Named arguments
season := INTEGER
Season year. NULL returns every season since 1950. Β· default null
Returns columns
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
nationality VARCHAR
Constructor nationality
wikipedia_url VARCHAR
Wikipedia article for the constructor
Example

The 2024 constructors.

SELECT constructor_id, constructor_name, nationality
FROM f1.main.constructors(season := 2024);
Link
driver_results (driver_id VARCHAR, season := INTEGER) 1 example

Every Grand Prix result for one driver, optionally limited to a season

Positional arguments
driver_id VARCHAR
Jolpica/Ergast driver identifier.
Named arguments
season := INTEGER
Season year. NULL returns every season since 1950. Β· default null
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name, for example Bahrain Grand Prix
race_date DATE
Calendar date of the Grand Prix (local to the circuit)
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
country VARCHAR
Country of the circuit
position INTEGER
Finishing position (classification order, including retirements)
position_text VARCHAR
Published classification: a number, or R retired, D disqualified, E excluded, W withdrawn, F failed to qualify, N not classified
classified BOOLEAN
Whether position_text is numeric, i.e. the driver was classified
points DECIMAL(7,2)
Championship points scored in this race
car_number INTEGER
Race number displayed on the car (not a position)
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier, for example hamilton
driver_code VARCHAR
Three-letter driver code, for example HAM
driver_name VARCHAR
Driver's full name
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
grid INTEGER
Starting grid position (1 = pole); 0 means a pit-lane start
laps INTEGER
Number of laps completed
status VARCHAR
Finishing status, for example Finished, +1 Lap, or Engine
race_time_millis BIGINT
Elapsed race time in milliseconds as published; usually null for lapped or retired cars, but the archive also records it for some of them
race_time VARCHAR
Published race time: absolute for the winner, a gap such as +5.123 for others; null when none is published
fastest_lap_rank INTEGER
Rank of this driver's fastest lap among all drivers (1 = fastest)
fastest_lap_number INTEGER
Lap number on which the driver set their fastest lap
fastest_lap_time VARCHAR
Fastest lap time as published, for example 1:32.608
fastest_lap_seconds DECIMAL(10,3)
Fastest lap time in seconds as an exact decimal
fastest_lap_avg_speed_kph DOUBLE
Average speed of the fastest lap in km/h; null where the archive does not publish it (sprints and races from 2025 onwards)
Example

Lewis Hamilton's career wins and podiums.

SELECT count(*) FILTER (WHERE position = 1) AS wins,
  count(*) FILTER (WHERE position <= 3) AS podiums
FROM f1.main.driver_results('hamilton');
Link
driver_standings (season INTEGER, round := INTEGER) 2 examples

Drivers' championship standings for a season, optionally after a given round

Positional arguments
season INTEGER
Championship season year, 1950 or later.
Named arguments
round := INTEGER
Round number within the season. NULL returns every round of the season. Β· default null
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number after which these standings apply
position INTEGER
Championship position (1 = leader); null when unclassified
position_text VARCHAR
Championship position as published, '-' when unclassified
points DECIMAL(7,2)
Count of championship points as an exact decimal (half points exist)
wins INTEGER
Number of Grand Prix wins so far this season
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier
driver_code VARCHAR
Three-letter driver code
permanent_number INTEGER
Driver's permanent car number (chosen race number)
driver_name VARCHAR
Driver's full name
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British
constructor_id VARCHAR
Constructor identifier when the driver raced for exactly one team; null otherwise
constructor_name VARCHAR
Constructor name when the driver raced for exactly one team; null otherwise
constructor_ids VARCHAR
Comma-separated constructor identifiers this season
constructor_names VARCHAR
Comma-separated constructor names this season
Examples (2)

Final 2024 drivers' championship.

SELECT position, driver_name, constructor_name, points, wins
FROM f1.main.driver_standings(2024)
ORDER BY position;

The 2024 championship after round 10.

SELECT position, driver_name, points
FROM f1.main.driver_standings(2024, round := 10)
ORDER BY position
LIMIT 5;
Link
drivers (season := INTEGER) 1 example

Drivers who entered a season, or every World Championship driver

Named arguments
season := INTEGER
Season year. NULL returns every season since 1950. Β· default null
Returns columns
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier
driver_code VARCHAR
Three-letter driver code, when assigned
permanent_number INTEGER
Driver's permanent car number, when assigned
given_name VARCHAR
Given name
family_name VARCHAR
Family name
driver_name VARCHAR
Full name
date_of_birth DATE
Date of birth
nationality VARCHAR
Nationality
wikipedia_url VARCHAR
Wikipedia article for the driver
Example

The 2024 grid.

SELECT driver_id, driver_code, driver_name, nationality
FROM f1.main.drivers(season := 2024)
ORDER BY family_name;
Link
lap_times (season INTEGER, round INTEGER, driver_id := VARCHAR) 2 examples

Lap-by-lap times and running positions for one Grand Prix (1996 onwards)

Positional arguments
season INTEGER
Championship season year, 1950 or later.
round INTEGER
Round number within the season.
Named arguments
driver_id := VARCHAR
Optional Jolpica/Ergast driver identifier such as max_verstappen. Β· default null
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name
lap INTEGER
Lap number
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier
position INTEGER
Running position at the end of the lap
lap_time VARCHAR
Lap time as published, for example 1:41.528
lap_time_seconds DECIMAL(10,3)
Lap time in seconds as an exact decimal
Examples (2)

Max Verstappen's laps in the 2024 Chinese Grand Prix.

SELECT lap, position, lap_time
FROM f1.main.lap_times(2024, 5, driver_id := 'max_verstappen')
ORDER BY lap;

Max Verstappen's pace per stint in the 2024 Chinese Grand Prix, splitting his laps at each pit stop and leaving out in- and out-laps.

WITH stops AS (SELECT lap FROM f1.main.pit_stops(2024, 5) WHERE driver_id = 'max_verstappen'), laps AS (SELECT l.lap, l.lap_time_seconds, 1 + (SELECT count(*) FROM stops WHERE stops.lap < l.lap) AS stint FROM f1.main.lap_times(2024, 5, driver_id := 'max_verstappen') l) SELECT stint, min(lap) AS first_lap, max(lap) AS last_lap, min(lap_time_seconds) AS best_lap_seconds, median(lap_time_seconds) AS median_lap_seconds
FROM laps
WHERE lap NOT IN (SELECT lap FROM stops) AND lap NOT IN (SELECT lap + 1 FROM stops)
GROUP BY stint
ORDER BY stint;
Link
meetings (season INTEGER) 1 example

OpenF1 meetings (race weekends and tests) for a season, 2023 onwards

Arguments
season INTEGER
Season year, 2023 or later.
Returns columns
meeting_key INTEGER
OpenF1 meeting (race weekend) key
meeting_name VARCHAR
Meeting name, for example Bahrain Grand Prix
meeting_official_name VARCHAR
Official sponsored event name
year INTEGER
Season year
location VARCHAR
Meeting location
country_code VARCHAR
Three-letter country code
country_name VARCHAR
Country name
circuit_key INTEGER
OpenF1 circuit key
circuit_short_name VARCHAR
Short circuit name
circuit_type VARCHAR
Circuit type, for example Permanent or Temporary - Street
date_start TIMESTAMP WITH TIME ZONE
Start of the meeting in UTC
date_end TIMESTAMP WITH TIME ZONE
End of the meeting in UTC
gmt_offset VARCHAR
Local UTC offset of the venue, for example 03:00:00
is_cancelled BOOLEAN
Whether the meeting was cancelled
Example

2024 race weekends on street circuits.

SELECT meeting_name, location
FROM f1.main.meetings(2024)
WHERE circuit_type LIKE '%Street%'
ORDER BY date_start;
Link
pit_stops (season INTEGER, round INTEGER) 1 example

Pit stops for one Grand Prix (2011 onwards)

Arguments
season INTEGER
Championship season year, 1950 or later.
round INTEGER
Round number within the season.
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier
stop INTEGER
Stop number for this driver in this race
lap INTEGER
Lap on which the stop was made
time_of_day VARCHAR
Local time of day of the stop, as published
duration VARCHAR
Pit-lane duration as published (entry to exit, not stationary time)
duration_seconds DECIMAL(10,3)
Pit-lane duration in seconds as an exact decimal
Example

Fastest pit-lane times in the 2024 Chinese Grand Prix.

SELECT driver_id, lap, duration_seconds
FROM f1.main.pit_stops(2024, 5)
ORDER BY duration_seconds
LIMIT 5;
Link
qualifying_results (season INTEGER, round := INTEGER) 1 example

Grand Prix qualifying classifications with Q1, Q2, and Q3 times

Positional arguments
season INTEGER
Championship season year, 1950 or later.
Named arguments
round := INTEGER
Round number within the season. NULL returns every round of the season. Β· default null
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name, for example Bahrain Grand Prix
race_date DATE
Calendar date of the Grand Prix (local to the circuit)
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
country VARCHAR
Country of the circuit
position INTEGER
Qualifying classification position
car_number INTEGER
Car number
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier, for example hamilton
driver_code VARCHAR
Three-letter driver code, for example HAM
driver_name VARCHAR
Driver's full name
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
q1 VARCHAR
Best Q1 lap time as published; null if no time was set
q2 VARCHAR
Best Q2 lap time as published; null if eliminated in Q1
q3 VARCHAR
Best Q3 lap time as published; null if eliminated before Q3
q1_seconds DECIMAL(10,3)
Best Q1 lap time in seconds
q2_seconds DECIMAL(10,3)
Best Q2 lap time in seconds
q3_seconds DECIMAL(10,3)
Best Q3 lap time in seconds
Example

Pole sitters in 2024.

SELECT round, race_name, driver_name, q3
FROM f1.main.qualifying_results(2024)
WHERE position = 1
ORDER BY round;
Link
race_control (session_key INTEGER) 1 example

Race control messages (flags, safety car, penalties, DRS) for one OpenF1 session

Arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
date TIMESTAMP WITH TIME ZONE
Time of the message, in UTC
lap_number INTEGER
Race lap at the time of the message
category VARCHAR
Message category: Flag, SafetyCar, Drs, CarEvent, SessionStatus, Other
flag VARCHAR
Flag shown, for example GREEN, YELLOW, RED, CHEQUERED
scope VARCHAR
Flag scope: Track, Sector, or Driver
sector INTEGER
Marshal sector for sector-scoped flags
driver_number INTEGER
Driver concerned, when the message targets one car
qualifying_phase INTEGER
Qualifying phase (1-3) for qualifying messages
message VARCHAR
Race control message text
Example

Flags shown in the 2024 Bahrain Grand Prix.

SELECT date, lap_number, flag, scope, message
FROM f1.main.race_control(9472)
WHERE category = 'Flag'
ORDER BY date;
Link
race_results (season INTEGER, round := INTEGER) 2 examples

Grand Prix classifications for a season, or for one round

Positional arguments
season INTEGER
Championship season year, 1950 or later.
Named arguments
round := INTEGER
Round number within the season. NULL returns every round of the season. Β· default null
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name, for example Bahrain Grand Prix
race_date DATE
Calendar date of the Grand Prix (local to the circuit)
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
country VARCHAR
Country of the circuit
position INTEGER
Finishing position (classification order, including retirements)
position_text VARCHAR
Published classification: a number, or R retired, D disqualified, E excluded, W withdrawn, F failed to qualify, N not classified
classified BOOLEAN
Whether position_text is numeric, i.e. the driver was classified
points DECIMAL(7,2)
Championship points scored in this race
car_number INTEGER
Race number displayed on the car (not a position)
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier, for example hamilton
driver_code VARCHAR
Three-letter driver code, for example HAM
driver_name VARCHAR
Driver's full name
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
grid INTEGER
Starting grid position (1 = pole); 0 means a pit-lane start
laps INTEGER
Number of laps completed
status VARCHAR
Finishing status, for example Finished, +1 Lap, or Engine
race_time_millis BIGINT
Elapsed race time in milliseconds as published; usually null for lapped or retired cars, but the archive also records it for some of them
race_time VARCHAR
Published race time: absolute for the winner, a gap such as +5.123 for others; null when none is published
fastest_lap_rank INTEGER
Rank of this driver's fastest lap among all drivers (1 = fastest)
fastest_lap_number INTEGER
Lap number on which the driver set their fastest lap
fastest_lap_time VARCHAR
Fastest lap time as published, for example 1:32.608
fastest_lap_seconds DECIMAL(10,3)
Fastest lap time in seconds as an exact decimal
fastest_lap_avg_speed_kph DOUBLE
Average speed of the fastest lap in km/h; null where the archive does not publish it (sprints and races from 2025 onwards)
Examples (2)

Winners of every 2024 Grand Prix.

SELECT round, race_name, driver_name, constructor_name
FROM f1.main.race_results(2024)
WHERE position = 1
ORDER BY round;

Full classification of the 2024 Chinese Grand Prix (round 5).

SELECT position, driver_name, grid, status, points
FROM f1.main.race_results(2024, round := 5)
ORDER BY position;
Link
schedule (season INTEGER) 1 example

The race calendar for one F1 season, with UTC session start times

Arguments
season INTEGER
Championship season year, 1950 or later.
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
locality VARCHAR
City or locality of the circuit
country VARCHAR
Country of the circuit
race_date DATE
Calendar date of the Grand Prix (local to the circuit)
race_start_utc TIMESTAMP WITH TIME ZONE
Scheduled race start in UTC; null when no time is published
first_practice_utc TIMESTAMP WITH TIME ZONE
First practice start in UTC
second_practice_utc TIMESTAMP WITH TIME ZONE
Second practice start in UTC
third_practice_utc TIMESTAMP WITH TIME ZONE
Third practice start in UTC; null on sprint weekends
sprint_qualifying_utc TIMESTAMP WITH TIME ZONE
Sprint qualifying (or sprint shootout) start in UTC
sprint_utc TIMESTAMP WITH TIME ZONE
Sprint race start in UTC; null on non-sprint weekends
qualifying_utc TIMESTAMP WITH TIME ZONE
Grand Prix qualifying start in UTC
is_sprint_weekend BOOLEAN
Whether the weekend includes a sprint race
wikipedia_url VARCHAR
Wikipedia article for the race
Example

The 2024 calendar in round order.

SELECT round, race_name, country, race_date
FROM f1.main.schedule(2024)
ORDER BY round;
Link
session_drivers (session_key INTEGER) 1 example

Drivers, car numbers, and teams taking part in one OpenF1 session

Arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
driver_number INTEGER
Car number of the driver in this session
name_acronym VARCHAR
Three-letter driver acronym, for example VER
broadcast_name VARCHAR
Name as shown on the TV graphics
full_name VARCHAR
Full name as published by OpenF1
first_name VARCHAR
First name
last_name VARCHAR
Last name
team_name VARCHAR
Team name
team_colour VARCHAR
Team colour as a hexadecimal RGB string
country_code VARCHAR
Driver's three-letter country code
Example

Entry list for the 2024 Bahrain Grand Prix (session 9472).

SELECT driver_number, name_acronym, full_name, team_name
FROM f1.main.session_drivers(9472)
ORDER BY driver_number;
Link
session_laps (session_key INTEGER, driver_number := INTEGER) 1 example

Lap and sector times with speed-trap readings for one OpenF1 session

Positional arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Named arguments
driver_number := INTEGER
Optional car number to restrict the result to one driver. Β· default null
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
driver_number INTEGER
Car number of the driver in this session
lap_number INTEGER
Lap number
date_start TIMESTAMP WITH TIME ZONE
Time the lap started, in UTC
lap_duration DOUBLE
Lap time in seconds; null for laps without a valid time
duration_sector_1 DOUBLE
Sector 1 time in seconds
duration_sector_2 DOUBLE
Sector 2 time in seconds
duration_sector_3 DOUBLE
Sector 3 time in seconds
i1_speed INTEGER
Speed at intermediate 1 in km/h
i2_speed INTEGER
Speed at intermediate 2 in km/h
st_speed INTEGER
Speed at the speed trap in km/h
is_pit_out_lap BOOLEAN
Whether the lap began in the pit lane
Example

Fastest race laps in the 2024 Bahrain Grand Prix.

SELECT driver_number, lap_number, lap_duration
FROM f1.main.session_laps(9472)
WHERE lap_duration IS NOT NULL
ORDER BY lap_duration
LIMIT 5;
Link
session_pits (session_key INTEGER) 1 example

Pit stops with pit-lane and stationary durations for one OpenF1 session

Arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
driver_number INTEGER
Car number of the driver in this session
date TIMESTAMP WITH TIME ZONE
Time of the pit entry, in UTC
lap_number INTEGER
Lap on which the stop was made
lane_duration DOUBLE
Time spent in the pit lane, in seconds
stop_duration DOUBLE
Stationary time in seconds, where OpenF1 publishes it
Example

Quickest pit-lane visits in the 2024 Bahrain Grand Prix.

SELECT driver_number, lap_number, lane_duration
FROM f1.main.session_pits(9472)
ORDER BY lane_duration
LIMIT 5;
Link
session_result (session_key INTEGER) 1 example

Final classification of one OpenF1 session: race, sprint, qualifying, or practice

Arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
position INTEGER
Final classified position; null when not classified
driver_number INTEGER
Car number of the driver in this session
number_of_laps INTEGER
Laps completed
points DECIMAL(7,2)
Points scored, for race and sprint sessions
dnf BOOLEAN
Did not finish
dns BOOLEAN
Did not start
dsq BOOLEAN
Disqualified
duration_seconds DOUBLE
Total race time in seconds, or best lap in practice
gap_to_leader_seconds DOUBLE
Gap to the winner in seconds; null when lapped
gap_to_leader VARCHAR
Gap to the winner as published, for example 22.457 or +1 LAP
q1_seconds DOUBLE
Best Q1 time in seconds (qualifying sessions)
q2_seconds DOUBLE
Best Q2 time in seconds (qualifying sessions)
q3_seconds DOUBLE
Best Q3 time in seconds (qualifying sessions)
Example

Top ten of the 2024 Bahrain Grand Prix with driver names.

SELECT r.position, d.full_name, r.points, r.gap_to_leader
FROM f1.main.session_result(9472) r
JOIN f1.main.session_drivers(9472) d USING (driver_number)
WHERE r.position <= 10
ORDER BY r.position;
Link
session_stints (session_key INTEGER) 2 examples

Tyre stints (compound, laps, tyre age) for every driver in one OpenF1 session

Arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
driver_number INTEGER
Car number of the driver in this session
stint_number INTEGER
Stint number for this driver, starting at 1
lap_start INTEGER
First lap of the stint
lap_end INTEGER
Last lap of the stint
compound VARCHAR
Tyre compound: SOFT, MEDIUM, HARD, INTERMEDIATE, or WET
tyre_age_at_start INTEGER
Laps already on the tyre set when the stint began
Examples (2)

Compound usage in the 2024 Bahrain Grand Prix.

SELECT compound, count(*) AS stints, sum(lap_end - lap_start + 1) AS laps
FROM f1.main.session_stints(9472)
GROUP BY compound
ORDER BY laps DESC;

Every driver's tyre sequence in the 2024 Bahrain Grand Prix (session 9472), in finishing order.

SELECT r.position, d.name_acronym, d.team_name, count(*) AS stints,
  string_agg(st.compound, ' > ' ORDER BY st.stint_number) AS strategy
FROM f1.main.session_stints(9472) st
JOIN f1.main.session_drivers(9472) d USING (driver_number)
JOIN f1.main.session_result(9472) r USING (driver_number)
GROUP BY r.position, d.name_acronym, d.team_name
ORDER BY r.position NULLS LAST, d.name_acronym;
Link
session_weather (session_key INTEGER) 1 example

Track-side weather samples, about one per minute, for one OpenF1 session

Arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
date TIMESTAMP WITH TIME ZONE
Time of the sample, in UTC (roughly one per minute)
air_temperature DOUBLE
Air temperature in degrees Celsius
track_temperature DOUBLE
Track surface temperature in degrees Celsius
humidity DOUBLE
Relative humidity in percent
pressure DOUBLE
Air pressure in millibars
rainfall BOOLEAN
Whether rain was falling
wind_direction INTEGER
Wind direction in degrees (0-359)
wind_speed DOUBLE
Wind speed in metres per second
Example

Track temperature range during the 2024 Bahrain Grand Prix.

SELECT min(track_temperature) AS coolest, max(track_temperature) AS hottest,
  bool_or(rainfall) AS any_rain
FROM f1.main.session_weather(9472);
Link
sessions (season INTEGER, session_name := VARCHAR) 1 example

OpenF1 sessions for a season (2023 onwards), optionally filtered by session name

Positional arguments
season INTEGER
Season year, 2023 or later.
Named arguments
session_name := VARCHAR
Optional session name such as Race, Qualifying, or Sprint. Β· default null
Returns columns
session_key INTEGER
OpenF1 session key; pass it to the session_* functions
meeting_key INTEGER
OpenF1 meeting (race weekend) key
session_name VARCHAR
Session name, for example Race, Qualifying, Sprint, Practice 1
session_type VARCHAR
Session type, for example Race, Qualifying, Practice
year INTEGER
Season year
location VARCHAR
Session location
country_code VARCHAR
Three-letter country code
country_name VARCHAR
Country name
circuit_key INTEGER
OpenF1 circuit key
circuit_short_name VARCHAR
Short circuit name
date_start TIMESTAMP WITH TIME ZONE
Session start in UTC
date_end TIMESTAMP WITH TIME ZONE
Session end in UTC
gmt_offset VARCHAR
Local UTC offset of the venue
is_cancelled BOOLEAN
Whether the session was cancelled
Example

Session keys for every 2024 race.

SELECT session_key, country_name, location, date_start
FROM f1.main.sessions(2024, session_name := 'Race')
ORDER BY date_start;
Link
sprint_results (season INTEGER, round := INTEGER) 2 examples

Sprint race classifications for a season (2021 onwards), or for one round

Positional arguments
season INTEGER
Championship season year, 1950 or later.
Named arguments
round := INTEGER
Round number within the season. NULL returns every round of the season. Β· default null
Returns columns
season INTEGER
Championship season year
round INTEGER
Round number within the season (1 = first race)
race_name VARCHAR
Grand Prix name, for example Bahrain Grand Prix
race_date DATE
Calendar date of the Grand Prix (local to the circuit)
circuit_id VARCHAR
Stable Jolpica/Ergast circuit identifier
circuit_name VARCHAR
Full circuit name, for example Autodromo Nazionale di Monza
country VARCHAR
Country of the circuit
position INTEGER
Finishing position (classification order, including retirements)
position_text VARCHAR
Published classification: a number, or R retired, D disqualified, E excluded, W withdrawn, F failed to qualify, N not classified
classified BOOLEAN
Whether position_text is numeric, i.e. the driver was classified
points DECIMAL(7,2)
Championship points scored in this race
car_number INTEGER
Race number displayed on the car (not a position)
driver_id VARCHAR
Stable Jolpica/Ergast driver identifier, for example hamilton
driver_code VARCHAR
Three-letter driver code, for example HAM
driver_name VARCHAR
Driver's full name
driver_nationality VARCHAR
Nationality of the driver as a demonym, for example British
constructor_id VARCHAR
Stable Jolpica/Ergast constructor identifier
constructor_name VARCHAR
Constructor (team) name
grid INTEGER
Starting grid position (1 = pole); 0 means a pit-lane start
laps INTEGER
Number of laps completed
status VARCHAR
Finishing status, for example Finished, +1 Lap, or Engine
race_time_millis BIGINT
Elapsed race time in milliseconds as published; usually null for lapped or retired cars, but the archive also records it for some of them
race_time VARCHAR
Published race time: absolute for the winner, a gap such as +5.123 for others; null when none is published
fastest_lap_rank INTEGER
Rank of this driver's fastest lap among all drivers (1 = fastest)
fastest_lap_number INTEGER
Lap number on which the driver set their fastest lap
fastest_lap_time VARCHAR
Fastest lap time as published, for example 1:32.608
fastest_lap_seconds DECIMAL(10,3)
Fastest lap time in seconds as an exact decimal
fastest_lap_avg_speed_kph DOUBLE
Average speed of the fastest lap in km/h; null where the archive does not publish it (sprints and races from 2025 onwards)
Examples (2)

Sprint winners in 2024.

SELECT round, race_name, driver_name
FROM f1.main.sprint_results(2024)
WHERE position = 1
ORDER BY round;

Sprint winner against Grand Prix winner on every 2024 sprint weekend.

WITH sp AS (SELECT round, race_name, driver_name AS sprint_winner FROM f1.main.sprint_results(2024) WHERE position = 1), gp AS (SELECT round, driver_name AS grand_prix_winner FROM f1.main.race_results(2024) WHERE position = 1) SELECT round, race_name, sprint_winner, grand_prix_winner, sprint_winner = grand_prix_winner AS won_both
FROM sp
JOIN gp USING (round)
ORDER BY round;
Link
team_radio (session_key INTEGER, driver_number := INTEGER) 1 example

Links to broadcast team radio clips for one OpenF1 session

Positional arguments
session_key INTEGER
OpenF1 session key, as returned by sessions(), for example 9472.
Named arguments
driver_number := INTEGER
Optional car number to restrict the result to one driver. Β· default null
Returns columns
session_key INTEGER
OpenF1 session key
meeting_key INTEGER
OpenF1 meeting (race weekend) key
driver_number INTEGER
Car number of the driver in this session
date TIMESTAMP WITH TIME ZONE
Time of the radio message, in UTC
recording_url VARCHAR
Link to the official audio clip on Formula 1 live timing
Example

Radio clips per driver in the 2024 Bahrain Grand Prix.

SELECT driver_number, count(*) AS clips
FROM f1.main.team_radio(9472)
GROUP BY driver_number
ORDER BY clips DESC;
Link

Try these queries

current_driver_standings_are_populated β€” The current drivers' championship has driver rows with stable identifiers.

SELECT count(*) > 0 AND count(driver_id) = count(*) AS populated
FROM f1.main.current_driver_standings;

Uses current_driver_standings

verstappen_2023_wins β€” Max Verstappen won 19 Grands Prix in 2023.

SELECT count(*) AS wins
FROM f1.main.race_results(2023)
WHERE position = 1 AND driver_id = 'max_verstappen';

Uses race_results

Sprint winner against Grand Prix winner on every 2024 sprint weekend.

WITH sp AS (SELECT round, race_name, driver_name AS sprint_winner FROM f1.main.sprint_results(2024) WHERE position = 1), gp AS (SELECT round, driver_name AS grand_prix_winner FROM f1.main.race_results(2024) WHERE position = 1) SELECT round, race_name, sprint_winner, grand_prix_winner, sprint_winner = grand_prix_winner AS won_both
FROM sp
JOIN gp USING (round)
ORDER BY round

Uses sprint_resultsrace_results

Max Verstappen's pace per stint in the 2024 Chinese Grand Prix, splitting his laps at each pit stop and leaving out in- and out-laps.

WITH stops AS (SELECT lap FROM f1.main.pit_stops(2024, 5) WHERE driver_id = 'max_verstappen'), laps AS (SELECT l.lap, l.lap_time_seconds, 1 + (SELECT count(*) FROM stops WHERE stops.lap < l.lap) AS stint FROM f1.main.lap_times(2024, 5, driver_id := 'max_verstappen') l) SELECT stint, min(lap) AS first_lap, max(lap) AS last_lap, min(lap_time_seconds) AS best_lap_seconds, median(lap_time_seconds) AS median_lap_seconds
FROM laps
WHERE lap NOT IN (SELECT lap FROM stops) AND lap NOT IN (SELECT lap + 1 FROM stops)
GROUP BY stint
ORDER BY stint

Uses pit_stopslap_times

Every driver's tyre sequence in the 2024 Bahrain Grand Prix (session 9472), in finishing order.

SELECT r.position, d.name_acronym, d.team_name, count(*) AS stints,
  string_agg(st.compound, ' > ' ORDER BY st.stint_number) AS strategy
FROM f1.main.session_stints(9472) st
JOIN f1.main.session_drivers(9472) d USING (driver_number)
JOIN f1.main.session_result(9472) r USING (driver_number)
GROUP BY r.position, d.name_acronym, d.team_name
ORDER BY r.position NULLS LAST, d.name_acronym

Uses session_stintssession_driverssession_result

Seasons held so far.

SELECT count(*) AS seasons, max(season) AS latest FROM f1.main.seasons

Uses seasons

1 more example

championship_points_are_ordered β€” A higher championship position never has more points than a lower one.

SELECT bool_and(points <= prev_points) AS ordered
FROM (SELECT points, lag(points) OVER (ORDER BY position) AS prev_points FROM f1.main.current_driver_standings WHERE position IS NOT NULL)
WHERE prev_points IS NOT NULL;

Uses current_driver_standings

35 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Summarize the current Formula 1 season: who leads the drivers' and constructors' championships, who won the most recent Grand Prix, and how many rounds remain?
  • Who won the 2024 F1 drivers' and constructors' championships, and with how many points?
  • How many Grand Prix wins and how many sprint wins did each driver score in 2024? Most Grand Prix wins first.
  • Which round was the 2024 Monaco Grand Prix, who took pole position, and what was the Q3 time?
  • List Max Verstappen's pit stops in the 2024 Chinese Grand Prix (round 5) with lap and pit-lane time, plus his fastest lap of the race in seconds.
  • How many Grand Prix did Lewis Hamilton win from his debut through the end of 2024?

Formula 1 is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.