ASD Platform
Odds & Markets API

Odds & Markets API

Polling and change detection

How to poll the Odds & Markets API, detect price and status changes, notice a stale feed, and what the REST feed cannot tell you.

The Odds & Markets API is REST only. There is no push feed in the public docs, no sequence numbers, no heartbeat, and no change or replay endpoint. Your client asks for the current state and works out what changed. This page gives you a polling plan that respects the feed, a change-detection method built on the fields the API already returns, and a plain list of what you cannot detect today.

For push delivery, ask your ALT Sports Data account team.

What the responses give you

SignalWhereUse it for
updatedAtEvery odds row (for example each eventWinner row) and every listed eventThe last time the price or event changed. Compare it with the value you stored.
eventStatusEventsUPCOMING, LIVE, NEXT, IN_WINDOW, COMPLETED, CANCELLED, POSTPONED. Decides how often you poll an event.
statusMarket rowsOPEN, SUSPENDED, CLOSED, COMPLETED, VOID. Decides whether you accept bets.
settlementMarket rowsNOT_SET until settled. Decides when you pay out.
ETag headerEvery responseA weak validator, for example etag: W/"78-…". Send it back as If-None-Match; a 304 means nothing changed.

Responses carry no Cache-Control header and no rate-limit headers, so the API does not tell you how often to poll. Ask your account team for the rate your contract allows, and keep the plan below inside it.

A polling plan

List events once every few minutes

Call GET /events for the competitions you carry with eventStatus[] repeated once per value you want, for example eventStatus[]=LIVE&eventStatus[]=UPCOMING. Send it in the array form; a plain eventStatus=UPCOMING has returned 400. Check eventStatus on each returned event rather than trusting the filter alone. Store id, eventStatus and updatedAt per event.

Poll markets by event status

Poll GET /events/{eventId}/{oddType} (and the league odds routes for GSOC, MLTT, NLL and jai alai) most often for events that are LIVE. Poll UPCOMING events less often, and raise the rate as startDate approaches. Stop polling an event once every market you carry on it reports a settlement other than NOT_SET, or once the event is COMPLETED, CANCELLED or POSTPONED and you have recorded that state.

Send the ETag on every poll

Store the ETag from each response and send it back as If-None-Match on every poll of the same URL. The API honours conditional requests: when the ETag still matches, it answers 304 Not Modified with an empty body, so nothing changed and there is nothing to parse. Keep your last copy and poll again later. When you receive 200, the body carries new state; process it and store the new ETag. (Verified on 2026-10-09 against the live API, which returned 304 for a matching weak ETag such as W/"b0-…".)

Back off on errors

On a 5xx, a timeout, or any status you do not expect, wait before the next attempt and double the wait on each repeat, up to a ceiling you choose. Do not retry in a tight loop. A 403 means the key, so stop and fix the key rather than retrying. A 404 on a markets route means the event has no odds for that oddType; check supportedMarkets on GET /sports before polling it again.

Detecting a change

Compare what came back with what you stored, keyed on the IDs the API gives you.

  • Prices. Key each outcome by outcomeId. When updatedAt on a row is later than the value you stored for that outcomeId, the price changed; read odds and probability again. Rows whose updatedAt did not move can be skipped.
  • Market status. Record status per outcomeId (or per marketId on team-sport sub-markets) and act on transitions: OPEN to SUSPENDED means stop accepting bets now; SUSPENDED to OPEN means you may resume; anything to CLOSED, COMPLETED or VOID means the market will not reopen. Accept bets only while status is OPEN.
  • Settlement. settlement moves from NOT_SET to a final value. Settle from that field, not from your own reading of results. Some markets use a different settlement vocabulary; see Markets and money lines.
  • Events. Watch eventStatus on the listing. An event that moves to POSTPONED or CANCELLED should have its markets suspended on your side at once, whatever the market rows said on the last poll.
  • New and vanished rows. An outcomeId you have not seen is a new selection. An outcomeId that stops appearing should be treated as closed until it reappears.

Detecting a stale feed

Nothing in the API tells you the feed itself is unhealthy, so infer it from what you observe.

