Historical

Closing lines of a day's events

Changed on

For every event that started on the UTC day date in sports — matched against the event's held sport_key (the key or its start), as on the snapshot route, and never against competition_key or a sport name (football selects nothing, soccer all of soccer) — (bookmakers and exchanges — bookmakersOnly=true: bookmakers alone; BETDAQ never): each bookmaker's each outcome's line on the event's kick-off day (UTC) up to kick-off — when it was first seen that day and its price then (open_at, open_price: 00:00 if it was already listed; first_seen is the same instant), its last state before kick-off (close_at, close_price), its high and low and how many times it moved (moves) over that day up to kick-off, when it was last_seen, and whether it was still on the board after kick-off (inplay_seen); ord numbers outcomes of one name in one market. Each event names itself as the snapshot does (its held sport_key/sport_title, a race's venue — the proven course on days before the archive recorded one — or a teamless event's event_name). Nested as the raw board nests (event > bookmakers > markets > outcomes); paged by event (sport, kick-off, id), at most 50 events a page. A day's closing lines are cut the night after it (the release lag).

Checks, in this order (the live feed's own): the per-address shield, the key, the flood cap, a suspended account, a browser key's website, the API version; region (uk or one international code; outside the regions your key reads 403 region_not_in_scope), historical in the key; the parameters (each one this route reads, once) and their values; the instant(s); the venues (400 unknown, 403 outside your plan, 403 exchange_history_unavailable for any exchange while exchange history is switched off; bookmakersOnly=true beside an exchange filter is 400); your account's scope (403 with valid; a sport, market or venue left out is the scope's list); quote=true; the price (402).

Price: /v2/pricing regions.uk.historical.closing (an international region: its own regions.<code>.historical.closing) tokens a page with events; a page with none, a 304 and quote=true are free. Free closing: at the owner's setting /v2/pricing regions.uk.historical.free_closing_days (N), closing lines from the last N complete UTC days before the archive's newest day cost 0 on this route — off today (N is 0); the closing files keep their price.

get/v2/historical/closing

Request

  • Base URL
    https://api.oddsrelay.io
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Query parameters

date, string date required

A UTC day, YYYY-MM-DD, from 2026-10-15 (the recorded data starts 2026-10-17) to the day of the archive's newest instant (a later day is 400 date_out_of_range, with latest): a day's closing lines are cut the night after it.

sports, string required

Comma list, up to 20: a sport key or the start of one (soccer, soccer_premier_league), matched against each event's sport_key, never its competition_key; on the snapshot route a sport name (football) too. Required (The Odds API's historical snapshots are per sport too).

region, 'uk' | 'za' | 'ng' | 'us' | 'tz' | 'ke' | 'gh' | 'au' | 'ca' | 'zm' | 'ug' | 'cm' | 'ci' | 'sn' | 'cd' | 'mz' | 'mw' | 'nz' | 'rw' | 'global' | 'gr' | 'cz'

uk, the archive's own region (default), or one international code. Each international code is its own archive of its own venues: bookmakers, and in ca also STX (stx_ca, Ontario's betting exchange, as /v2/odds/raw serves it there: its back prices under each market's key, its lay prices under <key>_lay; bookmakersOnly=true leaves it out, and a file's bookmakers_only says whether the file holds its rows), recorded from 2026-11-16T05:50Z, the lane's first checkpoint (its first day 2026-11-16: an instant before that day is 400 date_out_of_range with earliest 2026-11-16T00:00:00.000Z, one inside it before the first checkpoint 404 no_history), gr from its switch-on at 2026-11-16T18:19Z (a gr page asked for before it is empty, and free), cz from its first rows in December 2026 (likewise empty, and free, before them), with uk's tiers, release lag and rules. Outside the regions your key reads: 403 region_not_in_scope; any other code is 404 unknown_region.

bookmakers, string

Comma list of bookmaker keys (/v2/bookmakers), up to 40; none = every bookmaker. An exchange here is 400 naming exchanges.

exchanges, string

Comma list of exchange keys (/v2/bookmakers), up to 4. While exchange history is switched off, any exchange here is 403 exchange_history_unavailable; beside bookmakersOnly=true it is 400.

markets, string

Comma list of raw's market keys (h2h, over_under, handicap, …; never the matched boards' totals), up to 20: a key raw does not carry matches nothing, and venues and markets outside it are left out.

exchangesOnly, 'true' | 'false'

true: exchanges alone. While exchange history is switched off, true is 403 exchange_history_unavailable; beside bookmakersOnly=true it is 400.

bookmakersOnly, 'true' | 'false'

true: bookmakers alone, no exchange — the answer this route gave before exchanges were added. Default false (bookmakers and exchanges; BETDAQ never). true or false, else 400; true beside exchanges or exchangesOnly=true is 400.

limit, integer

Events per page, 1-50 (default 50): the page one price buys.

cursor, string

The previous page's meta.next_cursor (or X-Next-Cursor). A cursor is bound to no account and expires 300 s after it was issued: 400 cursor expired: start again from the first page; any other shape 400 cursor not recognised: start again from the first page.

quote, string

true (also 1, yes, on): price this exact request instead of serving it. 200 {cost, remaining, rate_card}, free, every check before the price still applies; any other value is an ordinary request.

Response

One page, or under quote=true the price.

union required
ClosingEnvelope required
OR
Quote required

quote=true: this request's price. Free.

Changes

    • info

      added the new enum value cz to the query request parameter region

    • info

      added the new enum value au to the query request parameter region

    • info

      added the new enum value ca to the query request parameter region

    18 more changes in this revision