BestBookAPI Get a key

BestBook API

Every book's live odds, in one feed.

Prices from 22 sportsbooks and 5 exchanges, matched line by line and pushed to you as they move. It is the same data that runs BestBook.

Get an API key $22 a month · one plan, everything included
  • 27 books and exchanges
  • 5 leagues
  • 46 market types
  • REST + WebSocket
wss://api.bestbook.app/v1/stream
// one book moved one price on one line
{
  "type": "update",
  "seq": 48213,
  "prices": [{
    "line": "nfl:2026-11-29-ATL-MIN/total/full/-/44.5",
    "book": "dk",
    "side": "yes",
    "american": -112,
    "decimal": 1.8929,
    "prob": 0.5283,
    "since": 1795899350412
  }]
}

Lines already matched

Each book names the same bet its own way. Here DraftKings' "Over 249.5 passing yards" and Kalshi's "250+ yards" arrive as one line with one id, each book's price beside the others.

Pushed, not polled

Open one WebSocket, subscribe to a league or a game, and get a snapshot followed by every change: a book's new price, a line added, a line taken down. About twice a second while prices move.

Exchanges included

Kalshi, Polymarket, Novig and ProphetX come as the price you can actually take, with the size available at it and the fee, next to the sportsbooks.

Game lines and player props

Moneyline, spread, total and team totals by period, plus the player markets people bet: yards, receptions, touchdowns, points, rebounds, assists, shots, saves and more.

Books and exchanges

22 sportsbooks and 5 exchanges today, each with the id it has in the feed. New ones appear as BestBook adds them; you do nothing.

Quick start

  1. Get a key

    Subscribe with your BestBook account, then press Create key, right here on this page. The key is shown once; BestBook keeps only a hash of it. Replacing it stops the old one.

  2. Ask for something

    Send the key as a bearer token (an X-API-Key header works too). Browsers can call it directly; keep your key out of any page other people can load.

    curl -H "Authorization: Bearer $BESTBOOK_KEY" \
      "https://api.bestbook.app/v1/events?league=nfl"
  3. Stream it

    A browser cannot set headers on a WebSocket, so the key can also go in the address.

    const ws = new WebSocket("wss://api.bestbook.app/v1/stream?key=" + KEY);
    const lines = new Map();
    
    ws.onopen = () => ws.send(JSON.stringify({ op: "subscribe", id: "nfl", league: "nfl" }));
    
    ws.onmessage = e => {
      const m = JSON.parse(e.data);
      if (m.type === "resync") lines.clear();   // rare: everything is sent again
      for (const id of m.removed ?? []) lines.delete(id);
      for (const l of m.lines ?? []) lines.set(l.id, l);
      for (const p of m.prices ?? []) {
        const l = lines.get(p.line);
        if (!l) continue;
        l.prices = l.prices.filter(x => x.book !== p.book || x.side !== p.side).concat(p);
      }
      for (const p of m.removed_prices ?? []) {
        const l = lines.get(p.line);
        if (l) l.prices = l.prices.filter(x => x.book !== p.book || x.side !== p.side);
      }
    };

    That is a complete client: lines always holds every NFL line with each book's current price.

REST

Base address https://api.bestbook.app. Every answer is JSON, and an error is {"error": "…"}. Use REST to load what exists; use the socket to stay current.

RequestAnswers
GET /v1/booksEvery sportsbook and exchange: id, name, kind.
GET /v1/leaguesThe leagues with games on the board and how many.
GET /v1/market-typesEvery market type: id, name, the leagues it applies to.
GET /v1/events?league=nflGames with prices: id, league, date, start (the start time, ISO 8601 in UTC; null until it is known, and it can move when the schedule does), away, home, how many lines. Leave league out for all of them. date is the game's day in the United States, so it can differ from the UTC date of start.
GET /v1/events/{id}/linesOne game's lines, each with its prices. Narrow with ?types=spread,total and ?books=dk,fd (comma-separated, ids exactly as listed): with books, only lines those books price come back, with only their prices.

A line

A line is one bet that can settle one way: a market type, a period, a team or player, and a number. Its prices hold one entry per book and side.

