Limits that keep the pit lane clear
The API is free. To keep it fast for everyone, each caller gets a request budget per second, minute and day. This page explains how it is counted, how to read what you have left and what to do when it runs out.
Rate limits
There is no key or signup, so nothing to send. Callers are told apart by IP address, so the budget below is shared by everyone behind the same address. That is usually just you, and it holds when your app runs in the browser too (cross-origin requests are allowed).
| Window | Allowed | How it works |
|---|---|---|
| Per minute | 20 | A sliding 60-second window, not a clock minute. |
| Per day | 2,000 | Resets at 00:00 UTC. |
| Burst | 5 / second | No more than this in any one second. |
- A
304 Not Modifieddoes not count against any of them, though once a budget has run out you get the 429 first. - Errors count, including 400s and 404s, so validate your parameters before you send.
- Calling from a server means all your users share one budget. Fetch once and fan the data out from your side.
- Limits are enforced per server instance, so the effective ceiling can be a little higher than the numbers above. Do not rely on that.
Reading the headers
Every response from an endpoint, including errors, says where you stand. Check X-RateLimit-Remaining before you fire the next call and slow down as it falls.
| Header | Meaning |
|---|---|
| X-RateLimit-Limit | Requests allowed per minute. |
| X-RateLimit-Remaining | Requests left in the current minute. On a 429 from the burst or daily budget, this can be above zero. |
| X-RateLimit-Reset | Seconds until the oldest request in the window drops off. |
| X-Daily-Remaining | Requests left today. The day resets at 00:00 UTC. |
| Retry-After | On a 429, 502 or 503: seconds to wait before you try again. |
Poll budget
Pick the endpoints your app polls and how often. Worst case assumes every poll returns new data. In practice 304 responses are free, so real usage is lower.
Polling around the clock at this rate would make 24,480 requests a day. Poll only while a session is live, and stop once it ends, to stay within the daily budget.
When you hit a 429
- 01Stop and wait for Retry-AfterDo not retry sooner. A request sent while you are limited is rejected and counts toward nothing, but it is still wasted traffic.
- 02Add jitterWait Retry-After plus a random 0 to 2 seconds so many clients do not return in the same instant.
- 03Back off if it repeatsAfter three 429s in a row, double your poll interval until a request succeeds, then step it back down.
Caching with ETag
Every successful response carries an ETag. Send it back as If-None-Match and you get an empty 304 when nothing changed. That response is free and tiny. Browsers do this for you on cacheable endpoints; for the live ones, do it yourself.
Error codes
Errors use the real HTTP status and a stable error.code you can branch on. The message is for humans and may change.
| HTTP | code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request | A parameter is missing or malformed. | Check the parameter table for the endpoint. |
| 404 | not_found | The endpoint, season, round, driver or circuit does not exist, or has no data yet. | Check the path values. Retrying will not help until the data exists. |
| 429 | rate_limited | You used the per-minute or per-second budget. | Wait for Retry-After, add jitter, then retry. |
| 429 | daily_quota_exceeded | You used the per-day budget. | Wait for the 00:00 UTC reset. |
| 500 | internal_error | Something broke on our side. | Retry after a few seconds. If it persists, the site is likely down. |
| 502 | upstream_error | An upstream source answered badly or not at all. | Wait for Retry-After, then retry. |
| 503 | feed_unavailable | No session is running, or the feed could not be reached or refused access. | Wait for Retry-After. Between sessions, poll again at the next scheduled session. |
Fair use
- Cache what you can and use ETags
- Fan out to your own users from your server
- Credit the API and the upstream sources (see the overview)
- Stop polling when no session is running
- Rotate IP addresses or use proxies to dodge a limit
- Poll /live faster than every 5 seconds
- Resell or re-serve the raw feed as your own API
- Pretend the data is official F1 data
Callers that abuse the service can be limited without notice. Unofficial; not affiliated with Formula 1. See the overview for attribution.