Getting started
Errors
One error shape for every endpoint, and what each status means.
Error shape
All errors share one shape:
Status codes
| Status | Code | When |
|---|---|---|
| 400 | bad_request | A parameter is malformed |
| 401 | invalid_api_key | Missing or unknown key |
| 402 | tokens_exhausted | Allowance and top-up used up |
| 402 | free_ip_quota | Free plan only: the shared 50-token monthly pool for every Free key on your network is used up |
| 403 | demo_not_allowed | The demo key asked for something it cannot use (e.g. /usage or POST /odds) |
| 403 | plan_required | The key's plan does not include this; see below |
| 403 | too_many_ips | The key is already in use from its plan's cap of networks; a new network is refused (see Limits) |
| 404 | unknown_event | No such event_id (never listed). Finished events are still served. |
| 404 | unknown_race | No such race_id |
| 404 | not_found | No such image under /media/ |
| 429 | rate_limited | Over the per-key rate; see Retry-After |
| 500 | internal_error | Our fault; not charged |
| 503 | unavailable | Temporary; retry after Retry-After |
plan_required
A request outside the key's plan answers 403 plan_required before any token is charged. The Free plan is the only plan with limits, and the demo key is on it, so it gets this on /history, /clv, /racing/history, /scores, the WebSocket, tier=extended, depth=true and finished events. Any paid plan includes all of them.
plan and required_plan are stable ids (free, starter, core, plus, max); plan_name and required_plan_name are what to show a person (Free, Starter, Developer, Business, Enterprise). Do not retry: upgrade the plan or drop the feature.
Retrying
429and503: waitRetry-Afterseconds, then retry. The exception is a POST /odds batch that ran out of time: send fewerevent_ids, as the same call fails the same way.404 unknown_event: we never listed thatevent_id. Check it came from /events verbatim; it is not charged.400,401,403: fix the request; retrying the same one fails the same way.