Best back and lay
Display the best price on each side of a selection, with the available stake attached.
Matchbook winners, handicaps and totals across 270 leagues, with 250+ bookmakers in the same API. Streaming and REST included.
{
"event_id": "2780053462",
"items": [
{
"exchange": "matchbook",
"exchange_market_id": "34800021083400023",
"market_key": "moneyline",
"period_str": "full time",
"total_matched": 0.0,
"selections": [
{
"selection_key": "34800021084101023",
"selection_name": "Skyliners Frankfurt",
"last_traded_price": null,
"available_to_back": [
{ "price": 2.3, "size": 7.43868 },
{ "price": 2.28, "size": 7.49447 }
],
"available_to_lay": [
{ "price": 2.68, "size": 15.7917 },
{ "price": 2.74, "size": 22.98592 }
],
"best_back_price": 2.3,
"best_back_size": 7.43868,
"best_lay_price": 2.68,
"best_lay_size": 15.7917
}
]
}
],
"resume": "1794449464217-0"
}
Keep Matchbook's back and lay prices beside the liquidity available at each level.
Display the best price on each side of a selection, with the available stake attached.
Read the ladder behind the headline price and choose how many levels your comparison displays.
Join Matchbook to other bookmaker prices using the same event, market, period, line and selection.
Pull both price ladders and prepare a comparison that keeps back prices, lay prices and stakes separate.
X-API-Keymatchbook/v1/events/{event_id}/exchange/orderbook/snapshot?exchanges=matchbook&depth=2
Build a Matchbook price and liquidity comparison using https://api.odds-api.net/v1.
Read ODDS_API_KEY from a server-side environment variable and authenticate with X-API-Key. Find an upcoming NBA fixture at /events?league=NBA¬_started_only=true&limit=50 whose bookmakers list or mapping contains matchbook. Keep its canonical event_id.
Request /events/{event_id}/exchange/orderbook/snapshot?exchanges=matchbook&depth=2. Follow next_cursor with the same filters until there is no next page. For every selection, keep market_key, exchange_market_id, period_str, metric, side and line, plus available_to_back and available_to_lay with each price and size. Preserve currency, source_ts, freshness and the resume token.
Create one row per exact market and selection. Show best back price, back size, best lay price, lay size and currency, with expandable ladders. Keep missing prices empty rather than replacing them with zero.
Let me choose other bookmakers and request their normalized odds for the same event. Join only matching outcomes, periods, metrics and lines. Keep back comparisons and lay comparisons in separate columns. Do not assume an exchange selection_key is shared with a bookmaker selection_key.
Load a complete snapshot before connecting to the matching exchange order-book SSE or WebSocket stream. Reconnect with the latest resume token and reload the snapshot on resync. Export the comparison as JSON and CSV. Handle an empty event list, empty ladders and API errors without inventing prices.const apiKey = process.env.ODDS_API_KEY;
const baseUrl = "https://api.odds-api.net/v1";
const headers = { "X-API-Key": apiKey };
if (!apiKey) throw new Error("Set ODDS_API_KEY before running this file.");
async function getJson(path) {
const response = await fetch(`${baseUrl}${path}`, { headers });
if (!response.ok) throw new Error(await response.text());
return response.json();
}
const events = await getJson("/events?league=NBA¬_started_only=true&limit=50");
const event = events.items.find(({ bookmakers }) =>
Array.isArray(bookmakers)
? bookmakers.includes("matchbook")
: Object.hasOwn(bookmakers ?? {}, "matchbook")
);
if (!event) throw new Error("No current Matchbook event found.");
const snapshot = await getJson(
`/events/${encodeURIComponent(event.event_id)}/exchange/orderbook/snapshot?exchanges=matchbook&depth=2`
);
console.log(JSON.stringify(snapshot, null, 2));
import os
import requests
base_url = "https://api.odds-api.net/v1"
headers = {"X-API-Key": os.environ["ODDS_API_KEY"]}
events_response = requests.get(
f"{base_url}/events",
headers=headers,
params={"limit": 50, "league": "NBA", "not_started_only": True},
timeout=20,
)
events_response.raise_for_status()
events = events_response.json()["items"]
event = next(
(item for item in events if "matchbook" in item.get("bookmakers", [])),
None,
)
if event is None:
raise RuntimeError("No current Matchbook event found.")
response = requests.get(
f"{base_url}/events/{event['event_id']}/exchange/orderbook/snapshot",
headers=headers,
params={"exchanges": "matchbook", "depth": 2},
timeout=20,
)
response.raise_for_status()
print(response.json())
export ODDS_API_KEY="your_api_key"
# Find an upcoming NBA game listing matchbook.
curl -sS \
-H "X-API-Key: $ODDS_API_KEY" \
"https://api.odds-api.net/v1/events?league=NBA¬_started_only=true&limit=50"
# Use that game's event_id below.
export EVENT_ID="replace_with_event_id"
curl -sS \
-H "X-API-Key: $ODDS_API_KEY" \
"https://api.odds-api.net/v1/events/$EVENT_ID/exchange/orderbook/snapshot?exchanges=matchbook&depth=2"
Tennis, basketball, American football and more, with winners, handicaps, totals and team totals in one format.
Home, draw and away prices across 151 football leagues, with each outcome kept separate.
moneyline 3wPlayer winner prices across 89 tournaments, including ATP, WTA and Challenger competitions.
moneylineNBA, WNBA and European basketball handicap prices with the signed line attached to each team.
handicapOver and under points prices for American football, with the total and period kept together.
totalMLB handicap prices with the team and run line preserved for an exact comparison.
handicapNHL puck-line prices kept separate from winner markets and goal totals.
handicapTwo-way and three-way cricket results, with the draw retained as its own outcome.
moneylinemoneyline 3wFight winner prices with separate fighter selections for your exchange comparison.
moneylineHandicaps and match totals alongside three-way match odds for rugby union.
handicaptotalOver/under and handicap markets with each player, line and period retained.
totalhandicapFootball goal totals for one team, matched by team, line and period rather than the match total.
team totalFirst-half totals for football, basketball and American football, separate from full-match markets.
total1st halfTools for events, odds, line movement, streams, and paid-plan positive EV or arbitrage feeds.
Agent-ready instructions.
TypeScript, Python, Postman and example builds.
Sports and racing odds coverage for agent workflows.
Lightweight streaming updates for dashboards and alerts.
Price updates for sportsbook and exchange products.
Find the fixture once, load both ladders and keep the matching market in view.
Create an odds-api.net key, store it on your server and send it in the X-API-Key header.
Request the event list and choose an event containing matchbook in its bookmakers field. Keep the event_id.
Request the exchange order-book snapshot with exchanges=matchbook and your ladder depth. Keep each price with its available size.
Connect to the matching pre-match SSE or WebSocket stream with the snapshot's resume token. Reload the snapshot on resync.
Choose a monthly plan based on request volume, rate limits, and support.
Enterprise grade
Custom projects, scoped with your team.
Matchbook filters, market depth, streaming and comparison data.
odds-api.net provides Matchbook pre-match odds across 11 sports and 270 leagues. Read five market types: two-way winners, three-way match odds, handicaps, totals and team totals. Exchange order books add back and lay ladders with available stakes.
Use GET /v1/events/{event_id}/exchange/orderbook/snapshot?exchanges=matchbook&depth=2. Each selection contains available_to_back and available_to_lay arrays, plus best-price and available-size fields.
Match winners, handicaps and totals across 89 tennis tournaments. Keep the player selection, market type, line and period together when comparing prices.
Yes. Use bookmakers=matchbook on the normalized odds snapshot for the same event_id, then request your comparison bookmakers. Match the outcome, market, period, metric and line before comparing prices. Use the separate exchange order book when your comparison also needs back and lay liquidity.
Yes. REST snapshots, SSE streams and WebSocket streams are included. Load the exchange order-book snapshot first, retain its resume token and use the matching pre-match stream for updates.
Use an odds-api.net API key in the X-API-Key header. These endpoints supply odds and exchange market data; Matchbook account balances and bet placement belong to Matchbook's own account API.
Keep event and market fields consistent across your exchange integrations.
Explore the exchange APIOne key for bookmaker prices, exchange ladders and the liquidity behind each quote.