Find a match
Filter by tennis and save the fixture’s event_id.
Tennis API documentation
Discover tournament fixtures, load match and set prices, then follow odds changes. Use the returned event_id to connect opponents, bookmaker markets and match records.
Filter by tennis and save the fixture’s event_id.
Collect every snapshot page before building your odds board.
Subscribe with the snapshot’s resume token.
curl -sS -G 'https://api.odds-api.net/v1/events' \
-H "X-API-Key: $ODDS_API_KEY" \
--data-urlencode 'sport=tennis' \
--data-urlencode 'not_started_only=true' \
--data-urlencode 'limit=50'
Keep your API key on your server. Compare request and streaming allowances or open the full API reference.
Use sport=tennis for the schedule. The league field identifies a tournament, such as ATP Finals, ATP Challenger Helsinki or WTA Finals.
curl -sS -G 'https://api.odds-api.net/v1/events' \
-H "X-API-Key: $ODDS_API_KEY" \
--data-urlencode 'sport=tennis' \
--data-urlencode 'league=ATP Challenger Helsinki' \
--data-urlencode 'not_started_only=true' \
--data-urlencode 'limit=50'
Read the response’s items. Keep each match’s event_id, opponents, start time and league. Pass next_cursor back as cursor with the same filters until it is empty. Use an exact league name from discovery or coverage.
GET /v1/events/{event_id} retrieves the source match record. GET /v1/events/{event_id}/results returns the result record; handle its pending or available status separately from live score updates.
Match the bet type, metric, period, line and player selection. A full-match game total is a different bet from a first-set game total.
| Market | API bet_type | Selection and scope |
|---|---|---|
| Match winner | moneyline | Compare the two players in a match. Example selections: Jannik Sinner or Carlos Alcaraz. |
| Set winner | moneyline | Use period to select the 1st set or 2nd set. Keep set winners separate from the match winner. |
| Total games | total | metric: games. Compare Over and Under at the same line, such as 22.5 games, for the same period. |
| Game handicaps | handicap | metric: games. Compare player selections at a matching handicap, such as −2.5 games. |
| Set totals and handicaps | total handicap | metric: sets. Build total-set and set-handicap views, keeping the line and selection attached to each price. |
| Player game totals | team total | metric: games. The normalized team total market identifies an individual tennis participant through its selection fields. |
moneyline identifies a match or set winner; period separates the sets. For totals and handicaps, metric distinguishes games from sets. Keep the exact returned line and participant selection when grouping prices.
Use the returned market_key for filtering and selection_key for history. Preserve the bookmaker and odds-row id when applying updates.
Replace the event ID with one returned by fixture discovery. Choose the bookmakers you want to compare.
curl -sS -G "https://api.odds-api.net/v1/events/$EVENT_ID/odds/snapshot" \
-H "X-API-Key: $ODDS_API_KEY" \
--data-urlencode 'bookmakers=bet365,pinnacle,sportsbet' \
--data-urlencode 'price_fields=odds'
Follow next_cursor through every page. Each odds row identifies its bookmaker, market, selection and decimal price. Preserve period, metric, line and timestamps alongside the price.
Save the resume token from the first snapshot page. After reading all pages, open the stream with that token so changes during pagination can be replayed.
Start with a snapshot, then apply changes to your local odds rows. Use the same bookmaker and price filters for both requests.
curl -N -G "https://api.odds-api.net/v1/events/$EVENT_ID/odds/stream" \
-H "X-API-Key: $ODDS_API_KEY" \
--data-urlencode 'bookmakers=bet365,pinnacle,sportsbet' \
--data-urlencode 'price_fields=odds' \
--data-urlencode "since=$RESUME" \
--data-urlencode 'catchup=true'
The WebSocket equivalent is wss://api.odds-api.net/v1/events/{event_id}/odds/ws. It accepts the same query filters and sends JSON envelopes with event and data.
id and retain the latest resume token.since and catchup=true, using backoff.These endpoints carry pre-match bookmaker prices. Builder, Live and Pro include Betfair in-play exchange access through the exchange endpoints. Discover a match’s exchange markets at GET /v1/events/{event_id}/exchange/markets.
Ask support to enable tennis score access on your API client. This is a separate entitlement from in-play exchange access.
Discover the tennis match with GET /v1/events/{event_id}/exchange/markets. Use the canonical event ID from the returned score_subscription.command—not a market ID.
wss://api.odds-api.net/v1/exchange/tennis/scores/ws
Header: X-API-Key: YOUR_API_KEY
{"op":"subscribe","event_ids":["CANONICAL_ID_FROM_DISCOVERY"]}
| Field | Meaning |
|---|---|
home, away | Participant names, integer sets and games, string points, nullable is_serving and game_sequence arrays. |
current_set, current_game | Current set and game state; unknown values remain null. |
tie_break, match_status | Tie-break and match state. |
stream_id, sequence, update_kind | Identify the stream and ordered changes, including corrections and resets. |
freshness | Receipt-time freshness. Score and exchange price receipt times are independent. |
The first observation is an image. Every subsequent delta contains the complete replacement score state. Apply corrections too. Compare sequence numbers only within the same stream_id.
A connection supports up to ten active events and consumes one stream unit plus the plan’s stream-hour and byte allowances. Scores are match-state updates, not final settlement results. There is no historical score replay or resume token; reconnect and subscribe again for a fresh image.
History Lite adds 30 days of retained pre-match odds for $50 USD/month on a paid plan. Use a selection_key from the snapshot to follow one selection’s recorded prices.
curl -sS -G "https://api.odds-api.net/v1/events/$EVENT_ID/odds/history" \
-H "X-API-Key: $ODDS_API_KEY" \
--data-urlencode "selection_key=$SELECTION_KEY" \
--data-urlencode "from_ts=$FROM_ISO8601" \
--data-urlencode "to_ts=$TO_ISO8601"
Keep the bookmaker, player, market, period, metric and line attached to each series. A first-set total of 9.5 games and a match total of 22.5 games belong on separate series. Follow the endpoint’s pagination and retain returned timestamps.
Install requests and set ODDS_API_KEY on your server. This example discovers a current tennis match with a selected bookmaker and reads all its snapshot pages.
import os
import requests
BASE = "https://api.odds-api.net/v1"
HEADERS = {"X-API-Key": os.environ["ODDS_API_KEY"]}
BOOKMAKERS = ["bet365", "pinnacle", "sportsbet"]
def pages(path, params):
params = dict(params)
while True:
response = requests.get(BASE + path, headers=HEADERS, params=params, timeout=20)
response.raise_for_status()
payload = response.json()
yield payload
cursor = payload.get("next_cursor")
if not cursor:
return
params["cursor"] = cursor
fixtures = pages("/events", {
"sport": "tennis",
"not_started_only": "true", "limit": 50,
})
event = next((event for page in fixtures for event in page["items"]
if any(book in event.get("bookmakers", []) for book in BOOKMAKERS)), None)
if event is None:
raise RuntimeError("No upcoming tennis match with the selected bookmakers. Try again later.")
for snapshot in pages(f"/events/{event['event_id']}/odds/snapshot", {
"bookmakers": ",".join(BOOKMAKERS), "price_fields": "odds",
}):
print(snapshot) # Keep timestamps and stream resume information with the rows.
Read the full endpoint reference for response schemas and status codes.