Documentation

SmartStake Odds API

Pregame and live sportsbook odds in one schema. Pull the current board over REST and keep it current with a Server-Sent Events stream.

Plans and terms

Access needs a paid plan. Use of the API is subject to the Odds API Terms.

Overview

The SmartStake Odds API serves pregame and live odds from sportsbooks, exchanges and prediction markets in one schema.

  • REST returns the quotes on the board right now, for chosen events or a whole league.
  • The stream pushes every change to those quotes as it happens.
  • Same game parlays are priced at each book on request.
  • Closing odds give every book's last pregame price for events that have started, back to August 7, 2026.

How fast each book's prices reach you, pregame and live, is on the update frequency page.

Base URL:

https://api.server.smartstake.ca

Get a key

Choose a plan in the Odds API pricing, or from API keys in SmartStake, which lists the plans until you hold a key, and subscribe with a SmartStake account. Your key appears under API keys in SmartStake as soon as payment goes through: open the account menu, or Profile → API keys. Cancel or keep your plan from Manage Subscription (Managing your subscription).

Quick start

export SMARTSTAKE_API_KEY=your-key

# Events on the board for a league
curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/events?league=mlb"

# Current quotes for one event from two books
curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/odds?event_id=evt_01M3JFTX43BKN11ZN73APGWD2X&book=draftkings&book=fanduel"

# Stream changes for that event
curl -N --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/stream/baseball?event_id=evt_01M3JFTX43BKN11ZN73APGWD2X&book=draftkings&book=fanduel"

Authentication

Send your API key as a bearer token on every request:

Authorization: Bearer your-key

Clients that cannot set headers can pass key=your-key as a query parameter instead. Your key determines which books and leagues you can access and how many streams you can open. Keep it secret.

Compression

Every request must include Accept-Encoding: gzip. Requests without it return 406. Responses larger than 1 KB, league snapshot pages and streams are gzip-compressed.

Most HTTP clients send this header and decompress responses automatically. With curl, add --compressed.

Conventions

  • All endpoints use GET.
  • Successful responses have the shape { "data": ... }. Errors have the shape { "error": "..." }.
  • To pass several values for a parameter, repeat it (book=draftkings&book=fanduel) or separate the values with commas (book=draftkings,fanduel).
  • format sets the odds format: american (default) or decimal.
  • Times are ISO 8601 in UTC (starts_at) or epoch milliseconds (updated_at).

Keeping a local board

To hold a current copy of the board:

  1. Open the stream.
  2. Pull the current quotes over REST.
  3. Apply each stream event to your copy, keyed by quote_id. Keep the version with the newest updated_at.

Open the stream before you pull so that no change is missed between the two. When the stream drops, reconnect with the id of the last event you received (see Resuming a stream): you get every change you missed and do not need to pull again. Pull again only when the stream sends resync-required.

Reference data

EndpointParametersReturns
GET /v1/statusnoneReadiness, and the last update time for each book
GET /v1/sportsnoneSports with at least one event on the board
GET /v1/leaguessport (optional)Leagues with at least one event on the board
GET /v1/booksnoneBooks your key can access
GET /v1/eventssport, league (at least one)Events in start-time order
GET /v1/marketssport, league (at least one)Market keys and names
GET /v1/teamsleague (required)Teams in a league. See Teams and players.
GET /v1/playersleague (required), team_idPlayers in a league. See Teams and players.

An event has the fields id, sport, league, starts_at, home, away and live.

A sport or league with no events listed drops out of /v1/sports and /v1/leagues until its next event is posted. Your key still includes it. This happens between playoff rounds, for example, when the next game has not been scheduled yet.

Current odds

GET /v1/odds returns the quotes currently on the board. A quote that is not returned is suspended or no longer offered.

How quickly a price change at each book reaches you, pregame and live, is listed on Update frequency.

It works in two modes: by event, or a whole league (see League snapshots).

ParameterDescription
event_idRequired. 1 to 5 event ids.
bookRequired. 1 to 5 books.
marketMarket keys from /v1/markets.
alternatetrue for alternate lines only, false for main lines only.
livetrue for live quotes only, false for pregame only.
formatamerican (default) or decimal.
state, platformPoint bet_url at a region and device. See Bet links.
curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/odds?event_id=evt_01M3JFTX43BKN11ZN73APGWD2X&book=draftkings&format=decimal"

League snapshots

Call /v1/odds with one league and no event_id to get every quote in that league, in pages. book is optional; without it, every book your key can access is included.

