Breaking change: consistent response shapes
Over the years the API collected some inconsistencies in its JSON responses: a field with three spellings, positions returned as text, a different key for the results of every session, a circuit wrapped in an array on one endpoint and not on another. Until now we kept them on purpose so we wouldn't break existing integrations.
That made the API harder to use than it should be, and every new endpoint had to copy the old mistakes. So we fixed them all in a single release, so you only have to update your code once.
If your code reads any of the fields below, it needs a small change. Everything else stays the same: same URLs, same parameters, same data. There is no /v2.
The full reference with the new schemas is in the docs and in openapi.yaml.
1. firstAppearance is spelled one way everywhere
The year a team made its debut had three spellings depending on the endpoint. It is now always firstAppearance.
| Endpoints | Before | Now |
|---|---|---|
/api/teams, /api/teams/{teamId}, /api/{year}/teams, /api/current/teams, team drivers… |
firstAppeareance |
firstAppearance |
| Race, qualifying, practice, sprint results and championship standings | firstAppareance |
firstAppearance |
teamWinner in /api/{year}, /api/current, /next, /last |
firstAppearance |
unchanged |
- const debut = team.firstAppeareance ?? team.firstAppareance
+ const debut = team.firstAppearance
2. Positions are numbers, and the grid is always gridPosition
Race results called the starting grid grid, while sprint results called it gridPosition. It is now gridPosition everywhere.
Cars without a classified position used to return text markers such as "NC", "-" or "not available". They now return null. The reason (for example "DNF (14)") is still in time / retired.
This applies to every position field (position, gridPosition and finishingPosition) in:
/api/{year}/{round}/raceand/api/current/last/race/api/{year}/{round}/sprint/raceand/api/current/last/sprint/race/api/{year}/drivers/{driverId}and/api/current/drivers/{driverId}(season results)/api/{year}/{round}/qualy,/api/current/last/qualy,/api/{year}/{round}/sprint/qualyand/api/current/last/sprint/qualy(gridPosition)
// /api/2024/3/race
{
- "position": "1",
- "grid": "2",
+ "position": 1,
+ "gridPosition": 2,
...
}
- const position = Number(result.position)
- const grid = result.grid ?? result.gridPosition
+ const position = result.position // number, or null if not classified
+ const grid = result.gridPosition // number, or null if not available
If you sorted positions as strings ("10" before "2"), numeric sorting now works out of the box.
3. driverId and teamId are always in the result item
Every result item now has driverId and teamId at the top level. Race results were the only ones missing them. The nested driver and team objects are unchanged.
{
+ "driverId": "sainz",
+ "teamId": "ferrari",
"position": 1,
...
}
4. One results key for every session
Every session endpoint used a different key to expose its classification. Now they all use results.
| Endpoints | Before | Now |
|---|---|---|
/api/{year}/{round}/race, /api/current/last/race |
results |
results |
/sprint/race and /api/current/last/sprint/race |
sprintRaceResults |
results |
/qualy and /api/current/last/qualy |
qualyResults |
results |
/sprint/qualy and /api/current/last/sprint/qualy |
sprintQualyResults |
results |
/fp1, /fp2, /fp3 and /api/current/last/fp1, fp2, fp3 |
fp1Results, fp2Results, fp3Results |
results |
- const rows = data.races.sprintRaceResults
+ const rows = data.races.results
The endpoint URL already tells you which session it is, so we did not add a separate type field. races is still an object in the single-race endpoints (/api/{year}/{round}/* and /api/current/last/*) and an array in the season endpoints (/api/{year}, /api/current).
5. round is a number everywhere
In /api/{year}/{round} and all its sessions (/race, /qualy, /fp1, /fp2, /fp3, /sprint/qualy, /sprint/race), round returned the value from the URL as text ("3"). It is now an integer, like in current/*.
- "round": "3",
+ "round": 3,
6. circuit is an object in /api/{year}/{round}/race
This endpoint returned races.circuit as an array with a single circuit. It is now an object, like in /api/current/last/race and in every other session endpoint.
- const circuit = data.races.circuit[0]
+ const circuit = data.races.circuit
7. Consistent api and url in the envelope
apiis now always the base URL (https://f1api.dev). Before, a few endpoints returned the text"F1 API":/api/{year}/circuits,/api/{year}/teams,/api/{year}/teams/{teamId},/api/{year}/drivers-championship,/api/current/teams,/api/current/teams/{teamId}and/api/current/drivers-championship.urlis now always the URL you requested. Before,/api/current/nextreturned aurlthat pointed to/api/current/last, and/api/current/lastdropped your query parameters.
Quick checklist
- Replace
firstAppeareanceandfirstAppareancewithfirstAppearance. - Replace
gridwithgridPositionin race results. - Use
data.races.resultsfor every session, whatever its type. - Remove any
Number(...)/parseInt(...)aroundposition,gridPositionandround, and handlenullpositions. - Remove the
[0]fromraces.circuitin/api/{year}/{round}/race. - If you compared
apiwith"F1 API", compare it withhttps://f1api.devor drop the check.
If something breaks and this guide doesn't cover it, open an issue on GitHub and we'll help you migrate.