Betfair API for exchange odds and order books

Access Betfair Exchange market data through odds-api with the exact exchanges=betfair filter. Read pre-match back and lay ladders, available size, best prices, and matched activity through REST, then follow covered changes by SSE or WebSocket.

GET /v1/events/{event_id}/exchange/orderbook/snapshot?exchanges=betfair&depth=2
{
  "event_id": "$EVENT_ID",
  "items": [
    {
      "exchange": "betfair",
      "exchange_market_id": "1.23456789",
      "market_key": "moneyline",
      "period_str": "full time",
      "total_matched": 24567.12,
      "selections": [
        {
          "selection_key": "moneyline:home",
          "selection_name": "Manchester City",
          "last_traded_price": 2.08,
          "available_to_back": [
            { "price": 2.08, "size": 120.50 },
            { "price": 2.06, "size": 215.25 }
            
          ],
          "available_to_lay": [
            { "price": 2.10, "size": 84.30 },
            { "price": 2.12, "size": 180.00 }
            
          ],
          "best_back_price": 2.08,
          "best_back_size": 120.50,
          "best_lay_price": 2.10,
          "best_lay_size": 84.30
        }
      ]
    }
  ],
  "resume": "1784092451749-0"
}
Betfair exchange filter Request only Betfair order books with the canonical exchanges=betfair filter.
Back and lay ladders Read price levels, available size, best prices, and matched activity without flattening the order book.
REST and live streams Start with REST, then add pre-match SSE or WebSocket updates.

Betfair Exchange API order-book fields

Use these fields to model Betfair back and lay prices without flattening an exchange order book into a sportsbook-style odds row.

Order-book data API fields What it covers
Back price ladder available_to_backbest_back_pricebest_back_size Ordered prices available to back a selection, including the best quoted price and available size.
Lay price ladder available_to_laybest_lay_pricebest_lay_size Ordered prices available to lay a selection, including the best quoted price and available size.
Traded activity last_traded_pricetraded_volumetotal_matched The latest traded price and market or selection matched activity where supplied by the exchange source.
Selection identity selection_keyexchange_selection_idselection_name Stable normalized selection fields alongside Betfair's exchange selection identifier where supplied.
Market context market_keyperiod_strstatus Normalized market, period, and availability fields for each Betfair exchange order book.

The exchange order-book surface is separate from regular bookmaker odds snapshots. Betfair availability varies by event, market, region, and time, and odds-api currently provides pre-match rather than in-play coverage.

Built for agents and humans

MCP server

Tools for events, odds, line movement, and streams. Bets endpoints are support-approved.

Agent skill

Agent-ready instructions.

SDKs and examples

TypeScript, Python, Postman and example builds.

Sports and racing

Sports and racing odds coverage for agent workflows.

SSE odds stream

Lightweight streaming updates for dashboards and alerts.

WebSocket feeds

Bidirectional streams for richer pre-match products.

How to use the Betfair API

Find a covered event, then request its Betfair exchange order book with exchanges=betfair. Keep exchange ladders separate from regular sportsbook-style odds rows.

  1. Confirm Betfair coverage

    Create an API key and request GET /v1/bookmakers. Confirm that the canonical betfair key is available to your account and attached to the event you need.

  2. Load the order book

    Request GET /v1/events/{event_id}/exchange/orderbook/snapshot with exchanges=betfair. Use depth to limit the number of back and lay price levels returned.

  3. Store prices and size

    Keep the best back and lay prices, available size, matched activity, freshness fields, and resume token. Exchange liquidity can move quickly.

  4. Follow market changes

    Open the matching SSE or WebSocket order-book stream, resume from the latest token after reconnecting, and reload the snapshot after a resync event.

Odds API Pricing

Start free, then choose a monthly plan based on request volume, rate limits, and support.

Sandbox

Free
Free
Requests
1K / month
Streams
25 stream-hours / month
  • 30 requests/min
  • Docs and AI assistant

Starter

50K
$25 USD / month
Requests
50K / month
Streams
150 stream-hours / month
  • 60 requests/min
  • Self-serve
Best value

Builder

2M
$90 USD / month
Requests
2M / month
Streams
1,500 stream-hours / month
  • 300 requests/min
  • Email support

Live

20M
$250 USD / month
Requests
20M / month
Streams
6,000 stream-hours / month
  • 600 requests/min
  • Priority email

Pro

75M
$500 USD / month
Requests
75M / month
Streams
20,000 stream-hours / month
  • 1,200 requests/min
  • Priority email plus onboarding

Scale

Custom
Custom
Requests
100M+ typical
Streams
Custom
  • Custom
  • Dedicated support

Betfair API FAQs

Clear answers about Betfair exchange data, back and lay prices, official API-NG, and the limits of this independent integration.

Is this the official Betfair Exchange API or API-NG?

No. odds-api is an independent data service and is not affiliated with, endorsed by, or sponsored by Betfair. Betfair's official Exchange API includes account and bet-management operations; this integration provides market data only and does not place, cancel, or manage Betfair bets or customer accounts.

How do I retrieve Betfair back and lay odds?

Request GET /v1/events/{event_id}/exchange/orderbook/snapshot with exchanges=betfair. Each covered selection can include available_to_back and available_to_lay ladders, best back and lay price and size, last traded price, and matched activity where supplied.

What is the correct Betfair API filter?

Use exchanges=betfair on the dedicated exchange order-book endpoints. The regular sportsbook-style odds endpoint uses bookmakers filters, but exchange order-book rows are intentionally kept on the separate exchange surface.

Can I stream Betfair Exchange price changes?

Yes, for covered pre-match markets. Start with the order-book REST snapshot, then use its resume token with the matching SSE or WebSocket endpoint. Handle delta, heartbeat, and resync events and reload the snapshot after resync.

Does this Betfair API integration include in-play odds?

No. odds-api currently provides pre-match Betfair coverage rather than in-play odds after an event has started. Streaming keeps supported pre-match order books current; it does not imply in-play coverage.

Start using the Betfair API

Create a free key, find a covered event, and request its current Betfair back and lay order book.

Create a free API key