The Betfair Sports Exchange API is used to discover exchange events, inspect available markets, retrieve prices and liquidity, follow live market changes, and—where an account and application are authorised—manage orders. It is different from a conventional sports scores API. The central object is an exchange market in which participants can offer prices to back or lay an outcome, and those offers may be matched with other participants.
That distinction matters when you are building a sports data platform, exchange interface, trading tool, market monitor, odds comparison product or a wider sportsbook application. You need to understand the event catalogue, market identifiers, runner selections, price ladder, order lifecycle, streaming updates and the rules that govern access.

What is the Betfair Sports Exchange API?
Betfair provides developer interfaces for working with its Exchange. The Betting API (often referred to as the Sports API) exposes operations for discovering event types, events, competitions and markets, retrieving market books, and managing orders. The Exchange Stream API provides a streaming route for market and order updates so an application does not have to rely only on repeated request-and-response polling.
The API is not simply a feed of final scores or a universal database of every sport in every country. It exposes the exchange markets that are available to the account and application under the applicable access conditions. Some sports or events may have no market, and market depth, liquidity, market types and timing can vary. Always query the live catalogue rather than assuming that a sport or competition is covered.
How an exchange market works
Traditional fixed-odds products generally show a price offered by an operator. An exchange works differently: participants can offer to back an outcome or lay it. A back offer expresses a price at which someone is willing to back a selection; a lay offer expresses a price at which someone is willing to oppose it. Orders can be matched fully, matched partially or remain unmatched.
For a developer, the important objects are:
- Event: the sporting contest or race, such as a football match, tennis match or horse race.
- Market: a particular question about that event, such as Match Odds, Over/Under or a race Win market.
- Runner: a selection within the market. In a two-team match market, the runners may represent the home team, away team and draw.
- Price ladder: available back and lay prices with the amount available at each price.
- Order: a participant’s instruction to back or lay a runner, with a price, size and persistence behaviour.
A market ID identifies a market, while a selection ID identifies a runner within that market. Do not confuse either with your own internal event ID or a provider’s event ID. Store the mapping explicitly.
Sports and event categories you can discover
Betfair’s event catalogue is dynamic. The API’s listEventTypes operation returns the event types associated with the markets selected by the filter. The developer documentation uses examples such as Soccer and Horse Racing. This is the correct way to discover the categories currently visible to your application, rather than hard-coding a list and assuming all categories are always available.
When planning a multi-sport integration, teams commonly evaluate the following sport and event areas, subject to the actual catalogue and market availability in their account and region:
- Football / soccer: match odds, correct score, totals, handicaps, team-related and other event markets where listed.
- Cricket: match winner, innings-related outcomes, runs, wickets, session or other market formats where offered for the event.
- Tennis: match winner, set markets, game handicaps and totals where available.
- Basketball: match winner, point spreads, totals and period-related markets where listed.
- Horse racing: race win and place markets, with runners representing horses.
- Greyhound racing: race markets and runner prices where available.
- Golf: tournament winner, finishing position and player-versus-player markets where offered.
- Rugby: match winner, handicap and points totals where available.
- Baseball: game winner, run lines and totals where listed.
- Ice hockey: match or period outcomes, handicaps and totals where available.
- Volleyball and badminton: match and set-related outcomes where markets are offered.
- Boxing and mixed martial arts: fight winner and selected method or round markets where listed.
- Snooker, darts, table tennis and other events: match, frame, leg or game-related markets where available.
This is an integration planning list, not a guarantee that Betfair offers every sport, competition, market type or event in every jurisdiction. The live event-type and market catalogue is authoritative for your application. The same sport may have different market depth across competitions and events.
Core API workflow: from event discovery to prices
A robust integration generally follows a sequence. First discover event types, then events, then market catalogues, and finally market books. Betfair’s official getting-started documentation recommends this discovery-first workflow and demonstrates the JSON-RPC request format.
- Discover event types: call
listEventTypesto see the sport categories associated with the filter. - Find events: call
listEventswith an event-type filter and a market start-time range. - Find markets: call
listMarketCataloguewith event IDs and the market projections your application needs. - Retrieve prices: call
listMarketBookwith market IDs and the required price projection. - Subscribe to changes: use the Exchange Stream API for ongoing market or order updates where your use case and permissions support it.
- Manage orders: use order operations only if your application is authorised and the user has explicitly requested an order action.
Example: discover sports and events
The following JSON-RPC request illustrates the shape of an event-type discovery call. It is a documentation-style example; use your own authenticated session, application key and permitted endpoint configuration.
{
"jsonrpc": "2.0",
"method": "SportsAPING/v1.0/listEventTypes",
"params": {
"filter": {}
},
"id": 1
}
The response contains event-type results and a market count. Your application should treat the returned IDs as catalogue data, not assume that a particular numeric ID always means the same thing without checking the returned name and current documentation.
To find events for a selected sport, pass its returned event-type ID and a time range to listEvents. Keep date filtering explicit and use UTC timestamps in the API request to avoid local-time ambiguity.
Market catalogue versus market book
These two operations serve different purposes. listMarketCatalogue returns relatively static market information: market name, event, start time, runner descriptions and selected metadata. It is suitable for building the market list and resolving runner identifiers. It does not return the live price ladder, and the documentation notes that closed markets are not returned by this operation.
listMarketBook returns the current state of requested markets, including market status, matched volume and runner-level price information depending on the price projection. For example, a request can ask for best available exchange offers and traded prices. Do not repeatedly request the catalogue as if it were a live price feed.
A simplified request for a market book looks like this:
{
"jsonrpc": "2.0",
"method": "SportsAPING/v1.0/listMarketBook",
"params": {
"marketIds": ["1.234567890"],
"priceProjection": {
"priceData": ["EX_BEST_OFFERS", "EX_TRADED"]
}
},
"id": 2
}
The market ID above is illustrative. In a real application, obtain it from a fresh market catalogue response. Check the returned market status and runner status before presenting prices as actionable or current.
Understanding back, lay and available liquidity
Exchange prices are not just a single decimal odd. The price ladder can contain multiple back and lay levels, each with a size available at that price. The best available offer is useful for a compact display, while deeper levels can help an analytics or trading interface estimate how much can be matched near the top of the book.
Keep these concepts separate in your data model:
- Available to back: prices and sizes offered by participants willing to back the selection.
- Available to lay: prices and sizes offered by participants willing to lay the selection.
- Traded volume: recorded amounts matched at price levels, not the same as currently available liquidity.
- Total matched: the market-level matched amount returned by the market book.
Never label traded volume as available liquidity. Also avoid assuming that the displayed best price can be matched for an unlimited amount. The available size can change between a read and a subsequent order instruction.
Using the Exchange Stream API for live updates
Polling can be acceptable for low-frequency snapshots, but it becomes inefficient when an application tracks many active markets. The Exchange Stream API provides a streaming protocol for receiving market and order changes. A typical design establishes an authenticated connection, sends a subscription message for the required markets or order stream, processes change messages and maintains a local in-memory or persisted view.
Streaming is not a licence to assume every message is a complete snapshot. Your client should handle initial images, incremental changes, reconnects and resynchronisation. If the connection drops, the local view may be incomplete until the client has recovered and applied a fresh image or other documented recovery procedure.
For production use:
- Track connection state, last message time and subscription state.
- Use the stream’s documented sequence and clock fields where provided to detect gaps.
- On reconnect, follow the official protocol for resubscription and recovery rather than blindly appending new deltas to stale state.
- Keep a bounded queue and define what happens if your consumer falls behind.
- Separate market subscriptions from order subscriptions and restrict them to what the user actually needs.
Node.js integration architecture
A practical Node.js service can separate provider communication from your product’s own API. The provider adapter handles authentication, JSON-RPC requests and stream messages. A normalisation layer converts market and runner records into internal entities. Redis can hold short-lived snapshots and pub/sub notifications, while a database stores durable user configuration, event mappings and audit records where permitted.
const axios = require("axios");
const BETTING_API =
"https://api.betfair.com/exchange/betting/json-rpc/v1";
async function callBetfair(method, params, sessionToken, appKey) {
const response = await axios.post(
BETTING_API,
[{
jsonrpc: "2.0",
method: `SportsAPING/v1.0/${method}`,
params,
id: 1
}],
{
headers: {
"X-Application": appKey,
"X-Authentication": sessionToken,
"Content-Type": "application/json"
},
timeout: 10000
}
);
const result = response.data?.[0];
if (!result) throw new Error("Empty Betfair API response");
if (result.error) {
throw new Error(result.error.message || "Betfair API error");
}
return result.result;
}
async function getAvailableSports(sessionToken, appKey) {
return callBetfair(
"listEventTypes",
{ filter: {} },
sessionToken,
appKey
);
}
This example demonstrates request structure, not a complete authentication implementation. Obtain and refresh sessions using Betfair’s documented login and session-management process. Keep application keys and session tokens on the server, never in browser JavaScript or a public mobile bundle. Add retry logic only for errors that are safe to retry, respect request limits, and log provider error codes without exposing credentials.
Order operations need stronger safeguards
The Betting API includes operations such as placing, cancelling, updating and replacing orders, and retrieving current orders. These operations can create financial exposure. A successful API response does not mean the full requested size was matched; inspect the instruction reports, matched size, average matched price and remaining order state.
Before any order action, validate the market ID, selection ID, side, price, size, order type and persistence instruction. Confirm the market is open and the runner is active. Build an explicit confirmation step into the user experience, use idempotency and duplicate-submission protections in your own application, and keep an auditable record of the request and response. Never automatically retry an order placement after an ambiguous network timeout without first checking the order state.
This article focuses on integration and market data, not instructions to place real-money bets. Access to order functionality, account eligibility, local rules and responsible-use obligations must be checked independently.
Rate limits, caching and application performance
Exchange API operations have request limits and data request costs. Design queries around the data your application actually needs. Fetch a market catalogue when building or refreshing an event’s market list, then request market books for selected active markets. Avoid asking for every market in every sport on every page load.
Cache relatively stable event and market metadata longer than live prices. For live market data, choose a short freshness window based on the user experience and whether you are using polling or streaming. Include a received timestamp and a stale flag in your own API response. A client should be able to distinguish a current snapshot from a cached value retained during a provider interruption.
Batch compatible requests where the API supports it, cap the number of markets per request according to the official limits, and monitor request weight, latency, error rates and cache hit ratio. Read the official Getting Started guide and developer documentation before setting production request patterns.
Common integration mistakes
- Hard-coding sports and IDs: discover event types and market availability from the live catalogue.
- Mixing event and market IDs: store each identifier with its type and provider namespace.
- Using catalogue data as live prices: retrieve market books or consume stream updates for price changes.
- Confusing traded volume with available size: display these as separate measures.
- Ignoring market status: a suspended or closed market must not be shown as normally open.
- Assuming every sport has identical market structures: use sport-aware presentation and validation rules.
- Putting credentials in the frontend: proxy API calls through a protected backend.
- Ignoring recovery: reconnect and resynchronise streaming state after interruptions.
- Assuming every order is fully matched: inspect matched and unmatched quantities in order reports.
Licensing, access and regional availability
Before launching a commercial product, confirm the account type, application key permissions, data usage rights, display and redistribution permissions, market access and any jurisdiction-specific restrictions that apply to your use case. API access does not automatically grant unrestricted rights to redistribute exchange data to third parties or display it in every product. Check Betfair’s current developer terms and account conditions, and obtain legal advice where your business model requires it.
Availability can also vary by location, account status and product access. Do not promise customers that every sport, event or market will be present until your application has verified the catalogue for the intended account and region.
Where the Betfair Sports Exchange API fits in a wider sports platform
The Exchange API can be one component in a broader sports technology stack. A platform may use a sports data provider for fixtures, scores and match statistics, the Exchange API for exchange market data, and its own application services for user accounts, analytics, notifications and dashboards. These sources should not be blended without clear provenance.
For example, a football match score from a live-score provider and a Betfair market price are different data products with different update patterns. Your system should store source, received time and update status for each. The same principle applies when building cricket scorecards, tennis match centres, basketball dashboards, horse-racing pages or multi-sport applications.
Related SportsDataAPI resources include our Betfair data integration guide, sports market data normalisation guide, WebSocket reconnect guide and sports data monitoring guide.
Conclusion
The Betfair Sports Exchange API gives developers a structured way to discover exchange events and markets, retrieve price and liquidity information, consume live updates and manage orders where authorised. The strongest integrations do not assume fixed sport coverage or treat the exchange as a simple odds endpoint. They discover what is available, preserve event and market identity, distinguish catalogue data from live books, handle stream recovery, protect credentials and make order state explicit.
If you are building a multi-sport exchange interface or integrating Betfair into a wider sports platform, start with a read-only discovery and market-data workflow. Validate the event coverage and data behaviour for your target account before adding more complex trading or user-facing features.