GET /v1/events/nfl:2026-11-29-ATL-MIN/lines?types=player_pass_yds&books=dk,kalshi
{
  "seq": 48213,
  "live": true,
  "event": { "id": "nfl:2026-11-29-ATL-MIN", "league": "nfl", "date": "2026-11-29", "start": "2026-11-29T18:00:00Z",
             "away": { "id": "ATL", "name": "Atlanta Falcons" },
             "home": { "id": "MIN", "name": "Minnesota Vikings" } },
  "lines": [{
    "id": "nfl:2026-11-29-ATL-MIN/player_pass_yds/full/jj mccarthy/224.5",
    "event": "nfl:2026-11-29-ATL-MIN",
    "type": "player_pass_yds",
    "period": "full",
    "team": null,
    "player": { "id": "jj mccarthy", "name": "J.J. McCarthy", "team": "MIN" },
    "line": 224.5,
    "outcomes": [{ "side": "yes", "name": "Over 224.5" }, { "side": "no", "name": "Under 224.5" }],
    "prices": [
      { "line": "…/224.5", "book": "dk", "side": "yes", "american": -114, "decimal": 1.8772, "prob": 0.5327,
        "fee": null, "size": null, "book_ts": null, "since": 1795898112004 },
      { "line": "…/224.5", "book": "dk", "side": "no", "american": -110, "decimal": 1.9091, "prob": 0.5238,
        "fee": null, "size": null, "book_ts": null, "since": 1795898112004 },
      { "line": "…/224.5", "book": "kalshi", "side": "yes", "american": -108, "decimal": 1.9231, "prob": 0.52,
        "fee": 0.0175, "size": 412, "book_ts": 1795899349120, "since": 1795899349120 }
    ]
  }]
}
FieldMeaning
typeThe market type, from /v1/market-types. New types can appear at any time.
periodfull (the game), halves 1h 2h, quarters 1q–4q, hockey periods 1p–3p, reg (hockey's 60 minutes) and rt (basketball's regulation, no overtime), t3 (after 3 quarters), drives d1–d12, eh / eq (each half / each quarter), and opening minutes m1 m3 m4. Others can appear.
team, playerWho the line is about, when it is about someone. A spread's team is the side its line belongs to. A player has one id across books; team is null when no book says which side he plays for.
lineThe number: 224.5 yards, a total of 44.5, a spread of -3.5. null for markets without one, such as a moneyline. A spread is listed once, under the team laying the points: the other team at +3.5 is that line's no side.
outcomesWhat yes and no mean on this line, in words. A game has one moneyline: yes is the away team to win, no the home team; a tie is settled by each book's own rules.
american, decimal, probThe same price three ways. prob is the price as a probability, before any fee.
pricesOne entry per book and side. A book that prices only one side has only that entry.
fee, sizeExchanges only: the fee per $1 of payout at this price (null where the exchange charges none), and how many contracts are available at it, each paying $1.
since, book_tsWhen this price was first seen, and the exchange's own timestamp. Milliseconds, UTC. On an exchange since is approximate and does not move with every price change: use book_ts to judge how fresh an exchange price is.
seq, liveThe board's change count, and whether the feed is current. While live is false the last known prices are served. seq only orders what you receive: it skips numbers, and it starts over if the API restarts.

Read the fields, not the ids: an id is stable, but its layout is not a promise. New fields, books and market types arrive without notice; anything removed or changed in meaning will be a new version at /v2.

WebSocket

wss://api.bestbook.app/v1/stream. Send JSON, get JSON. Ask for permessage-deflate and messages come compressed, roughly six times smaller.

What you send

{ "op": "subscribe", "id": "a", "league": "nba" }
{ "op": "subscribe", "id": "b", "event": "nfl:2026-11-29-ATL-MIN", "types": ["spread", "total"], "books": ["dk", "fd"] }
{ "op": "unsubscribe", "id": "a" }
{ "op": "ping" }

A subscription takes a league or an event (not both), or neither for the whole board. types and books are lists that narrow it; leave them out for everything. With books you get only the lines those books price. id is yours to choose (up to 64 characters), and subscribing again with the same one replaces it. Anything misspelled or of the wrong shape, an unknown field included, is refused with an error, never guessed at. Messages are text, up to 64 kB each. You never have to send anything to keep a socket open; ping is there when you want an answer.

What you get

MessageMeaning
snapshotThe answer to a subscribe (sub is its id): every line it covers, each with its prices. A large one arrives as several snapshot messages; the last has done: true.
updateWhat changed. Apply its parts in this order: removed (line ids to drop), lines (whole lines; replace yours), prices (one book's side on a line), removed_prices (a book's side that is gone).
heartbeatEvery 15 seconds of silence, with seq, live and the time ts, so you can tell a quiet market from a dead connection. One is sent at once if the feed stops being current (live: false): treat the prices you hold as stale until a resync.
resyncRare. Drop everything you hold; a fresh snapshot for each subscription follows.
errorA request that was refused, with a message saying why.
unsubscribed, pongThe answers to unsubscribe and ping. After unsubscribing, drop the lines that subscription gave you; nothing more is sent for them.