Each page contains whole events in start-time order, about 25,000 quotes. Pass the returned next_cursor as cursor to get the next page. next_cursor is null on the last page.

{
  "league": "nfl",
  "event_ids": ["evt_01KZCTK537WSKW9Q44E178X194"],
  "next_cursor": "2026-10-02T00:15:00Z|evt_01KZCTK537WSKW9Q44E178X194",
  "data": [ ... ]
}

Snapshot pages count against a separate per-minute limit. A 429 or 503 response includes a Retry-After header; wait that many seconds and repeat the same request.

import gzip, json, os, time, urllib.error, urllib.parse, urllib.request

API = "https://api.server.smartstake.ca"
HEADERS = {
    "Authorization": f"Bearer {os.environ['SMARTSTAKE_API_KEY']}",
    "Accept-Encoding": "gzip",
}

def league_snapshot(league, books=()):
    cursor, quotes = None, []
    while True:
        query = [("league", league)] + [("book", book) for book in books]
        if cursor:
            query.append(("cursor", cursor))
        url = f"{API}/v1/odds?{urllib.parse.urlencode(query)}"
        try:
            with urllib.request.urlopen(urllib.request.Request(url, headers=HEADERS), timeout=120) as response:
                body = response.read()
                if response.headers.get("Content-Encoding") == "gzip":
                    body = gzip.decompress(body)
        except urllib.error.HTTPError as error:
            if error.code in (429, 503):
                time.sleep(int(error.headers.get("Retry-After", "5")))
                continue
            raise
        page = json.loads(body)
        quotes += page["data"]
        cursor = page["next_cursor"]
        if cursor is None:
            return quotes

quotes = league_snapshot("nfl")

Teams and players

GET /v1/teams and GET /v1/players list the teams and players in a league, with the same ids that quotes carry in team_id and player_id. Use them to label quotes or join them to your own data.

ParameterDescription
leagueRequired. One or more leagues.
team_id/v1/players only. Players on these teams only.
curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/players?league=nfl&team_id=9454"
{
  "data": [
    {
      "id": 42289,
      "name": "Alfred Collins",
      "team_id": 9454,
      "league": "nfl",
      "role": "player",
      "position": "DT"
    }
  ]
}

A team has the fields id, name, abbreviation and league. A player has the fields id, name, team_id, league, role and position. abbreviation, position and team_id are null where we do not have them. In individual sports such as tennis, each competitor is also listed as a team, because that is the id quotes carry in team_id.

The lists are refreshed every hour. A player listed in several leagues appears once in each.

Closing odds

Closing odds are each book's last pregame price before an event started: the closing line. Use them to measure closing line value, to backtest, or to see which books moved last.

They cover pregame quotes on every event that started on or after August 7, 2026, for every book, market and line, including player props and alternate lines. An event's closing odds are published on a 15 minute cycle and usually appear 30 to 50 minutes after it starts.

They are the same closes SmartStake uses for closing line value in the Bet Tracker.

Events with closing odds

GET /v1/closing-odds/events lists the events that started on one day.

ParameterDescription
dateRequired. The UTC day the events started, as YYYY-MM-DD. An evening game in North America often starts on the next UTC day.
sport, leagueOptional filters.
curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/closing-odds/events?date=2026-10-20&league=nfl"
{
  "data": [
    {
      "id": "evt_01M0EAWVYT4JS0R7FVXMK3CT9D",
      "sport": "football",
      "league": "nfl",
      "starts_at": "2026-10-20T00:15:00Z",
      "home": "san francisco 49ers",
      "away": "washington commanders",
      "home_team_id": 9454,
      "away_team_id": 9431,
      "home_team_logo_url": "https://www.smartstake.app/images/teamIcons/9454.webp",
      "away_team_logo_url": "https://www.smartstake.app/images/teamIcons/9431.webp",
      "quotes": 151853,
      "close_version": 1,
      "rules_version": 1
    }
  ]
}
FieldDescription
home_team_id, away_team_idIds of the home and away teams, as in /v1/teams. null where we do not have them.
home_team_logo_url, away_team_logo_urlTeam logos, where we have one. Always null in tennis and MMA.
quotesThe number of closing quotes for the event across all books.
close_versionGrows each time the event is closed again, after a late price or a moved start time. If you stored the event at a lower version, read its closing quotes again.
rules_versionThe close rules that judged the event's quotes, as on each closing quote.

Closing quotes

GET /v1/closing-odds returns the closing quotes for up to 10 events.

