Show bookmakers' odds side by side
An odds comparison site or app shows each bookmaker's price for a match side by side, often with a link to place the bet. It needs the program, the same markets named the same way at every bookmaker, and to drop a price as soon as it is gone.
How it reads the feed
- Scope
tournamentsBuild the program from the tournaments, leagues and matches scopes: countries, their leagues and their matches with kick-off times, each level with counts of what has odds right now.
- Scope
oddsAsk the odds scope for the matches on your screen. Every bookmaker's markets use one type_id table, so a column is the same market at every bookmaker.
- Scope
oddsUse nav to link a price to the bookmaker's bet slip, where the bookmaker sends its own ids.
Ask again on a timer and redraw from the answer: a price that is no longer in it has been suspended or closed.
What to watch for
- A price the bookmaker suspends or closes leaves the feed instead of showing 0. A price missing from an answer is not on offer: never keep the last one you saw.
- nav carries the bookmaker's own ids for a link to its bet slip. Its keys differ per bookmaker, and some bookmakers send none.
- Kick-off and every other time in the feed is UTC: show it in your visitor's time zone.
Your first request
The odds of two matches at every bookmaker your key carries. The match ids come from the matches scope. Put your own key in place of ofk_your_api_key. Every scope and field in the documentation
curl -X POST https://oddfeeds.com/api/v1/feeds \
-H "Authorization: Bearer ofk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"scope":"odds","match_ids":[13264298,13264221]}'const res = await fetch('https://oddfeeds.com/api/v1/feeds', {
method: 'POST',
headers: {
'Authorization': 'Bearer ofk_your_api_key',
'Content-Type': 'application/json',
},
body: JSON.stringify({"scope":"odds","match_ids":[13264298,13264221]}),
});
const feed = await res.json();import requests
res = requests.post(
'https://oddfeeds.com/api/v1/feeds',
headers={'Authorization': 'Bearer ofk_your_api_key'},
json={"scope":"odds","match_ids":[13264298,13264221]},
timeout=20,
)
feed = res.json()Build it on live data
Start with a free API key: every bookmaker, PreMatch and InPlay, on live production data.