API reference
Get odds, batch
The same prices for up to 20 events in one call, charged per event and counted once against the rate limit.
POST
/odds/v1/odds- Cost
- 1 token per event (5 extended, +1 depth)
- Authentication
- X-API-Key, your own key (not the demo key)
Parameters
A JSON body (Content-Type: application/json). Everything but event_ids works as on GET /odds and applies to every event in the call.
event_idsarrayrequired1 to 20 event_ids from /events, sent back verbatim. A repeated id is dropped (the first one counts), and more than 20 distinct ids is a 400.tierstringoptionalmain or extended, as on GET /odds. extended needs a paid plan (not Free).Default:mainmarketscomma list or arrayoptionalMarket keys, e.g. "head_to_head,total_goals" or ["head_to_head"].Default:all in the tierbookscomma list or arrayoptionalBook keys from /books, e.g. "betfair,sportsbet" or ["betfair"].Default:allformatstringoptionaldecimal, american or fractional. See Odds formats.Default:decimaldepthbooleanoptionalAny paid plan (not Free), +1 token per event. Adds exchange depth as on GET /odds. Must be true or false.Default:false
Body
Request
The demo key cannot call this endpoint: it answers 403 demo_not_allowed. Set ODDS_API_KEY to your own key first.
Response
200 OK
That is the answer to the body above. The first id is a listed event, so its card is in data; the second was built by hand and never listed, so it is in missing. Both were charged: 2 tokens.
Fields
data: one body per event found, in the order you sent the ids. Each is exactly what GET /odds returns for that event with the sametier,markets,books,formatanddepth: the live card, or a finished event's closing card, withscoreon every paid plan.missing: the ids you sent that were never listed (a GET would answer404 unknown_event).countis the number of bodies indata.- Cost: the GET price (1 on
tier=main, 5 ontier=extended, +1 withdepth=true) times the number of distinct ids, charged up front. An id inmissingis still charged, as on POST /clv.X-Tokens-Costsays what the call cost. - Rate limit: the call is one request against your 60 a minute, however many events it carries.
- Time limit: a batch still building after 25 seconds stops with
503 unavailable(see Errors below). Keep your client timeout above 25 seconds: the samples use--max-time 30,timeout=30andAbortSignal.timeout(30000). - Plans: the same as GET.
tier=extendedanddepth=trueneed a paid plan and are refused before anything is charged. If any one event is outside your plan (a finished event needs a paid plan), the whole call answers403 plan_requiredand the tokens are given back. - Following many events live? The WebSocket pushes every change as it happens for 100 tokens per connection-minute, cheaper than polling from about 9 events.
Errors
| Status | Code | When |
|---|---|---|
| 400 | bad_request | The body is not a JSON object; event_ids is missing, not a list, empty, more than 20 distinct ids, or holds an id that does not look like an event_id; a bad tier, format, markets or books; depth is not true or false |
| 403 | demo_not_allowed | The demo key: use your own key |
| 403 | plan_required | tier=extended or depth=true outside your plan, or an event your plan cannot read; nothing is charged |
| 503 | unavailable | The batch could not finish within 25 seconds; nothing is charged. Send fewer event_ids (extended cards are the slow ones) instead of resending the same call |
401, 402 and 429 work as on every endpoint: see Errors.