ParameterDescription
event_idRequired. 1 to 10 event ids.
bookBooks to include. Without it, every book your key can access is included.
marketMarket keys to include.
alternatetrue for alternate lines only, false for main lines only.
formatamerican (default) or decimal.
state, platformPoint bet_url at a region and device. See Bet links.

A major game can have more than 100,000 closing quotes across all books and markets. Filter by book and market when you can.

curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/closing-odds?event_id=evt_01M0EAWVYT4JS0R7FVXMK3CT9D&book=pinnacle&market=football_points_handicap&alternate=false"
{
  "data": [
    {
      "quote_id": "m~evt_01M0EAWVYT4JS0R7FVXMK3CT9D~football_points_handicap~none~none~-7.0~awayteam~pinnacle",
      "event_id": "evt_01M0EAWVYT4JS0R7FVXMK3CT9D",
      "sport": "football",
      "league": "nfl",
      "starts_at": "2026-10-20T00:15:00Z",
      "home": "san francisco 49ers",
      "away": "washington commanders",
      "home_team_id": 9454,
      "away_team_id": 9431,
      "book": "pinnacle",
      "market_name": "Spread",
      "market_key": "football_points_handicap",
      "label": "Washington Commanders +7",
      "participant": "Washington Commanders",
      "side": "awayteam",
      "line": 7.0,
      "odds": -103,
      "alternate": false,
      "player_id": null,
      "team_id": 9431,
      "bet_url": "https://www.pinnacle.ca/en/football/nfl/washington-commanders-vs-san-francisco-49ers/1637707533/#all",
      "max_bet": 100000.0,
      "book_event_id": "1637707533",
      "book_market_id": null,
      "book_selection_id": null,
      "book_player_id": null,
      "closed_at": 1792455168011,
      "close_state": "exact_on_board",
      "removal_label": null,
      "rules_version": 1,
      "removed_at": null,
      "opening_odds": 107,
      "opened_at": 1791774801864
    }
  ],
  "pending_event_ids": []
}

A closing quote has the fields of the quote object, without live and updated_at, plus:

FieldDescription
oddsThe closing price: the last price the book showed for this quote before the event started.
closed_atWhen that price was set, in epoch milliseconds. Only price changes are recorded, so this is when the price last changed, not when it was last seen. null when unknown.
close_stateHow the closing price stood at the start. See Close states.
removal_labelHow the book removed the quote, read from the shape of the removal. null if the book never removed it, unless it is below_size_floor. See Removal labels.
rules_versionThe close rules that judged this quote: 1 for events that started on or after November 16, 2026, 0 for earlier events.
removed_atWhen the book pulled the quote, if it did before the start, in epoch milliseconds. null otherwise.
opening_oddsThe earliest pregame price we recorded for this quote, in the requested format. null when unknown.
opened_atWhen we recorded that earliest price, in epoch milliseconds.

odds is always the last price the book actually offered. If a book pulled a line hours before the start, the quote is still returned, with the time it came down in removed_at and a close_state that says whether the line moved or the market went away. To measure against the closing line, keep the quotes with close_state exact_on_board.

Market and selection fields (market_name, label, participant, line, player_id, team_id and bet_url) can be null on some quotes. quote_id, book, market_key, side and the prices are always present.

Close states

close_stateMeaning
exact_on_boardThe price was on the board at the start. A quote pulled within a few minutes of the start, a short window set per book, still counts as on the board.
line_movedThe book pulled this line but still offered the same side on another line of the market at the start.
market_goneThe book pulled the market, or an exchange held too little at the price.
unknownThe record cannot tell, for example after a board reset, when the quote moved to another event, or when the price arrived after the start.
quiet_feedThe book sent nothing for the event for longer than its usual gap, so whether the price stood is unknown.

Removal labels

removal_labelMeaning
polled_expiryThe quote stopped appearing on the board of a book we poll.
polled_adapter_removalA book we poll removed the quote explicitly.
socket_removalA book that pushes changes to us removed the quote.
exchange_no_liquidityAn exchange removed the quote, with no liquidity left at the price.
below_size_floorThe quote was on an exchange's board at the start, but with less size at the price than the minimum we count. Its close_state is market_gone.
board_resetThe quote was removed when the board was rebuilt. See Board resets.
event_reboundThe quote moved to another event.
priced_after_startThe book removed the quote and priced it again after the event started.
unverifiedA removal on rules_version 0, recorded before the labels existed.

Rules version 0

Events that started before November 16, 2026 come from our earlier closing odds record and carry rules_version 0, with that record's prices, closing times and openers. Their close_state is exact_on_board, line_moved or market_gone, and a removed quote has removal_label unverified. On these events, a quote on the board when the board was rebuilt shortly before the start, and not posted again before the start, counts as pulled at the time of the rebuild.

