For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Track Lap-by-Lap Timing for a Race

βœ… Included in All Plans

The laps endpoints are included at no additional cost.

Plans differ only in leagues and API call limits.

Compare plans β†’

This guide shows you how to retrieve lap timing data for a race - all laps across the full field, individual driver filtering, sector time breakdowns, and live polling for latest laps.

When to use this

Use the laps endpoints when you want to:

  • Build a lap chart showing position changes throughout a race

  • Compare pace between two drivers across the same stint

  • Display sector times to identify where a driver gains or loses time

  • Poll for the latest lap during a live race to keep a timing display current

The four laps endpoints

Endpoint
URL pattern
Use case

GET Laps by Fixture ID

/fixtures/{id}/laps

Full race lap history for all drivers

GET Laps by Fixture ID and Driver ID

/fixtures/{id}/laps/drivers/{driver_id}

All laps for one driver in a race

GET Latest Laps by Fixture ID

/fixtures/{id}/laps/latest

Most recently completed lap for each driver (live polling)

GET Laps by Fixture ID and Lap Number

/fixtures/{id}/laps/{lap_number}

All drivers' data for a specific lap number

All four return the same base fields and support the same includes. None of them paginate - the full result set is returned in a single response.

Base response fields

participant_id is the driver's ID (the same value as player_id in lineups and standings responses). driver_number is the car number worn on the car, not the driver's ID.

Adding sector times with the details Include

The base response contains only the lap number and driver reference. To get timing data - total lap duration and sector splits - add the details include:

The details array on each lap uses type_id values. The relevant IDs from the Results and Live Data Type Reference are:

type_id
Name
Value

9718

Lap Duration

Total lap time in seconds

9719

Lap Sector One

Sector 1 time in seconds

9720

Lap Sector Two

Sector 2 time in seconds

9721

Lap Sector Three

Sector 3 time in seconds

9722

Lap Timestamp

Unix timestamp of lap start

9723

Lap Number

The lap number

Working with the data

Fetch all laps with sector times

Fetch laps for a single driver

Poll for latest laps during a live race

GET Latest Laps by Fixture ID returns one lap record per driver - the most recently completed lap. Use this during a live race rather than fetching all laps on every poll, which would grow in size as the race progresses.

Cross-driver pace comparison for a specific lap

Common pitfalls

participant_id is the driver ID, not the car number. driver_number is the racing car number (e.g. 1 for Verstappen). To join lap data with driver profiles, use participant_id, which matches the id field on the Driver entity and player_id in lineup responses.

GET Latest Laps does not mean lap 1. "Latest" means the most recently completed lap in the current session, not the first lap of the race. During lap 30, this endpoint returns lap 29 or 30 data depending on how recently the lap was completed.

Lap data is not available during practice or qualifying in the same way. Laps endpoints cover all session types, but the meaning of lap_number differs: in qualifying it represents the out-lap or flying lap sequence, not a race lap count.

Sector times are in seconds as decimals, not in mm:ss.sss format. A lap-duration value of 91.452 means 1 minute 31.452 seconds. Convert in your application for display.

details can be empty for early-race laps. Timing data may not be available for the formation lap or the first lap immediately after the race start. Handle null gracefully.

Advanced usage

To build a fastest lap tracker that updates during a race, combine GET Latest Laps by Fixture ID with ?include=details and track the minimum lap-duration value seen so far across all drivers. Compare each new poll's values against your stored minimum and update the fastest lap record when a new personal best appears.

To build a driver consistency chart, fetch all laps for one driver with ?include=details, extract lap-duration for each lap, and plot them as a line chart. Laps with pit stop activity will show as outliers - cross-reference with the pitstops endpoint to mark them.

Common Errors

Status
Likely cause

401

Missing or invalid api_token

404

The fixture_id or driver_id does not exist

422

Query complexity exceeded - remove includes

See also

Laps endpoints

Type references

Related entities

Related guides

FAQ

Do I need to paginate the laps endpoint? No. All laps endpoints return the full result set without pagination.

How do I find the fixture ID for a specific race? Use the GET Schedule by Season endpoint (/v3/motorsport/schedules/seasons/{season_id}) to retrieve all stages and fixtures for the season. Each fixture has an id and a name field (e.g. "Race") to identify the session type.

Can I get laps for qualifying or practice sessions? Yes. The laps endpoints work across all session types. Use the fixture id for the specific practice or qualifying session rather than the race fixture.

Last updated

Was this helpful?