ObservationTreat it as
updatedAt has not moved on any row of a LIVE event across several polls, while the event is clearly in playFeed stale for that event. Suspend your own markets on it.
Repeated 5xx responsesFeed down. Suspend your own markets and keep backing off.
Repeated timeoutsFeed down. Same response as repeated 5xx.
GET /events succeeds but a LIVE event's markets return 404 after they were availableMarkets withdrawn. Suspend and poll the event listing until the state is clear.

Choose the "several polls" threshold to fit the sport. A heat that lasts half an hour will update far less often than a lap-by-lap race.

Suspend first, ask later

When you cannot tell whether a price is current, suspend your market. A stale OPEN price is the costliest state to be in. Resume when updatedAt moves again or the feed answers normally.

What you cannot detect today

  • Bet-stop ordering. With no sequence numbers and no push channel, you cannot tell whether a suspension was issued before or after a price you read. Two rows polled in the same response reflect the same moment; rows from different polls do not.
  • A history of changes. There is no history endpoint. The API returns the current state only. If you need to reconstruct what the price was at a given time, keep your own snapshots of every poll.
  • Missed states. A market that went OPEN to SUSPENDED to OPEN between two of your polls looks unchanged, apart from updatedAt. A later updatedAt with the same price and status means something changed that you did not see.
  • Feed health. There is no heartbeat. Use the stale-feed rules above.

For push delivery, ask your ALT Sports Data account team.

Example: print what changed

This script polls one market for one event, stores the last-seen updatedAt per outcomeId, and prints each outcome whose price, status or settlement changed. It sends If-None-Match on every poll and skips parsing on 304, handles the response envelope (data when present), and backs off on errors. Rows for a flat market such as eventWinner live under the oddType key of the response.

import os
import time

import httpx

BASE_URL = "https://api.altsportsdata.com/api/v1/public"
HEADERS = {"X-API-Key": os.environ["ALTSPORTSDATA_API_KEY"]}

EVENT_ID = os.environ["EVENT_ID"]          # an id from GET /events
ODD_TYPE = os.environ.get("ODD_TYPE", "eventWinner")
INTERVAL = int(os.environ.get("POLL_SECONDS", "30"))

seen: dict[str, dict] = {}   # outcomeId -> last row we processed
etag: str | None = None
backoff = INTERVAL


def rows_from(body: dict | list) -> list[dict]:
    payload = body["data"] if isinstance(body, dict) and "data" in body else body
    if isinstance(payload, dict):
        payload = payload.get(ODD_TYPE) or []
    return payload if isinstance(payload, list) else []


while True:
    headers = dict(HEADERS)
    if etag:
        headers["If-None-Match"] = etag
    try:
        resp = httpx.get(f"{BASE_URL}/events/{EVENT_ID}/{ODD_TYPE}", headers=headers, timeout=20)
    except httpx.HTTPError as exc:
        print(f"request failed: {exc}; backing off {backoff}s")
        time.sleep(backoff)
        backoff = min(backoff * 2, 600)
        continue

    if resp.status_code == 304:
        print("304: nothing changed")
        time.sleep(INTERVAL)
        continue
    if resp.status_code >= 500:
        print(f"{resp.status_code}: backing off {backoff}s")
        time.sleep(backoff)
        backoff = min(backoff * 2, 600)
        continue
    if resp.status_code != 200:
        print(f"{resp.status_code}: {resp.text[:200]}")
        break

    backoff = INTERVAL
    etag = resp.headers.get("etag")

    rows = rows_from(resp.json())
    for row in rows:
        oid = row["outcomeId"]
        prev = seen.get(oid)
        if prev is None:
            print(f"new   {oid} odds={row.get('odds')} status={row.get('status')}")
        elif row.get("updatedAt") != prev.get("updatedAt") or row.get("status") != prev.get("status") \
                or row.get("settlement") != prev.get("settlement"):
            print(
                f"change {oid} odds {prev.get('odds')}->{row.get('odds')} "
                f"status {prev.get('status')}->{row.get('status')} "
                f"settlement {prev.get('settlement')}->{row.get('settlement')} "
                f"updatedAt {row.get('updatedAt')}"
            )
        seen[oid] = row

    gone = set(seen) - {r["outcomeId"] for r in rows}
    for oid in gone:
        print(f"gone  {oid} (treat as closed)")
        seen.pop(oid, None)

    time.sleep(INTERVAL)

Keep every response you receive if you need a history: the API will not give it back to you later.

On this page