Opening odds

A quote id includes the line, so opening_odds is the first price for that exact line, not the market's opening line. When a spread moves from -7.5 to -7, the -7 quote opens when the book first posted -7. On rules_version 1, recording starts on November 12, 2026, so a quote first priced before then shows its earliest price since then, not the book's real opener. On rules_version 0, recording starts on August 7, 2026, so openers for events in early August 2026 may be later than the book's real opener.

pending_event_ids lists the events in your request that have no closing odds yet: events that have not started, events that started less than about an hour ago, and ids we do not recognise.

Results

Results are final box scores: the final score, the score of each period, team stats and player stats. They use the same event, team and player ids as quotes, so you can settle your own bets against them, including player props.

A result is published once the game is final, usually within about 15 minutes. Most leagues go back to June 2026. A stat correction after the game updates the result and its updated_at.

Events with results

GET /v1/results/events lists the events with a final result that started on one day.

ParameterDescription
dateRequired. The UTC day the events started, as YYYY-MM-DD. An evening game in North America often starts on the next UTC day.
sport, leagueOptional filters.
curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/results/events?date=2026-10-26&league=nfl"
{
  "data": [
    {
      "event_id": "evt_01M0XS95W37JJYDBZ89Q60K1T1",
      "sport": "football",
      "league": "nfl",
      "starts_at": "2026-10-26T00:20:00Z",
      "home": "seattle seahawks",
      "away": "kansas city chiefs",
      "home_score": 20,
      "away_score": 3,
      "updated_at": 1793110716017
    }
  ]
}

Box scores

GET /v1/results returns the results for up to 10 events.

ParameterDescription
event_idRequired. 1 to 10 event ids.
curl --compressed -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  "https://api.server.smartstake.ca/v1/results?event_id=evt_01M0XS95W37JJYDBZ89Q60K1T1"
{
  "data": [
    {
      "event_id": "evt_01M0XS95W37JJYDBZ89Q60K1T1",
      "sport": "football",
      "league": "nfl",
      "starts_at": "2026-10-26T00:20:00Z",
      "status": "final",
      "home": "seattle seahawks",
      "away": "kansas city chiefs",
      "home_team_id": 9455,
      "away_team_id": 9445,
      "home_score": 20,
      "away_score": 3,
      "regulation_periods": 4,
      "periods": [
        { "period": 1, "home": { "points": 0, "fieldGoals": 0, "touchdowns": 0 }, "away": { "points": 0, "fieldGoals": 0, "touchdowns": 0 } }
      ],
      "team_stats": {
        "home": { "points": 20, "fieldGoals": 2, "touchdowns": 2 },
        "away": { "points": 3, "fieldGoals": 1, "touchdowns": 0 }
      },
      "players": [
        {
          "player_id": 42338,
          "name": "sam darnold",
          "side": "home",
          "inactive": false,
          "stats": { "passing.yards": 257, "passing.attempts": 28, "passing.completions": 20, "passing.touchdowns": 1, "passing.yards.p1": 0 }
        }
      ],
      "updated_at": 1793110716017
    }
  ]
}
FieldDescription
home_score, away_scoreThe final score, including overtime or extra innings.
regulation_periodsHow many periods regulation has. Periods after it are overtime or extra innings.
periodsEach period's stats for each side, in order.
team_statsGame totals for each side.
playersEvery player in the box score. side is home or away. player_id matches quotes and /v1/players, and is null when we have not matched the player yet.
inactivetrue for a player who did not play. Most books void a prop on an inactive player.
statsStat names depend on the sport. A suffix such as .p1 is that stat for one period.
updated_atWhen this result last changed, in epoch milliseconds.

An event that is not final yet, or an id we do not recognise, is left out of data.

Same game parlays

POST /v1/sgp/price prices a same game parlay at each book: the book's own correlated price for the legs together, read from the book when you ask. It answers in up to 15 seconds.

Send two to twelve quote_id values from one event. A quote_id from any book identifies the leg, so you can build the parlay from one book's quotes and price it everywhere.

FieldDescription
quote_idsRequired. 2 to 12 quote_id values from the same event, one per leg.
booksOptional. 1 to 20 books to price at. Every supported book your key includes when left out.

Supported books: DraftKings, FanDuel, BetMGM, bwin, Sports Interaction, Caesars, Fanatics, Betway, theScore, Novig, ProphetX, Sportzino, BetRivers, Bally Bet, Monopoly, LeoVegas, ProLine, NorthStar Bets, BetPlay, Desert Diamond, BetJack and Betinia NJ. bwin and Sports Interaction return BetMGM's price, which they carry.

