Betfair Historic Data API

Download purchased historical exchange market data.

Operations 5

POST /GetMyData Get purchased data packages #
POST /GetCollectionOptions Get collection filter options #
POST /GetAdvBasketDataSize Get file count and size for a filter #
POST /DownloadListOfFiles List downloadable files for a filter #
GET /DownloadFile Download a historical data file #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/betfair-historic-data-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

betfair-historic-data-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Betfair Exchange API (API-NG) Historic Data API
  description: OpenAPI description of the request/response HTTP surface of the Betfair Exchange API (API-NG).
  version: 1.0.0
  contact:
    name: API Evangelist
    email: kin@apievangelist.com
    url: https://apievangelist.com
  license:
    name: API documentation - Betfair Developer Program Terms
    url: https://developer.betfair.com/
servers:
- url: https://api.betfair.com/exchange
  description: Betfair Exchange API-NG (Betting, Accounts, Heartbeat)
security:
- appKey: []
  sessionToken: []
tags:
- name: Historic Data
  description: Download purchased historical exchange market data.
paths:
  /GetMyData:
    post:
      operationId: getMyData
      tags:
      - Historic Data
      summary: Get purchased data packages
      description: 'Returns the historical data packages the customer has purchased. Full URL: https://historicdata.betfair.com/api/GetMyData. Authenticated with the ssoid session token header.'
      servers:
      - url: https://historicdata.betfair.com/api
      responses:
        '200':
          description: List of purchased data packages.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
  /GetCollectionOptions:
    post:
      operationId: getCollectionOptions
      tags:
      - Historic Data
      summary: Get collection filter options
      description: Returns the available filter options (sports, dates, market types) for a data collection.
      servers:
      - url: https://historicdata.betfair.com/api
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HistoricDataFilter'
      responses:
        '200':
          description: Collection options.
          content:
            application/json:
              schema:
                type: object
  /GetAdvBasketDataSize:
    post:
      operationId: getAdvBasketDataSize
      tags:
      - Historic Data
      summary: Get file count and size for a filter
      description: Returns the number of files and total size that match a given filter.
      servers:
      - url: https://historicdata.betfair.com/api
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HistoricDataFilter'
      responses:
        '200':
          description: File count and size.
          content:
            application/json:
              schema:
                type: object
                properties:
                  fileCount:
                    type: integer
                  totalSizeMB:
                    type: number
  /DownloadListOfFiles:
    post:
      operationId: downloadListOfFiles
      tags:
      - Historic Data
      summary: List downloadable files for a filter
      description: Returns a list of file paths matching a given filter, to be fetched via DownloadFile.
      servers:
      - url: https://historicdata.betfair.com/api
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HistoricDataFilter'
      responses:
        '200':
          description: List of file paths.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
  /DownloadFile:
    get:
      operationId: downloadFile
      tags:
      - Historic Data
      summary: Download a historical data file
      description: Downloads a specific historical data file by path. Full URL, query-parameterized, under https://historicdata.betfair.com/api/DownloadFile.
      servers:
      - url: https://historicdata.betfair.com/api
      parameters:
      - name: filePath
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: The file contents (compressed market data).
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
components:
  schemas:
    HistoricDataFilter:
      type: object
      description: Filter for the Historic Data API (sport, plan, date range, market types).
      properties:
        sport:
          type: string
        plan:
          type: string
          enum:
          - Basic Plan
          - Advanced Plan
          - Pro Plan
        fromDay:
          type: integer
        fromMonth:
          type: integer
        fromYear:
          type: integer
        toDay:
          type: integer
        toMonth:
          type: integer
        toYear:
          type: integer
        marketTypesCollection:
          type: array
          items:
            type: string
        countriesCollection:
          type: array
          items:
            type: string
        fileTypeCollection:
          type: array
          items:
            type: string
  securitySchemes:
    appKey:
      type: apiKey
      in: header
      name: X-Application
      description: The developer Application Key (delayed or live).
    sessionToken:
      type: apiKey
      in: header
      name: X-Authentication
      description: The session token (ssoid) obtained from identity SSO login.