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.
- Every book in one shape. Moneylines, spreads, totals, props and futures use the same market keys and outcome ids across 36 sources, so one table renders them all.
- Best line built in. /v1/best-lines returns the top price per outcome with the book that offers it — no client-side comparison loop.
- Live without polling. Subscribe once over WebSocket and receive sequence-numbered deltas; a snapshot on connect means no blank screen.
- Stale prices hidden. Books that stop reporting are suspended automatically, so your screen never shows a price that is no longer on offer.
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:
- Columns that match your users. A bettor in New Jersey wants the regulated books they can open. A sharp bettor wants Pinnacle and Circa as a reference. An exchange trader wants Kalshi next to a sportsbook. All of these should be a
books=list on one feed, not a new provider per column. - Freshness you can show. Every price needs an age. A screen that hides how old a quote is will eventually highlight a stale one as the best line.
- Cost that doesn't scale with viewers. One upstream request or connection should serve everyone looking at the same board.
- Comparisons that are correct. Prices compare only when the market, period, side and number all match.
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:
| Plan | How the server gets prices | Freshness |
|---|---|---|
| Edge, Sharp | Poll /v1/odds (2 credits) or /v1/best-lines (3 credits) | As often as you poll, pre-game only |
| Syndicate | Subscribe to /v1/stream | Every 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 s | 86,400 | 129,600 |
| Every 30 s | 172,800 | 259,200 |
| Every 10 s | 518,400 | 777,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
- Edge ($49.99 a month): a pre-game screen refreshed about once a minute, or a prototype.
- Sharp ($199.99 a month): a pre-game odds comparison screen polled every few seconds across many leagues, with player props and futures.
- Syndicate ($249.99 a month): a real-time odds screen with in-play prices, updated in under 500 ms over the stream, with 10 concurrent connections.
The odds API pricing page has the full comparison.
Mistakes that make a screen wrong
- Highlighting stale prices. Each market has an
updated_at. Grey out quotes past your threshold, and use a tighter one for live games than for pre-game ones. REST endpoints leave out suspended markets unless you passinclude_suspended=true; on the stream, a suspended market arrives as a change withsuspended: true. - Mixing DFS lines into best prices. Pick'em apps pay lineup multipliers, not a price per outcome, so
/v1/best-linesleaves them out. Show them in a separate props view built on the DFS pick'em API. - Forgetting the ladders.
/v1/best-linesskipsalternate_spread,alternate_totalandalternate_team_total. If you display ladders, compute best prices from/v1/oddsby selection id. - Counting copies as consensus. Some books share a trading platform and post near-identical prices.
/v1/sportsbooksnames it inplatform(Kambi for BetRivers and BetParx, for example), so count them once in any market average. - Showing books users can't use.
/v1/sportsbookstags each source asregulated,offshore,sharp,exchangeand so on. Map each user's region to a book list and pass it asbooks=. Keep a sharp column anyway: it tells you whether a "best" price is good or just slow, and the Pinnacle odds API page explains why that book is the usual reference.
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
- GET /v1/odds: Get odds
- GET /v1/best-lines: Best lines
- WebSocket stream: snapshots and deltas over one connection
Products
- Best lines API: Odds comparison API that returns the best price for every outcome across every sportsbook, exchange and DFS app in one call, with the books that offer it.
- Arbitrage API: Arbitrage API data: the best price on every side at identical lines across sportsbooks and exchanges, plus an MCP tool that finds arbs with stakes.
- Game odds API: Betting odds API for moneylines, spreads and totals from 36 sources, for every period, plus alternate lines and team totals in one normalized schema.
- Live odds API: Live odds API with in-play prices pushed in under 500 ms over WebSocket on Syndicate, plus live scores, the game clock and automatic suspension of stale prices.
Related reading
- How to Build an Odds Screen in Real Time (Architecture and Code): A production architecture for a live odds screen with a REST snapshot, WebSocket deltas, best-line highlighting in React and handling of stale prices.
More use cases
- Odds alerts & notifications: An odds API for Discord bots and alerts: signed webhooks on line moves, or a WebSocket feed for steam and best-price logic, so your bot posts the move as it happens.
- DFS & pick'em tools: An odds API for DFS and pick’em tools: PrizePicks, Underdog, Sleeper and Pick6 lines next to sharp sportsbook props on one player id, to find the best picks.
- Trading & market making: An odds API for sportsbooks and trading desks: every competitor’s price, sharp books and exchanges in real time, with line history, to price and manage risk.
- Media & affiliates: An odds API for affiliates, media and tipsters: live odds tables, best-price widgets and deep links to each book’s bet slip, from one normalized feed.
Looking for a specific league or book? See the odds API directory, or compare plans.