Every plan includes same game parlays. Legs come from the leagues and books your key includes, and a live leg needs a plan with live odds. Each request counts against your REST rate limit.

curl --compressed -X POST -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"quote_ids": ["m~evt_01M4AA585EGWZ3A7NWEQANBZ2K~basketball_moneyline~none~none~0.0~hometeam~betmgm", "m~evt_01M4AA585EGWZ3A7NWEQANBZ2K~basketball_player_points~none~47051~6.5~over~betmgm"], "books": ["betmgm", "thescore", "betrivers"]}' \
  "https://api.server.smartstake.ca/v1/sgp/price"
{
  "data": {
    "event_id": "evt_01M4AA585EGWZ3A7NWEQANBZ2K",
    "legs": 2,
    "best": { "book": "betmgm", "status": "priced", "decimal_odds": 2.8, "american_odds": 180 },
    "books": [
      { "book": "betmgm", "status": "priced", "decimal_odds": 2.8, "american_odds": 180 },
      { "book": "thescore", "status": "priced", "decimal_odds": 2.34, "american_odds": 134 },
      { "book": "betrivers", "status": "leg_not_offered", "quote_ids": ["m~evt_01M4AA585EGWZ3A7NWEQANBZ2K~basketball_player_points~none~47051~6.5~over~betrivers"] }
    ]
  }
}

best is the longest price, or null when no book priced the parlay. Every book gets a result in books, and a book that cannot price the parlay is a result, not an error:

statusMeaning
pricedThe book priced the parlay. decimal_odds and american_odds are set.
rejectedThe book refuses this combination. reason carries the book's reason when it gives one.
leg_not_offeredThe book has no quote for a leg. quote_ids lists them.
leg_not_priceableThe book offers a leg but not in a same game parlay. quote_ids lists them.
leg_unavailableA leg is suspended or closed at the book. quote_ids lists them.
line_movedThe book's line on a leg moved since our quote. Pull current odds and try again.
book_unavailableThe book did not answer in time.

Novig and ProphetX prices are live quotes from market makers. Each request counts against your requests per minute.

Stream

GET /v1/stream/{sport} opens a Server-Sent Events stream of quote changes. sport is one of football, basketball, baseball, hockey, soccer, tennis or mma.

ParameterDescription
leagueLeagues to include.
event_idEvents to include.
bookBooks to include.
marketMarket keys to include.
alternatetrue for alternate lines only, false for main lines only.
livetrue for live quotes only, false for pregame only.
include_statustrue to receive event-status events.
include_box_scorestrue to receive box-score events with live team and player stats. Plans with live odds only.
formatamerican (default) or decimal.
state, platformPoint bet_url at a region and device. See Bet links.

Changes are sent in batches every 250 ms. A batch contains only the latest version of each quote. The stream is gzip-compressed and each batch is flushed as soon as it is written, so decompress it incrementally as bytes arrive.

Events

EventMeaning
connectedThe stream is open.
quoteOne or more quotes are new, changed or back on the board.
quote-removedOne or more quotes were suspended or pulled.
event-statusAn event's status, score, clock, period or start time changed. Sent only with include_status=true, and only when something changed.
box-scoreAn event's live team or player stats changed. Sent only with include_box_scores=true.
pingKeep-alive, sent after 25 seconds without other events.
reconnectThe server is restarting and the stream is closing. Reconnect at once with the last id; nothing is lost.
resync-requiredThe stream could not replay what you missed. Keep it open and pull current odds. See Resuming a stream.
board-resetThe board is being rebuilt and the stream is closing. See Board resets.
errorYour client read the stream too slowly and the stream is closing. See Slow clients.

quote and quote-removed carry { "type": "...", "quotes": [ ... ] }. Match removals to your board by quote_id. Some removals include only quote_id, event_id, book, market_key, side, line, live and updated_at.

event: connected
retry: 1000
data: ok

event: quote
id: 1.3f9a0c41b2de.AwAQAKDp...
data: {"type":"quote","quotes":[{"quote_id":"m~evt_01KZCTK5WDFG6R6TWYDZV61GV2~football_player_receptions~none~43576~1.5~over~caesars", ...}]}

event: quote-removed
id: 1.3f9a0c41b2de.AwAQAKDp...
data: {"type":"quote-removed","quotes":[{"quote_id":"m~evt_01KZCTK52NHV0W2Q2PCZVK6R3N~football_player_receptions~none~41593~9.5~under~fanduel", ...}]}

