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

Group: Race sports

A race’s classification — in motorsport the main race session (the last of type race) with grid, pit stops, tyre stints, the set now fitted (currentTyre: compound, new or used), inPit, best laps and points. That session is named in meta.session, and inPit is true while the car sits in the pit lane during a running session. For a cycling stage race it is the general classification, with every rider’s secondary classifications (points, mountains, young rider, jersey). Pass session= to get a single session instead (a practice, a qualifying, a stage) or a single qualifying part (Q1, Q2…). Where our data source stores a knock-out qualifying only part by part (MotoGP), we merge the parts into the series’ own ranking: the Q2 riders first in their Q2 order, then the Q1 riders who did not advance in their Q1 order, with the places counting on; every line states which part it comes from.

Plans: Every plan, Free included.

Note: state is one of classified, didNotFinish, didNotStart, disqualified or notClassified. Anyone outside the classification has position null, and our data source may also skip a place. timeMs holds the total time for a race or stage, or the best lap for practice and qualifying. For lapped competitors (see lapsBehind), for those who are out and for classified riders whose time the source did not record (cycling), timeMs, gapMs and intervalMs are null. tyreStints is filled for Formula 1 races only; cycling is null except on the overall result of a stage race. Only a qualifying merged from its parts has part ("Q2", "Q1"). In that case timeMs / gapMs / intervalMs refer to that part (best lap, gap to the part’s fastest), lines without a time get position null, and until a part has finished its participants occupy its places (during Q2, riders eliminated in Q1 are ranked from 13th down). Formula 1 qualifying comes as a table of its own, with part null.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | race id issued by DataSportsAPI, a positive integer |
| `session` | query | no | id of one of the race’s sessions (see /v2/races/{id}) or of a qualifying part listed under sessions[].parts |

## Response

- `data`: `RaceResult[]`
- `meta`: race, session (the session returned — in motorsport the main race session if none was requested; null means the race’s own table), count
- Objects: RaceResult (https://datasportsapi.com/markdown/reference.md#raceresult)

## Errors

- 400 bad_request — session is invalid
- 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
- 404 no_data — this race is the duplicate entry kept under a second series (same behaviour as /v2/races/{id}); the genuine series and race are given in error.series / error.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}/results"
```

TypeScript:

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

Python:

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

Go:

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

CLI:

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

## Example response

```json
{ "data": [ …,
    { "position": 2, "competitor": { "id": 700002, "name": "Charles Leclerc", … }, "team": { "id": 700010, "name": "Ferrari", … },
      "state": "classified", "outReason": null, "carNumber": 16, "gridPosition": 2, "startedFromPitLane": false,
      "laps": 62, "lapsBehind": null, "lapsLed": null, "pitStops": 2, "timeMs": 6128120, "gapMs": 7335, "intervalMs": 7335,
      "bestLapMs": 95202, "bestLapNumber": 41, "fastestLap": true, "points": 18,
      "tyreStints": [ { "compound": "soft", "laps": 24 }, { "compound": "medium", "laps": 15 }, { "compound": "soft", "laps": 23 } ],
      "currentTyre": { "compound": "soft", "isNew": false }, "inPit": null,
      "cycling": null }, … ],
  "meta": { "race": 812345, "session": null, "count": 20 } }

// Cycling stage race (general classification):
    { "position": 1, "competitor": { "name": "Tadej Pogačar", … }, "team": { "name": "UAE Team Emirates", … }, "state": "classified",
      "timeMs": 266186000, "gapMs": null, …, "tyreStints": [], "currentTyre": null, "inPit": null,
      "cycling": { "jersey": "general", "pointsPosition": 2, "points": 289, "mountainsPosition": 1, "mountainsPoints": 154,
                   "youngRiderPosition": null, "youngRiderTimeMs": null } }
```

---

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/results/ · All docs: https://datasportsapi.com/markdown/docs.md · Data reference: https://datasportsapi.com/markdown/reference.md