Nothing is skipped on a connection, so there are no gaps to detect. If the connection drops, connect and subscribe again. A client that reads too slowly is not sent a backlog: it gets the latest state of everything it missed in one update. If the API closes a socket, the close code and reason say why.

Size it before you subscribe to everything. On a busy afternoon the whole board is a snapshot of about 25 MB compressed, then around 450 kB a second; the NFL alone is about 9 MB, then 225 kB a second. Subscribing by game, or narrowing with types and books, cuts that down. Updates can arrive while a large snapshot is still coming; the client above handles that as it is.

Market types

46 today. Spreads, totals, team totals and player markets come for the full game and for periods; moneylines are for the full game.

TypeMarketLeagues
moneylineMoneylineNFL, CFB, NBA, CBB, NHL
spreadSpreadNFL, CFB, NBA, CBB, NHL
totalTotalNFL, CFB, NBA, CBB, NHL
team_totalTeam totalNFL, CFB, NBA, CBB, NHL
player_pass_ydsPassing yardsNFL, CFB
player_pass_tdsPassing touchdownsNFL, CFB
player_pass_completionsPassing completionsNFL, CFB
player_pass_attemptsPassing attemptsNFL, CFB
player_interceptions_thrownInterceptions thrownNFL, CFB
player_longest_completionLongest completionNFL, CFB
player_rush_ydsRushing yardsNFL, CFB
player_rush_attemptsRushing attemptsNFL, CFB
player_longest_rushLongest rushNFL, CFB
player_rec_ydsReceiving yardsNFL, CFB
player_receptionsReceptionsNFL, CFB
player_longest_receptionLongest receptionNFL, CFB
player_rush_rec_ydsRushing + receiving yardsNFL, CFB
player_pass_rush_ydsPassing + rushing yardsNFL, CFB
player_tdsTouchdownsNFL, CFB
player_first_tdFirst touchdown scorerNFL, CFB
player_kicking_pointsKicking pointsNFL, CFB
player_extra_pointsExtra points madeNFL, CFB
player_field_goalsField goals madeNFL, CFB, NBA, CBB
player_sacksSacksNFL, CFB
player_tackles_assistsTackles + assistsNFL, CFB
player_def_interceptionsInterceptionsNFL, CFB
player_pointsPointsNBA, CBB, NHL
player_reboundsReboundsNBA, CBB
player_assistsAssistsNBA, CBB, NHL
player_threesThrees madeNBA, CBB
player_points_rebounds_assistsPoints + rebounds + assistsNBA, CBB
player_points_reboundsPoints + reboundsNBA, CBB
player_points_assistsPoints + assistsNBA, CBB
player_rebounds_assistsRebounds + assistsNBA, CBB
player_stealsStealsNBA, CBB
player_blocksBlocksNBA, CBB
player_steals_blocksSteals + blocksNBA, CBB
player_turnoversTurnoversNBA, CBB
player_double_doubleDouble-doubleNBA, CBB
player_triple_doubleTriple-doubleNBA, CBB
player_goalsGoalsNHL
player_first_goalFirst goalscorerNHL
player_shots_on_goalShots on goalNHL
player_savesSavesNHL
player_power_play_pointsPower play pointsNHL
player_blocked_shotsBlocked shotsNHL

Limits and errors

Limit
WebSockets open at once3
Subscriptions per socket50
REST requests300 in a burst, refilling at 5 a second
StatusMeaning
401No key, or one that is not recognised or no longer active. The error says which.
404No such game or address.
400A parameter that is not understood: an unknown name, or an unknown league, type or book.
405Anything but GET.
429Over a limit. For requests, Retry-After says how many seconds to wait; for sockets, close one first.
503The API is starting. Try again in a few seconds.

One plan

$22a month

Billed each month from the day you subscribe. Cancel whenever you like, here under Billing and invoices; the key works until the end of the month you paid for. A month already paid for is not refunded.

Get an API key

By subscribing you agree to the Terms of Service and the Privacy Policy.

  • All 27 sportsbooks and exchanges
  • NFL, NBA, NHL, college football and basketball
  • All 46 market types, game lines and player props
  • REST and WebSocket, with compression
  • 3 sockets at once, the whole board if you want it
  • New books and markets as BestBook adds them

Sign in to subscribe

Your API key lives on your BestBook account. You come straight back here.