Event status and box scores

With include_status=true or include_box_scores=true, a new stream first sends the current status or box score of every game your filters cover, then an event each time one changes. Nothing is re-sent unless it changed.

Scores and clocks update about every 20 seconds and box scores about every 60 seconds while games are live.

event-status carries { "type": "event-status", "event": { ... } }:

{
  "event_id": "evt_01KZCTK5WDFG6R6TWYDZV61GV2",
  "sport": "football",
  "league": "ncaaf",
  "starts_at": "2026-11-14T17:00:00Z",
  "home": "iowa state cyclones",
  "away": "cincinnati bearcats",
  "status": "live",
  "period": "2nd Quarter",
  "clock": "05:13",
  "home_score": 28,
  "away_score": 7,
  "state": {
    "status": "live",
    "clock_running": true,
    "intermission": false,
    "period": 2,
    "period_type": "regulation",
    "period_label": "Q2",
    "final_type": null,
    "provider_status": "in"
  },
  "updated_at": 1794261369816
}
FieldValues
event_id, sport, league, starts_at, home, awaySame as on events. sport and league are lowercase.
statuslive, stopped (underway but paused), final, scheduled, postponed, suspended or cancelled. Kept for existing clients; read state.status instead.
periodThe data provider's own period text, such as 2nd Quarter, Halftime or Final (OT), or null. Read state.period and state.period_label instead.
clockGame clock text, or null.
home_score, away_scoreIntegers, or null before the start.
updated_atEpoch milliseconds of the update.
state.statusscheduled, live, final, postponed, suspended or cancelled. Use this to know where a game is.
state.clock_runningtrue while the game is live and play is on; false in a stoppage, an intermission or any status but live.
state.intermissiontrue during a break between periods: halftime, the end of a quarter or period, the middle or end of an inning.
state.periodInteger counting from 1, or null before the start. Overtime continues the count: an NBA first overtime is 5, soccer extra time is 3 and 4, penalties 5. Innings for baseball, sets for tennis, rounds for MMA.
state.period_typeregulation, overtime, shootout or null.
state.period_labelQ1–Q4 (quarters), H1/H2 (halves), P1–P3 (hockey periods), OT, 2OT, SO, ET1/ET2 and PEN (soccer), T5/B5/M5/E5 for the top, bottom, middle and end of an inning (I5 when the half is unknown), S1 (tennis sets), R1 (MMA rounds), or null.
state.final_typeHow a final game ended: regulation, overtime, shootout, or null until final.
state.provider_statusThe data provider's own status text, unchanged, or null. Its values differ by source; read state.status rather than this.

box-score events carry the same state object.

box-score carries { "type": "box-score", "event": { ... } }:

{
  "event_id": "evt_01M47ECTR9AXT05K513XEDJQ5R",
  "sport": "basketball",
  "league": "nba",
  "home": "atlanta hawks",
  "away": "los angeles lakers",
  "status": "Q1 5:57",
  "period": "Q1",
  "final": false,
  "home_score": 17,
  "away_score": 12,
  "team_stats": { "home": { "points": 17 }, "away": { "points": 12 } },
  "periods": [],
  "players": [
    { "player_id": 46727, "name": "dyson daniels", "team": "home", "inactive": false,
      "stats": { "assists": 2, "blocks": 0, "fieldGoalsAttempted": 1, "fieldGoalsMade": 1, "minutes": 5.98 } }
  ],
  "last_play": null,
  "updated_at": 1794261369816
}

player_id matches player_id on player prop quotes. Stat names depend on the sport. status is the data provider's own text; use final to know when a box score is complete.

Resuming a stream

