Odds API for betting apps
An odds API for betting apps and sports apps: real-time odds, live scores and deep links to each sportsbook, in the format your users read.
Fans expect the line next to the score. PreciseAPI serves schedules, live scores and odds from the same event ids, so a game card pulls everything it needs without stitching providers together.
- Schedules and scores. /v1/events lists upcoming games per league and /v1/scores returns live and final results, keyed to the same event ids as the odds.
- Odds on every game card. Moneyline, spread and total from the books your users know, filtered with the books parameter.
- Any format. Show American odds to US users, decimal odds elsewhere, or implied probability for a cleaner read.
- Push, don’t poll. Stream price and score changes over WebSocket so live game cards update without hammering the API.
An odds API for betting apps has to serve screens that change state all day. A game card starts as a schedule entry, gains prices, goes live with a score and clock, and ends as a final result, and users expect it to stay right at every step. Bet trackers, odds comparison apps, community and picks apps, fantasy apps and scoreboards adding a line next to the score all face the same job: keep schedules, scores and prices in sync without stitching providers together.
This page covers how to put PreciseAPI behind a mobile or web app: the backend shape, a game-card builder, notifications and "bet now" links, what each plan allows, and the mistakes that show up after launch. If you are building a sportsbook that takes bets, the odds API for sportsbooks page is the better starting point.
What a sports app odds API has to cover
- Schedules with stable ids, so a user can follow a game days before it starts.
- Prices from the books your users know, in the format they read.
- Scores and clocks on the same ids, live and final.
- Links that open the right book, ideally with the bet on the slip.
- Changes pushed to you, so the app updates without users pulling to refresh.
PreciseAPI serves all five from one odds and scores API. /v1/events (1 credit) lists upcoming and live games per league, /v1/odds (2 credits) adds each book's prices, and /v1/scores (1 credit) returns live and final games with score and clock. All three use the same event id from the day the schedule is posted to the final whistle.
How an odds API for betting apps fits your backend
mobile / web app ──▶ your backend (cache, push) ──▶ PreciseAPI REST or stream
The app never calls PreciseAPI directly. A key inside an app binary can be extracted, and every user would spend your credits. Your backend refreshes each league on a schedule, keeps the merged game cards in a cache, and serves them to every user. On Syndicate it can hold one WebSocket instead: event messages carry score, clock and status changes, and delta messages carry price changes, which you pass on to apps over your own socket or as push notifications.
Building game cards
This Node.js function merges the three calls into one list of cards for a league:
const API = 'https://api.preciseapi.com/v1';
const get = (path) => fetch(`${API}${path}`, { headers: { Authorization: `Bearer ${process.env.PRECISEAPI_KEY}` } }).then((r) => r.json());
export async function gameCards(league, books = ['fanduel', 'draftkings'], format = 'american') {
const [events, odds, scores] = await Promise.all([
get(`/events?league=${league}`), // scheduled and live
get(`/odds?league=${league}&markets=main&books=${books.join(',')}&format=${format}`),
get(`/scores?league=${league}`), // live and final
]);
const games = new Map();
for (const e of [...events.data, ...scores.data]) games.set(e.id, e);
const prices = new Map(odds.data.map((e) => [e.id, e.bookmakers]));
return [...games.values()].map((e) => ({
id: e.id,
start: e.start_time,
status: e.status, // scheduled, live or final
matchup: `${e.away.abbr} @ ${e.home.abbr}`,
score: e.score, // null until a source reports one
clock: e.clock?.display ?? null, // e.g. "Q3 4:47"
books: (prices.get(e.id) ?? []).map((b) => ({
book: b.name,
lines: b.markets.map((m) => ({ market: m.key, outcomes: m.outcomes.map(({ side, point, price }) => ({ side, point, price })) })),
})),
}));
}
markets=main is shorthand for moneyline, spread and total. Pass format=decimal or format=probability for users outside the US; the American odds to decimal guide explains the conversions if you want to offer a setting instead. The betting odds API and sports scores API pages describe both endpoints in more detail.
Betting app odds data beyond the game card
- Notifications. Line-move alert rules send a signed webhook when a price moves by your threshold or a spread or total line changes. Your backend turns it into a push to users following that game. The odds alerts webhooks docs cover payloads and signatures.
- "Bet now" buttons. Outcomes carry a
betslip_urlwhere the book publishes one, withevent_urlandleague_urlas fallbacks, andstate=makes Caesars and BetParx links open the user's state site. The deep links docs list what each book carries. - Bet tracking. Store each logged bet with its selection id and price. Grade it from
/v1/scoresonce the game is final, and show how the price compared with the close using/v1/historyfor main full-game markets. - Player props.
/v1/props(3 credits) returns sportsbook props and DFS pick'em lines on the same player id, 25 events per request.
Which plan fits
Refreshing one league's events, odds and scores every 2 minutes is 4 credits a refresh, or 86,400 credits per 30 days, which fits an odds API for betting apps on Edge ($49.99, 100,000 credits). Schedules change slowly, so refreshing events every 15 minutes and scores every minute during games is often a better split. Several leagues at short intervals need Sharp's unlimited credits and 1,200 requests a minute.
Both Edge and Sharp serve pre-game prices: a game's odds leave responses when it starts, while its score keeps updating. Live odds on game cards need Syndicate ($249.99), which adds in-play prices and the WebSocket stream with 10 connections. See odds API pricing for the full comparison.
Mistakes that show up after launch
- Showing 0–0 before a game has a score.
scoreisnulluntil a source reports one. Render a dash, not zeros. - Trusting placeholder kickoffs.
start_time_tbdmeans the source shows a placeholder time, andstart_time_disputedmeans sources disagree by more than 15 minutes. - Losing merged games. When two ids turn out to be one game, the extra id moves into
alternate_idsand keeps resolving to it. Key your cache on the event'sid. - Forgetting finals expire.
/v1/scoreskeeps finished games for at least four hours. Store results if your app shows yesterday's scores. - A client that breaks on new data. New books, leagues and market keys appear without a version change. Ignore what you don't recognize instead of failing.
- Skipping the rules. Showing odds or linking to operators is regulated differently by jurisdiction and by app store. Check the rules where your users are, and add responsible gambling information next to odds.
Related reading
The guide on how to build a betting app walks through a full build, and the odds API Node.js tutorial adds a streaming client. The live odds API page covers in-play prices. For coverage, the NFL odds API, NBA odds API and MLB odds API pages list markets per league, and the FanDuel odds API and DraftKings odds API pages describe two of the books most apps show first.
Frequently asked questions
Can my mobile app call PreciseAPI directly?
It shouldn't. A key in an app can be extracted and used by anyone. Call the API from your backend, cache the results, and serve your app from there, which also keeps credit use flat as users grow.
Do I get live scores on the Edge plan?
Yes. /v1/scores returns live and final games with the score and clock on every paid plan. Odds for games in progress are the part that needs Syndicate.
Can users place bets through PreciseAPI?
No. PreciseAPI is a data provider: it doesn't take bets, hold funds or pay winnings. A "bet now" button can open the sportsbook's own app or site using the links in the feed.
Which leagues can an odds API for betting apps show?
The feed covers 17 leagues, from the NFL, NBA, MLB and NHL to college sports, soccer, tennis, UFC, golf and esports. /v1/leagues is free and lists each league's periods, whether it has props and futures, and how many games are upcoming or live.
One id from schedule to final
An event id never changes, including when a game goes in-play, so a game card can be keyed on it from the day the schedule is posted to the final score. /v1/events lists upcoming games, /v1/odds adds prices and /v1/scores adds the score and game clock. Each call costs 1 or 2 credits and covers a whole league, so a scoreboard for one sport takes a few calls per refresh.
Choosing the books to show
Most apps show a short list of books their users know. Pass books=fanduel,draftkings, or any source ids from /v1/sportsbooks, to keep responses small, and format=decimal or format=probability for audiences outside the US. Prices for games in progress need the Syndicate plan. On Edge and Sharp, live games drop out of odds responses while their scores keep updating.
Example request
GET /v1/odds?league=nba&markets=moneyline,spread,total&books=fanduel,draftkings
Endpoints
- GET /v1/events: List events
- GET /v1/scores: Live scores
- GET /v1/odds: Get odds
- WebSocket stream: snapshots and deltas over one connection
Products
- Sports scores API: Sports scores API with live scores, the game clock and final results on the same event ids as the odds, for scoreboards, live screens and bet grading.
- 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.
- Exchange odds API: Exchange odds API: Kalshi, Polymarket, Novig, ProphetX and 4CX prices in the same formats as sportsbook odds, with liquidity, on one event id.
Related reading
- Building an Odds Comparison Widget for Media Sites: An embeddable React widget that shows the best available price per outcome across books, backed by a server-side cache with predictable credit spend, plus compliance notes for publishers.
- Odds API Node.js Tutorial: Streaming Real-Time Odds with WebSockets: Build a reliable Node.js client for real-time odds with the ws package. Snapshots, deltas, sequence-gap detection, resync and reconnects with backoff.
More use cases
- Odds screens: 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.
- 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.
Looking for a specific league or book? See the odds API directory, or compare plans.