> ## Documentation Index
> Fetch the complete documentation index at: https://oddspapi-v4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Odds Freshness in OddsPapi v4: Stale Prices and True Delay

> How to tell a fresh price from a stale one in the OddsPapi v4 odds API: bookmakerIsActive, the three active flags, changedAt and bookmakerChangedAt, and how to measure the true delay per bookmaker yourself.

Every price in the v4 API tells you whether you can still rely on it and how old it is. This page explains the fields and shows how to measure the delay yourself.

Many odds APIs return a single "last updated" time, which only says when the provider last looked. v4 also returns the time the bookmaker itself changed the price, and a flag for bookmakers we cannot refresh. So you can check our speed instead of taking our word for it.

## Can I rely on this price?

Three flags answer that. They sit on three levels of the [odds response](https://oddspapi-v4.mintlify.site/en/docs/get-odds.md).

| Level | Field | `false` means |
| - | - | - |
| Bookmaker | `bookmakerIsActive` | We cannot refresh this bookmaker for this fixture right now. Its prices may be out of date. |
| Market | `marketActive` | The market is suspended or no longer offered. |
| Price | `active` | The selection is suspended or no longer offered. |

A price is usable only when all three are `true`. The bookmaker object also has `suspended`, which is `true` when the bookmaker has suspended all its markets for the fixture.

```python theme={null}
def usable(bookmaker, market, price):
    return (
        bookmaker["bookmakerIsActive"]
        and not bookmaker["suspended"]
        and market["marketActive"]
        and price["active"]
    )
```

### What `bookmakerIsActive` tells you

* `true`: we are still collecting this bookmaker for the fixture. A price with an old timestamp is not stale. It has not moved since then.
* `false`: we cannot refresh the bookmaker right now. The last known prices are still returned, but do not rely on them.

> [!NOTE]
>
> An old `changedAt` alone does not mean a price is stale. Timestamps move only when a price changes, so a quiet pre-game market can show a time from hours ago and still be correct.

## How old is this price?

Each price carries two timestamps.

| Field | Clock | Meaning |
| - | - | - |
| `bookmakerChangedAt` | The bookmaker's | When the bookmaker itself says the price last changed. `null` when the bookmaker does not publish a timestamp. |
| `changedAt` | Ours | When we recorded that change. |

Both are ISO 8601 in UTC. The difference between the two is the **collection delay**: how long a price change needed to travel from the bookmaker into our data.

```
collection delay = changedAt - bookmakerChangedAt
```

> [!WARNING]
>
> The top-level `updatedAt` in the odds response is not a price timestamp. It is the last change to the fixture record itself, for example a new start time.

## Measure the delay yourself

This example prints the median collection delay per bookmaker for one fixture.

```python theme={null}
import requests
from datetime import datetime
from statistics import median

API_KEY = "YOUR_API_KEY"
FIXTURE_ID = "YOUR_FIXTURE_ID"

def ts(value):
    return datetime.fromisoformat(value.replace("Z", "+00:00"))

r = requests.get(
    "https://api.oddspapi.io/v4/odds",
    params={"apiKey": API_KEY, "fixtureId": FIXTURE_ID},
    timeout=10,
)
r.raise_for_status()

for slug, bookmaker in r.json()["bookmakerOdds"].items():
    if not bookmaker["bookmakerIsActive"]:
        print(f"{slug}: not active, skip")
        continue
    delays = []
    for market in bookmaker["markets"].values():
        for outcome in market["outcomes"].values():
            for price in outcome["players"].values():
                if price["active"] and price["bookmakerChangedAt"]:
                    delta = ts(price["changedAt"]) - ts(price["bookmakerChangedAt"])
                    delays.append(delta.total_seconds())
    if delays:
        print(f"{slug}: median {median(delays):.2f} s over {len(delays)} prices")
    else:
        print(f"{slug}: no bookmaker timestamp")
```

Keep in mind:

* One call is a small sample. Collect values over many fixtures before you judge a bookmaker.
* Live prices are collected faster than pre-game prices, and main markets faster than the rest.
* A bookmaker's clock can be slightly off, so single values can be a few hundred milliseconds out or even negative.
* Where `bookmakerChangedAt` is `null`, the delay cannot be calculated from the response.

## Delay per bookmaker

The [bookmakers page](https://oddspapi-v4.mintlify.site/en/docs/get-bookmakers.md#popular-bookmakers-in-the-uk-and-ireland) lists the delay of well-known bookmakers for live, pre-game main lines and other pre-game markets. The figures for every bookmaker are on the [latency page](https://oddspapi.io/en/coverage/latency), which can be downloaded as CSV.

* A **clone** (a bookmaker with `cloneOf` set in [`/v4/bookmakers`](https://oddspapi-v4.mintlify.site/en/docs/get-bookmakers)) has the same prices and the same delay as its parent.
* On self-serve plans **Pinnacle** is available as `pinnacle+30`, with a 30 second delay.

## What you see in your app

With a REST API your own polling comes on top of the collection delay:

```
age of a price in your app = collection delay + time since your last call
```

The fastest endpoints, [`/v4/odds`](https://oddspapi-v4.mintlify.site/en/docs/get-odds) and [`/v4/fixture`](https://oddspapi-v4.mintlify.site/en/docs/get-fixture), allow one call every 0.5 seconds per key. If you poll a fixture every 5 seconds, a change is on average 2.5 seconds old when you see it, plus the collection delay.

Every plan gets the same prices at the same collection speed. If you need changes pushed to you, that is what [the v5 API](https://oddspapi-v4.mintlify.site/en/docs/v4-vs-v5.md) is for.

If prices look wrong while all flags are `true`, send us the `fixtureId`, the bookmaker, the market and outcome IDs and the UTC time. See [how to reach support](https://oddspapi-v4.mintlify.site/en/docs/faq.md#how-do-i-reach-support).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.