# GET /v2/races/{id}/laps

Group: Race sports

Lap-by-lap progress of a race session: every driver’s position at the end of each lap (lap 0 is the starting grid), their tyre compound, their pit stops (recorded on the in-lap) and the lap on which they retired. Available on Pro, Business and Enterprise plans.

Plans: Requires Pro, Business or Enterprise; a Free or Starter key receives 403 endpoint_not_in_plan.

Note: Covers Formula 1 race sessions (verified on the 2026 Mexico GP). Sessions and series for which our data source has no lap chart — qualifying, practice, MotoGP — return an empty list. Lap times and gaps are not included; use /results for the timed classification.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | race id issued by DataSportsAPI, a positive integer |
| `session` | query | no | which session to chart, by id from /v2/races/{id}; without it the main race session is used |

## Response

- `data`: `RaceCompetitorLaps[]`
- `meta`: race, session (the session whose laps are shown), count
- Objects: RaceCompetitorLaps (https://datasportsapi.com/markdown/reference.md#racecompetitorlaps)

## Errors

- 403 history_not_in_plan — your plan’s history does not reach back to the race’s start
- 404 not_found — the id is not a race id, or the session belongs to a different race

Plus the common errors (https://datasportsapi.com/markdown/docs.md#errors).

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.datasportsapi.com/v2/races/{id}/laps"
```

TypeScript:

```ts
const { data, meta } = await client.races.laps(id);
```

Python:

```python
res = client.races.laps(id)
```

Go:

```go
res, err := client.Races.Laps(ctx, id, &datasportsapi.RacesLapsParams{})
```

CLI:

```bash
$ dsa races laps <id>
```

## Example response

```json
{ "data": [ { "competitor": { "id": 700001, "name": "Max Verstappen", "code": "VER", … }, "team": { "id": 700010, "name": "Red Bull Racing", … }, "number": 3,
      "laps": [ { "lap": 0, "position": 5, "tyre": "medium", "pitStop": false, "retired": false },
                { "lap": 27, "position": 2, "tyre": "medium", "pitStop": true, "retired": false },
                { "lap": 28, "position": 5, "tyre": "soft", "pitStop": false, "retired": false }, …,
                { "lap": 71, "position": 1, "tyre": "soft", "pitStop": false, "retired": false } ] },
    { "competitor": { "name": "Fernando Alonso", … }, …, "laps": [ …, { "lap": 6, "position": null, "tyre": "soft", "pitStop": false, "retired": true } ] }, … ],
  "meta": { "race": 812345, "session": 812350, "count": 22 } }
```

---

Base URL: https://api.datasportsapi.com. Authenticate each /v2 call with the header `Authorization: Bearer <key>` (secret keys begin with `sk_live_`).
HTML: https://datasportsapi.com/docs/races/laps/ · All docs: https://datasportsapi.com/markdown/docs.md · Data reference: https://datasportsapi.com/markdown/reference.md
