Getting started
Introduction
The Odds Data API is a REST API with bet365 data: in-play and pre-match odds, live scores, stats, lineups and results, returned as JSON.
What the API is
Every price, score and status comes from bet365 and only from bet365. We capture it as it appears there and return it in the same format as BetsAPI, so code written for that format works here with a different base URL and token.
Sports are split into leagues, and every event is played between two teams. Everything that plays is a team: clubs, national teams, tennis players and esoccer pairings such as Liverpool (Marlin) Esports. Players are listed in team squads. See Esports.
Data only
Events API and Bet365 API
The endpoints are split in two groups, like the BetsAPI documentation.
The Events API returns only the main markets of each sport, 1 to 3 of them. For every market bet365 lists, use the Bet365 API. See Market keys.
Base URL and token
All requests are HTTPS GET requests to one base URL.
https://api.odds-data-api.com/Each endpoint carries its own version in the path, for example /v3/events/upcoming or /v4/bet365/prematch. Pass your token as ?token=YOUR-TOKEN. See Authentication.
curl "https://api.odds-data-api.com/v3/events/upcoming?sport_id=1&token=YOUR-TOKEN"Response format
Every response is JSON with a success key. On success it is 1 and the data is in results. Paginated calls add a pager; see R-Pager.
{
"success": 1,
"pager": { "page": 1, "per_page": 50, "total": 312 },
"results": [
{ "id": "8211004", "sport_id": "1", "time": "1789243500", "time_status": "0", "bet365_id": "158211004" }
]
}- Ids, scores and times are strings.
timeis a UTC epoch in seconds. time_statustells you whether an event is upcoming, in play or over. See time_status.- New fields can appear at any time. Ignore fields you do not use.
When a call fails, success is 0 and error holds the code. See Errors.
{
"success": 0,
"error": "PARAM_REQUIRED",
"error_detail": "sport_id"
}Ids
idon an Events API event is our event id. Pass it asevent_idto Event View, Event History, Event Odds and the other event endpoints.bet365_idon the same event is the bet365 fixture id. Pass it asFIto Bet365 Inplay Event and Bet365 PreMatch Odds.- In the Bet365 API,
idis the FI andour_event_idlinks back to the Events API. League and team ids there can differ from Events API ids. - When we find a duplicated event we merge it. Both ids keep working; see Merge History.
