Build a real-time odds screen

Build a real-time odds screen: every book’s price side by side, the best line highlighted and updates in under a second, from one normalized odds API.

An odds screen lives or dies on two things: how many books it shows and how fast prices update. PreciseAPI gives you both in one schema, so a single component renders FanDuel, Pinnacle, Kalshi and PrizePicks the same way.

A real-time odds screen looks simple: games down the side, books across the top, the best price highlighted. The work is underneath. You have to keep 36 sources in one shape, know which prices are still on offer, and refresh fast enough that nobody acts on a number a book pulled a minute ago, all without an API bill that grows with every visitor.

This page covers which endpoints feed which part of the screen, when to poll and when to stream, what each costs, and the mistakes that make comparison tables wrong.

What a real-time odds screen has to get right

Four requirements decide most of the design:

The architecture

PreciseAPI ──REST poll or WebSocket──▶ your server (board in memory) ──SSE / WebSocket──▶ browsers

The browser never talks to PreciseAPI. Your key stays on your server, which holds the current board in memory and pushes changes to clients over Server-Sent Events or your own socket. However many people open the screen, you pay for one feed.

The server fills its board in one of two ways:

PlanHow the server gets pricesFreshness
Edge, SharpPoll /v1/odds (2 credits) or /v1/best-lines (3 credits)As often as you poll, pre-game only
SyndicateSubscribe to /v1/streamEvery change, batched every 250 ms, in-play included

A single /v1/odds call covers a league's game lines for up to 200 events, and league=nfl,nba combines leagues in one request. /v1/best-lines returns the top price per outcome with best_books and books_quoting, which is everything a "best price" column needs. If you already pull the full board for display, compute the best prices from /v1/odds yourself and skip the second call.

Keeping the odds board current over the stream

On Syndicate, open one WebSocket and send a subscribe message with the leagues, books, markets and periods you display. The server answers with a snapshot in the same shape as /v1/odds. After that come delta messages, with changed markets in changes and dropped ones in removed, and event messages when a score, clock, status or kickoff changes. Store markets by id and each update becomes a map write:

// board: Map of market id -> { event_id, book, market }
export function applyDelta(board, msg) {
  for (const { event_id, book, market } of msg.changes) board.set(market.id, { event_id, book, market });
  for (const { market_id } of msg.removed) board.delete(market_id);
}

const toDecimal = (a) => (a > 0 ? 1 + a / 100 : 1 + 100 / -a);

// Best price per selection id for one event, ties kept.
export function bestPrices(board, eventId) {
  const best = new Map();
  for (const { event_id, book, market } of board.values()) {
    if (event_id !== eventId || market.suspended) continue;
    for (const o of market.outcomes) {
      if (o.price == null) continue;
      const d = toDecimal(o.price);
      const cur = best.get(o.id);
      if (!cur || d > cur.decimal) best.set(o.id, { decimal: d, price: o.price, books: [book] });
      else if (d === cur.decimal) cur.books.push(book);
    }
  }
  return best;
}

Selection ids already include the market key, period, side and point, so grouping by o.id compares like with like: -3 at one book and -3.5 at another fall into different groups without extra code.

Every message carries a seq one higher than the last. If the number jumps, send {"type":"resync"} and rebuild from the fresh snapshot. Heartbeats arrive every 15 seconds with the current number, so a much longer silence means the connection is gone: mark the board stale and reconnect. The WebSocket odds API docs list every message type and close code, and the odds API Node.js tutorial builds a client with reconnects and backoff.

Polling on Edge and Sharp

Pre-game boards move slowly enough to poll. A request costs the same whatever it returns, so the budget depends only on how often you call:

Refresh/v1/odds, credits per 30 days/v1/best-lines, credits per 30 days
Every 60 s86,400129,600
Every 30 s172,800259,200
Every 10 s518,400777,600

Edge's 100,000 monthly credits cover one request a minute around the clock, with credits left over for other calls. A refresh every 30 seconds or faster needs Sharp's unlimited credits, which also raise the rate limit from 300 to 1,200 requests a minute. Both plans serve pre-game prices only, so a game drops out of odds responses when it starts.

Which plan fits a real-time odds screen

The odds API pricing page has the full comparison.

Mistakes that make a screen wrong

Where to go next

The tutorial on how to build an odds screen walks through the server and a React component. The line shopping API post covers best-price rules in depth, and best sportsbooks for line shopping helps you choose columns. For the endpoints themselves, see the odds comparison API and the live odds API. League pages such as the NFL odds API and NBA odds API list the markets and periods each league carries.

Frequently asked questions

Can I build a real-time odds screen on the Edge plan?

You can build a pre-game screen refreshed about once a minute, which fits within Edge's 100,000 monthly credits. A screen that updates as prices move, including in-play odds, needs the WebSocket stream, which is part of Syndicate.

How many books can one screen show?

Every source that prices the league: the feed carries 23 sportsbooks, 7 exchanges, and 6 DFS apps. A request costs the same however many books it returns, so the limit is your layout, not your budget.

Should the browser call PreciseAPI directly?

No. A key in browser code is visible to anyone who opens the developer tools. Call the API from your server, keep the board there, and send it on to clients, which also keeps your cost flat as traffic grows.

Does the screen show odds for games in progress?

On Syndicate, yes: live games stay on the board and update over the stream. On Edge and Sharp, a game leaves odds responses when it starts, while /v1/scores keeps reporting its score.

How the data fits a screen

Each event comes back with its markets grouped by source, and every outcome carries an id that is the same at every book. A screen keyed on outcome id needs no name matching: one row per outcome, one column per book. Lines can differ between books, so group spreads and totals by their line before comparing prices. -110 on 47.5 and -110 on 49.5 are different offers.

Refreshing without wasting credits

Pre-game boards change slowly enough to poll. A /v1/odds call costs 2 credits and covers up to 200 events of game lines. On Syndicate, the WebSocket stream sends a snapshot when you subscribe and then only the markets that changed, so a live screen never downloads a whole board again. Markets whose source has stopped reporting are left out unless you ask for them with include_suspended.

Example request

GET /v1/best-lines?league=nfl&markets=moneyline,spread,total

Endpoints

Products

Related reading

More use cases

Looking for a specific league or book? See the odds API directory, or compare plans.