---
title: "The bulk files"
method: GET
path: "/v2/historical/files"
tags: ["Historical"]
---

# The bulk files

`GET /v2/historical/files`

## Request

- Base URL: `https://api.oddsrelay.io`
- URL: `https://api.oddsrelay.io/v2/historical/files`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Betfair's model: the archive cut into one gzip CSV per tier, sport and UTC day, every bookmaker and exchange (BETDAQ never; each file's `bookmakers_only` says whether it holds bookmakers alone) — `closing` (the closing lines), `60s` (the board as it stood at each whole minute) and `changes` (every price change), cut the night after the day (the release lag); `5s` and `1s` (the board as it stood at each 5-second mark or at each second) are cut by arrangement and listed only where a file exists. Each CSV row names its event's `venue` (a race's course) and `event_name` (a teamless event's name) in two columns after `op` (`changes`, `60s`, `5s`, `1s`) or `inplay_seen` (`closing`), empty when the event has neither, from 2026-11-13 (event identity); on 2026-11-13 itself a race carries its course only where it was recorded (from 12:49 UTC, and not on a card listed earlier whose prices did not move after), and no day before carries the columns: an archived file is never rewritten, and the JSON routes (snapshot, event history, closing) serve every course the archive proves for those days. An `in_play` column, where present, stays last. Lists each file with its size and its price; download it from its `url`. Free. A day file holds every bookmaker and market of its sport, so an account whose scope narrows `historical`, or whose plan names a bookmaker list, is 403 `files_need_whole_scope` (contact OddsRelay to arrange files).

**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); your account's scope or your plan's bookmaker list narrowing it (403 `files_need_whole_scope`); `tier`, then `from` and `to`.

## Query parameters

- `tier` 'closing' | '60s' | '5s' | '1s' | 'changes'
- `sports` string
- `from` string, date-time
- `to` string, date-time
- `region` 'uk' | 'za' | 'ng' | 'us' | 'tz' | 'ke' | 'gh' | 'au' | 'ca' | 'zm' | 'ug' | 'cm' | 'ci' | 'sn' | 'cd' | 'mz' | 'mw' | 'nz' | 'rw' | 'global' | 'gr' | 'cz'

## Response `200`

The listing.

- FilesEnvelope
  - `meta` object, required
    - `feed_type` 'historical_files'
    - `count` integer
    - `historical` boolean
    - `bookmakers_only` boolean: `true` only when every listed file's `bookmakers_only` is, so today a whole listing is `false` on `uk` and on `ca`, and `true` on the other international codes (an empty listing: whether exchange history is switched off).
  - `data` HistoricalFile[], required
    - `name` string, required
    - `tier` 'closing' | '60s' | '5s' | '1s' | 'changes', required
    - `sport` string, required
    - `day` string, date, required
    - `size` integer, required: Bytes served: the gzip CSV as stored.
    - `url` string, required: Where to download it. An international region's listing names its region in the url (`?region=<code>`), so following it reads that region's file.
    - `cost` integer, required: Tokens to download it: /v2/pricing `regions.uk.historical.file_per_mb` per started 1,000,000 bytes of `size` (an international region: its own `regions.<code>.historical.file_per_mb`).
    - `bookmakers_only` boolean, required: `true`: the file holds bookmakers alone (no exchange row), as every file does while exchange history is switched off (each is then served cut to bookmakers). `false`: the file holds an exchange's rows (BETDAQ never). On the international codes that is today `ca` alone, in the files holding STX (`stx_ca`: an exchange, back and lay, that /v2/bookmakers lists as a bookmaker); its other files and every file of the other international codes are `true`.

## Other responses

- `304`: Not modified: no body, free.
- `400`: 400: a parameter this route does not read or sent twice, a malformed value, gzip refused on standard, dutching or raw, or a filter value the catalogue does not know.
- `401`: 401: no key, or a key that is not accepted. Carries `WWW-Authenticate`; no token or flood-cap headers.
- `403`: 403: the account, the key's scope, the region, the plan or the account's scope refuses this call.
- `404`: 404.
- `429`: 429 with `Retry-After`. `too_many_requests`: the account's flood cap or its in-flight cap (with `X-RateLimit-*`). `too_many_from_address`: the per-address shield, before authentication (no token or flood-cap headers). The front door's own per-address cap also answers 429 with `Retry-After`, but with an EMPTY body and no `code`. Both per-address caps sit well above an account's flood cap.
- `500`: 500 `internal_error`. If it came after a spend, `X-Tokens-Cost` reads 0 and the spend stands.
- `503`: 503 with `Retry-After`: `temporarily_unavailable` (a board, the key registry or a connection is not ready; retry) or `raw_not_enabled` (the key may use raw but the raw board is not held here).

## Changes

- **2026-12-03** `c9a116d43241`: 1 info
  - added the new enum value `cz` to the `query` request parameter `region`
- **2026-11-18** `e28e311eeb1e`: 20 info
  - added the new enum value `au` to the `query` request parameter `region`
  - added the new enum value `ca` to the `query` request parameter `region`
  - added the new enum value `cd` to the `query` request parameter `region`
  - added the new enum value `ci` to the `query` request parameter `region`
  - …16 more
- **2026-11-12** `444b81ea0fe7`: 1 info
  - added the required property `data/items/bookmakers_only` to the response with the `200` status
- **2026-10-26** `9db71e3e29bb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/oddsrelay/apis/oddsrelay-api/changes/v2/historical/files/get.md)

---

[API](https://skmtc.dev/oddsrelay/apis/oddsrelay-api.md) - [All operations](https://skmtc.dev/oddsrelay/apis/oddsrelay-api/llms.txt) - [OpenAPI document](https://skmtc.dev/oddsrelay/apis/oddsrelay-api/revisions/c9a116d43241?raw)
