How fresh a price is
The timestamps each reply carries and how to work out a price's age.
Reply time
meta.processed_at, and the X-Processed-At header, are the reply's time. X-OddsRelay-Version says which version of the data you were served, the same on every route for one publish.
When each bookmaker was last read
On the matched products, meta.last_seen is {bookmaker key: {sport group: ISO time}}: the last time each bookmaker and sport was read, the oldest reading behind the reply. Now minus last_ is the most that bookmaker's prices can have aged. It is keyed by the sport's key base (soccer, horse_, american_), not an event's full sport_: take the group /v2/sports gives each sport key (American Football) and write it lowercase with underscores. A filtered reply's table is cut to the bookmakers and sports it returns.
Keyed /v2/coverage carries the same last_ per bookmaker and sport, with event counts.
last_ counts the reads of a bookmaker's markets beyond match odds as well. Further from kick-off, prices in the other markets can be older. A bookmaker serving markets far from kick-off can therefore show an older last_. William Hill's prices can be older than its last_ says.
// groupOf: {sport_key: key base}, built once from GET /v2/sports rows: base = group.toLowerCase().replace(/[^a-z0-9]+/g, "_")
const seen = meta.last_seen[offer.bookmaker]?.[groupOf[event.sport_key]];
const ageSeconds = seen ? (Date.now() - Date.parse(seen)) / 1000 : null;Raw's last_ update
On raw, each market's last_ is when that bookmaker's market last changed: a price, a lay price or available moved, or a row appeared. A service restart can move it once with nothing changed, so dedupe on content. It is not a heartbeat: a quiet market's last_ ages while the bookmaker is still read.
What is left out for age
The API drops no pre-match row for age. A bookmaker whose latest read is older than its own window, at most two minutes, is left out until it is read again.
An in-play price is served only while it was read in the last 10 seconds: In-play prices covers the rest.
From the blog
- The anatomy of an odds API responseEvery field in a /v2 odds response, from the meta envelope down to each back and lay offer.
- How odds feeds handle suspended and void marketsHow feeds mark a suspended or void market, and what your code should do when a price disappears.
- How to display odds data in your appTurn a nested odds response into table rows, format prices and show each price's age.
Every parameter: API reference.