Sports betting model data
Sports betting model data: market prices, implied probabilities and line history with stable ids, to train, backtest and run betting models and research.
Models are only as good as the data you train and evaluate them on. PreciseAPI gives you consistent ids, the full line history and the closing line to evaluate every prediction your model makes.
- Closing line value. Store the close from sharp books and grade every pick by CLV, not just results.
- Consistent ids. Teams, players and markets use stable ids across books and seasons.
- Probability format. Request implied probabilities directly with format=probability.
- Python SDK. Pull data straight into pandas with the official Python client.
Sports betting model data comes in three layers: the prices the market posted, which are both inputs and benchmarks; the results, which are your labels; and the closing line, which is the yardstick most serious bettors and researchers use to judge a model. Get any one of them wrong, usually through a timestamp, and a backtest will look better than reality.
This page covers how to collect all three from PreciseAPI, what the API does and doesn't store, a Python collector you can run on a schedule, and the mistakes that most often inflate results.
What sports betting model data has to include
- Prices at decision time. Each book's price with a timestamp, so a simulated bet only uses a price that existed when the model would have acted.
- A sharp reference and the close. Low-margin books such as Pinnacle and Circa set the reference price, and their last price before the start is the close.
- Results on the same keys. Final scores joined by event id, not by team names and dates.
- Stable ids. Events, teams, players, markets and selections that keep their ids across books and over time.
PreciseAPI covers each layer. /v1/odds, /v1/props and /v1/futures return current prices from 36 sources, with an updated_at on every market. /v1/history returns the opening price, the current price and every recorded change for main full-game markets (moneyline, spread and total) at any book. /v1/scores returns live and final scores on the same event ids. format=probability returns implied probabilities directly. The historical odds API and sports scores API pages summarize the two endpoints most models lean on, and league pages such as the NBA odds API list the markets and periods each league carries.
What it doesn't store: build the sports betting dataset forward
PreciseAPI does not sell a multi-season archive. Line history covers main full-game markets for games in the feed, and finished events stay queryable for at least four hours. Player prop history isn't recorded. The dependable pattern is a collector that copies prices, history and results into your own storage as games happen, so your dataset grows from the day you start. If you need several past seasons right away, our comparison page The Odds API alternative says plainly where that provider's archive is deeper than ours.
Three scheduled jobs cover most models:
| Job | Endpoint | When |
|---|---|---|
| Price snapshots | /v1/odds (2 credits), /v1/props (3) | Every 5 to 15 minutes before games |
| Line history and close | /v1/history (3 per market and book) | After each game ends |
| Results | /v1/scores (1) | Every hour; finals stay for at least four hours |
A collector in Python
The official Python client reads PRECISEAPI_KEY from the environment. This collects snapshots, closing prices and results into pandas:
from datetime import datetime, timezone
import pandas as pd
from preciseapi import PreciseAPI
client = PreciseAPI()
BOOKS = ["pinnacle", "circa", "draftkings", "fanduel"]
def snapshot(league):
res = client.odds(league=league, markets=["moneyline", "spread", "total"], books=BOOKS)
now = datetime.now(timezone.utc).isoformat()
return pd.DataFrame([
{"captured_at": now, "event_id": e["id"], "start_time": e["start_time"], "book": b["id"],
"market": m["key"], "line": m.get("line"), "selection_id": o["id"], "side": o["side"],
"point": o.get("point"), "price": o["price"], "updated_at": m["updated_at"]}
for e in res.data for b in e["bookmakers"] for m in b["markets"] for o in m["outcomes"]
])
def close(event_id, start_time, book="pinnacle", market="spread"):
h = client.history(event_id=event_id, book=book, market=market).data
before = [p for p in h["points"] if p["t"] <= start_time]
return before[-1] if before else h["open"] # {"t", "line", "prices"}
def results(league):
res = client.scores(league=league, status=["final"])
return pd.DataFrame([
{"event_id": e["id"], "home_score": e["score"]["home"], "away_score": e["score"]["away"]}
for e in res.data if e["score"]
])
History prices follow the market's outcome order: home then away for moneylines and spreads, with line from the home side's view, and over then under for totals. The backtesting betting models post builds a full archive and grading pipeline on top of this, and the odds API Python docs cover the client's retries, async use and streaming.
Betting model odds data at every stage
The same sports betting model data serves each stage of a model's life:
- Features and priors. De-vigged sharp prices are a strong prior, and many models use them as a feature or blend with them. The no vig odds API page covers removing the margin.
- Decision prices. The price your model would have taken is the snapshot at or just before the decision time, at the book you would have used.
- Evaluation. Closing line value compares that price with the close. It has far less noise than profit and loss, and how to measure closing line value explains the math.
- Market research. Per-book series show which books move first and which follow.
source_changed_aton each market is the source's clock when the price first appeared, where the source reports one, which suits that kind of timing study.
An odds API for researchers
Researchers studying market efficiency, book behavior or exchanges need the same collector, plus documentation of how the data was gathered. Record your book list, snapshot interval and the captured_at time of each row so the method can be repeated. Contract exchanges such as Kalshi and Polymarket sit in the same schema as sportsbooks, with liquidity on each outcome, so a comparison between venues needs no mapping. For quick questions before writing code, the odds API MCP server lets an AI client call tools such as get_line_history with your key.
Which plan fits
Sports betting model data rarely needs a big credit budget. Snapshotting three leagues every 15 minutes, one /v1/odds call each, is 17,280 credits a month, and closing prices for ten games a day at two books and three markets add about 5,400. Both fit easily in Edge's 100,000 credits, and line history, props and futures are on every paid plan. Sharp's unlimited credits suit frequent snapshots of props across many leagues. Syndicate adds in-play prices and the WebSocket stream, the way to capture every pre-game and live tick yourself. See odds API pricing.
Mistakes that inflate backtests
- Using
currentas the close. On a game that was priced in-play,currentcan include live moves that already reflect the score. Take the last point beforestart_time. - Ignoring the margin. Probabilities from
format=probabilityinclude each book's vig, so a market's sides add up to more than 1. Normalize before treating them as fair. - Counting copies as independent. Books on a shared platform (the
platformfield on/v1/sportsbooks) post near-identical prices. - Losing merged events. When two ids turn out to be one game, the extra id goes into
alternate_idsand keeps resolving to the event. Store the canonical id. - Reading results, not the close. A few hundred bets of realized profit say little. Positive closing line value over a large sample is better evidence, and even that is no promise of future returns.
Frequently asked questions
Does PreciseAPI have historical odds for past seasons?
No multi-season archive. /v1/history covers the opening price, current price and every recorded move for main full-game markets of games in the feed, and finished events stay available for at least four hours. Most teams run a collector and build their own archive from there.
Can I get implied probabilities instead of American odds?
Yes. Pass format=probability to any odds endpoint, or format=decimal for decimal odds. Probabilities include the book's margin, so de-vig them before using them as fair prices.
Is line history included on the Edge plan?
Yes. Line history, player props and futures are included on every paid plan, from Edge at $49.99 a month.
Which books should a model use as its reference?
Most models use low-margin books such as Pinnacle and Circa, and exchanges such as Novig weighed by liquidity. The why Pinnacle odds matter post and the Pinnacle odds API page explain the reasoning; test any choice against your own closing-line results.
Training data with stable keys
Event, team, player and market ids stay the same across books and over time, so a dataset built from daily /v1/odds pulls joins cleanly with results from /v1/scores. Request format=probability to get implied probabilities directly, or keep American odds and convert in your own code. /v1/scores keeps finished games for four hours, so grade results soon after games end, or store them as they arrive.
Measuring a model against the market
Closing line value compares the price you took with the last price before the game started, and beating the close consistently is the usual sign that a model is ahead of the market. /v1/history returns the opening and current values and every recorded move for main full-game markets, so you can store the close and compare it with the price your model acted on. Line history is included on every paid plan.
Example request
GET /v1/odds?league=nba&markets=moneyline&format=probability
Endpoints
- GET /v1/history: Line history
- GET /v1/odds: Get odds
- GET /v1/scores: Live scores
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.
- Historical odds API: Historical odds API with timestamped line history for every market and book: opening prices, every move and the closing line, for backtests, CLV and research.
- Line movement API: Line movement API with every price change from the opening line to the close, per book, for line charts, steam alerts and closing line value tracking.
- 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.
Related reading
- How to Measure Closing Line Value: CLV Explained: What closing line value is, how to compute it from implied and no-vig probabilities, why it is a more reliable metric than win rate, and how to store closes.
- Backtesting Betting Models with Line History (Without Fooling Yourself): Backtest a betting model on timestamped odds with decision-time snapshots, sharp closing lines, CLV grading and no look-ahead bias, plus a pandas sketch.
More use cases
- Exchange trading tools: An exchange data API for trading tools: Kalshi, Polymarket and Novig prices next to sportsbook odds on one event id, with liquidity, in one format.
- Sports apps & scoreboards: 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.
- 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.
Looking for a specific league or book? See the odds API directory, or compare plans.