Every event carries an id: your position in the stream after that event. Keep the last one you received. When the stream drops for any reason, reconnect with it in the Last-Event-ID header (browsers' EventSource does this for you), or as last_event_id=... for clients that cannot set headers:

curl --compressed -N \
  -H "Authorization: Bearer $SMARTSTAKE_API_KEY" \
  -H "Last-Event-ID: 1.3f9a0c41b2de.AwAQAKDp..." \
  "https://api.server.smartstake.ca/v1/stream/basketball?league=nba"

The stream first sends the latest version of every quote that changed while you were away, then carries on live. An id works on any of our servers, so this also covers our own restarts: before a server restarts it sends reconnect and closes, and reconnecting straight away with the last id loses nothing.

A quote can arrive twice across a reconnect. Apply quotes by quote_id and keep the newest updated_at, as you would anyway.

We keep about the last 10 minutes of changes. If your id is older than that, comes from before a board reset, or the gap is too large to replay, you receive resync-required instead:

event: resync-required
data: {"type":"resync-required","reason":"cursor_too_old","message":"..."}

Keep the stream open and pull current odds over REST. Quotes on the stream are newer than anything you held.

Slow clients

The stream only sends as fast as your client reads. If your client reads too slowly, updates wait on our side and age. When the oldest unsent update has waited more than 10 seconds, you receive an error event and the stream closes, rather than keep delivering stale prices:

event: error
data: {"error":"Your client read this stream too slowly: ...","reason":"client_too_slow","waited_seconds":12,"limit_seconds":10,"docs":"https://www.smartstake.app/api#slow-clients"}

To avoid it:

  • Read the stream on its own thread or process and hand events to a queue. Do slow work, such as database writes or model runs, outside the read loop.
  • Batch your writes rather than writing once per quote.
  • Filter the stream to the leagues, books and markets you use.
  • Compare each quote's updated_at with your own clock to see when your client is falling behind.

After an error, reconnect with the last id. The replay can be large, so fix the slow reader first.

Example: recording the stream

The API serves the current board and its changes, not historical odds. This script records a stream to a JSON Lines file, one line per event with the time it was received, and reconnects automatically, resuming from the last event it received. It uses only the Python standard library.

import codecs, json, os, sys, time, urllib.request, zlib

API = "https://api.server.smartstake.ca"
SPORT = sys.argv[1] if len(sys.argv) > 1 else "football"
QUERY = "book=draftkings&book=fanduel&format=decimal"
OUTPUT = f"quotes_{SPORT}_{time.strftime('%Y%m%d')}.jsonl"

def stream_lines(response):
    inflater = zlib.decompressobj(16 + zlib.MAX_WBITS)
    decoder = codecs.getincrementaldecoder("utf-8")()
    pending = ""
    while chunk := response.read1(65536):
        pending += decoder.decode(inflater.decompress(chunk))
        *lines, pending = pending.split("\n")
        yield from lines

last_event_id = None

def record(output):
    global last_event_id
    headers = {
        "Authorization": f"Bearer {os.environ['SMARTSTAKE_API_KEY']}",
        "Accept-Encoding": "gzip",
    }
    if last_event_id:
        headers["Last-Event-ID"] = last_event_id
    request = urllib.request.Request(f"{API}/v1/stream/{SPORT}?{QUERY}", headers=headers)
    event = None
    with urllib.request.urlopen(request, timeout=90) as response:
        for line in stream_lines(response):
            if line.startswith("event: "):
                event = line[len("event: "):]
            elif line.startswith("id: "):
                last_event_id = line[len("id: "):]
            elif line.startswith("data: ") and event in ("quote", "quote-removed", "board-reset", "resync-required"):
                output.write(json.dumps({
                    "received_ms": int(time.time() * 1000),
                    "event": event,
                    "payload": json.loads(line[len("data: "):]),
                }) + "\n")
                output.flush()

with open(OUTPUT, "a") as output:
    delay = 1
    while True:
        try:
            record(output)
            delay = 1
        except Exception as error:
            print("reconnecting after", error, file=sys.stderr)
            time.sleep(delay)
            delay = min(delay * 2, 60)
        else:
            time.sleep(1)

Run one process per sport, for example python record_stream.py basketball.

The quote object

{
  "quote_id": "m~evt_01KZCTK5WDFG6R6TWYDZV61GV2~football_player_receptions~none~43576~1.5~over~caesars",
  "event_id": "evt_01KZCTK5WDFG6R6TWYDZV61GV2",
  "sport": "football",
  "league": "nfl",
  "starts_at": "2026-10-04T17:00:00Z",
  "home": "tampa bay buccaneers",
  "away": "green bay packers",
  "home_team_id": 9451,
  "away_team_id": 9438,
  "book": "caesars",
  "market_name": "Player Receptions",
  "market_key": "football_player_receptions",
  "label": "Cade Otton Over 1.5",
  "participant": "Cade Otton",
  "side": "over",
  "line": 1.5,
  "odds": -530,
  "alternate": true,
  "live": false,
  "player_id": 43576,
  "team_id": null,
  "bet_url": null,
  "max_bet": null,
  "book_event_id": null,
  "book_market_id": null,
  "book_selection_id": null,
  "book_player_id": null,
  "updated_at": 1790787140829
}
FieldDescription
quote_idStable id for one book's price on one side of one line. See Quote ids.
event_idThe event.
sport, leagueThe event's sport and league.
starts_atScheduled start time.
home, awayTeam or competitor names.
home_team_id, away_team_idIds of the home and away teams, as in /v1/teams. null where we do not have them.
bookThe book offering the price.
market_name, market_keyDisplay name and stable key of the market.
labelReadable description of the selection.
participantPlayer or team the selection refers to, if any.
sideOne of hometeam, awayteam, over, under, draw, yes, no, even, odd.
lineThis side's line. null for moneylines and yes/no markets.
oddsThe price, in American or decimal format.
alternatetrue for alternate lines.
livetrue for in-play quotes.
player_id, team_idIds of the player or team the market is about, if any. A club has one team_id in every competition it plays in.
bet_urlLink to the selection on the book's site, where available and enabled for your key. See Bet links.
max_betThe largest stake the book accepts, where the book publishes it.
book_event_id, book_market_id, book_selection_id, book_player_idThe book's own ids for the event, market, selection and player, as the book publishes them. null where the book has none.
updated_atWhen this price last changed, in epoch milliseconds.

Exchange and prediction market prices are what it costs to take the price, net of the venue's fee: Kalshi, Polymarket and Polymarket US prices include the taker fee, and ProphetX prices are net of its commission on winnings. Novig pregame prices carry no fee.

Many books run a different site in each state or province, and some open a bet slip in their app through a separate link. Pass where your user is and what they are on, and bet_url comes back ready to open:

ParameterDescription
stateTwo-letter state or province code, such as NJ or ON.
platformdesktop (default) or mobile. mobile returns the app link for books that have one.

Both work on /v1/odds and on streams. Without them, bet_url is the link as we collected it. An unrecognised value returns 400.

curl --compressed -H "Authorization: Bearer YOUR_KEY" \
  "https://api.server.smartstake.ca/v1/odds?event_id=evt_01M3JFTX43BKN11ZN73APGWD2X&book=fanduel&state=NJ&platform=mobile"
Bookstateplatform=mobile
betmgmState siteApp link
fanduelState siteApp link
draftkingsApp link
novigApp link
prophetxApp link
thescoreApp link (United States)
hard_rock, hardrock_onOntario siteOntario app link
bet365State or province site
betriversState site
caesarsState site (desktop only)
bally_bet, bet99, bwin, pinnacleCanadian or international site

For every other book, and where a book has no site in the state you pass, bet_url is returned unchanged. A link opens the selection on the book; whether the user can bet there is still up to the book.

Quote ids

A quote_id is made of segments separated by ~:

m ~ event ~ market_key ~ team ~ player ~ line ~ side ~ book

Removing the last two segments (side and book) gives an id shared by every book's quotes on both sides of the same line. Use it to group quotes and to find the opposite side (over and under, hometeam and awayteam, yes and no). Spread lines are written from the home side in the id, so both sides of a spread share it.

The team segment of a team market, such as a team total, is the team_id. When we find that two team ids are the same club and merge them, the quotes on that team's markets carry the surviving team_id, so their quote_id changes.

Board resets

Occasionally the odds board is rebuilt. When a rebuild starts:

  • Every open stream receives board-reset with "phase": "started" and closes.
  • Every endpoint except /v1/status returns 503 with a Retry-After header, and /v1/status reports board_reset_in_progress: true.

Discard every quote you hold. When requests succeed again, reconnect and pull. The board fills back in as books publish prices, so it can be incomplete for a few minutes after a reset.

Limits

Default limits for each key:

LimitValue
Open stream connections7
Requests per minute120
League snapshot pages per minute10
Events and books per /v1/odds request5 each
Events per /v1/closing-odds request10
Events per /v1/results request10
Time an update can wait for a slow client10 seconds

Per-minute limits reset at the start of each minute. A Hobby key covers the five books and five leagues picked at checkout; /v1/books lists the books. It works while the account holds SmartStake Premium and is paused while it does not. Contact us to change your key's limits, books or leagues.

Errors

StatusMeaningWhat to do
400A parameter is missing or invalid.Fix the request.
401The API key is missing or unknown.Check your key.
403A requested book or league is not included in your key.Remove it, or contact us.
404Unknown endpoint or sport.Check the path.
406The request did not include Accept-Encoding: gzip.Add the header.
429A request, snapshot or stream limit was exceeded.Wait for Retry-After seconds.
502The odds board, closing odds, results, or teams and players are briefly unavailable.Retry with backoff.
503A board reset is in progress, snapshot capacity is busy, or same game parlay pricing is unavailable.Wait for Retry-After seconds.