Dataset
MLB historical closing lines, by book
Short answer: the MLB Odds package ($299, one time) is MLB moneyline, run line and total by book, with lines from 2015 and opening and closing lines per book from July 2020, plus a consensus close per game and the games file to key it on. Pregame only, as CSV and Parquet.
What you are buying
The MLB Odds package (id mlb-odds, $299 one time) has three tables that join on game_id:
- games: one row per game with the season, date, teams, final score, venue and city.
- game_odds: one row per game, book and capture, with the moneyline, run line, total and the price on each side.
- consensus_close holds one row per game with the consensus closing run line and total, and the number of books behind them.
Odds are the only MLB tier on sale today. The history tiers, with pitch-by-pitch and plate appearances, are due before Opening Day 2027. Until then the pitch-level data is available through the API, and the MLB pitch-by-pitch page covers it.
This is market history, not advice. It records what each book posted for each game and when.
The Pro leagues Odds bundle ($999) covers the NFL, NBA, NHL and MLB odds packages together, and the All six leagues bundle ($1,199) adds college football and college basketball. If you buy MLB Odds first, the catalog allows an upgrade to a bigger tier for the price difference within 90 days once those tiers exist.
Coverage and updates
The site lists MLB lines by book from 2015, and opening and closing lines per book from July 2020. The catalog does not state a row total for this tier, so we do not quote one. Your manifest.json has the exact count for each season file.
We checked coverage live by asking the API for one regular-season game from the end of four different seasons:
| Season | Game date | Books with lines | Opening prices |
|---|---|---|---|
| 2015 | Oct 1, 2015 | 4 | none |
| 2019 | Sep 26, 2019 | 7 | none |
| 2021 | Sep 30, 2021 | 16 | 7 of 16 books |
| 2025 | Sep 25, 2025 | 1 | 1 of 1 |
Two things show up. Opening prices begin later than closing prices, which matches the site, and even in 2021 only 7 of the 16 books had one. And the number of books per game is not stable: the 2025 game we happened to pick had a single book. We come back to that below.
Every package includes finished seasons plus the current season as of our latest monthly update on the day you buy. With an API plan of Pro or higher we refresh the current season's files every month at no charge. Without a plan, an end-of-season update costs a quarter of the package price. You can re-download for 365 days.
Schema
These are the real column names from the MLB Odds free sample, with the matching field in the API's get_odds tool. The API puts open and close side by side in one row per book, while the package stores one row per capture.
| Package column | API field | Meaning |
|---|---|---|
| game_id | game_id | Game key, for example 401908045 |
| bookmaker | provider | The book, as a code in this page |
| snapshot_type | not returned | opening, closing or snapshot |
| captured_at | captured_at | When the line was captured, UTC |
| minutes_before_start | not returned | Minutes before the scheduled start |
| ml_home, ml_away | home_ml_open and home_ml_close, away_ml_open and away_ml_close | Moneyline, American odds |
| spread_home | home_run_line_open, home_run_line_close | Run line for the home side |
| spread_home_odds, spread_away_odds | run_line_home_odds, run_line_away_odds | Price on each side of the run line |
| total | total_open, total_close | Game total in runs |
| total_over_odds, total_under_odds | over_odds, under_odds | Price on each side of the total |
The API also returns home_close_prob and away_close_prob, implied probabilities with the book's margin inside them, and a result block for the game: the median home moneyline, the median total, whether the favourite won and whether the total went over.
A real sample
Five closing rows for game 401908045 (Milwaukee at Tampa Bay, October 27, 2026, a 12-inning game that finished 3 to 4), from the free sample. Book names are replaced with codes. All five were captured 4 minutes before the start.
| game_id | bookmaker | minutes_before_start | ml_home | ml_away | spread_home | spread_home_odds | spread_away_odds | total | total_over_odds | total_under_odds |
|---|---|---|---|---|---|---|---|---|---|---|
| 401908045 | book_1 | 4 | 100 | -120 | 1.5 | -170 | 140 | 7 | -120 | 100 |
| 401908045 | book_2 | 4 | 104 | -115 | 1.5 | -167 | 147 | 7.5 | 100 | -120 |
| 401908045 | book_3 | 4 | 102 | -122 | 1.5 | -170 | 145 | 7.5 | 100 | -120 |
| 401908045 | book_4 | 4 | 103 | -116 | 1.5 | -171 | 141 | 7.5 | 102 | -122 |
| 401908045 | book_5 | 4 | 111 | -125 | 1.5 | -175 | 145 | 7.5 | 105 | -125 |
The run line is 1.5 at every book and only the price tells the books apart. The total is 7 at one book and 7.5 at the others.
Load the files
DuckDB reads the sample CSV. This lists, per game, how many closing rows exist, how far apart the closing totals were, and how many opening rows have no capture time. We ran it on the free sample, and the output is in the Verification table. In the paid package the big tables are one file per season, so replace the file names with your own pattern.
import duckdb
duckdb.sql("""
SELECT g.game_id, g.game_date,
count(*) FILTER (WHERE o.snapshot_type = 'closing') AS closing_rows,
max(o.total) FILTER (WHERE o.snapshot_type = 'closing')
- min(o.total) FILTER (WHERE o.snapshot_type = 'closing') AS closing_total_range,
count(*) FILTER (WHERE o.snapshot_type = 'opening' AND o.captured_at IS NULL) AS opening_rows_no_time
FROM read_csv('games.csv') g
LEFT JOIN read_csv('game_odds.csv') o USING (game_id)
GROUP BY g.game_id, g.game_date
ORDER BY g.game_id
""").show()The same in Polars, also run on the sample.
import polars as pl
games = pl.scan_csv("games.csv").select("game_id", "game_date")
odds = pl.scan_csv("game_odds.csv")
out = (
games.join(odds, on="game_id", how="left")
.group_by("game_id", "game_date")
.agg(
(pl.col("snapshot_type") == "closing").sum().alias("closing_rows"),
(pl.col("total").filter(pl.col("snapshot_type") == "closing").max()
- pl.col("total").filter(pl.col("snapshot_type") == "closing").min()).alias("closing_total_range"),
((pl.col("snapshot_type") == "opening") & pl.col("captured_at").is_null()).sum().alias("opening_rows_no_time"),
)
.sort("game_id")
.collect()
)
print(out)A left join from games is deliberate. It keeps a game with no closing rows in the output, which an inner join would hide.
Same data through the API
For one game, call the API. Set FASTBALLAPI_API_KEY first. This is the same game as the sample above.
import json
import os
import urllib.request
req = urllib.request.Request(
"https://mcp.fastballapi.com/v1/get_odds",
data=json.dumps({"game_id": "401908045"}).encode(),
headers={"Content-Type": "application/json", "x-api-key": os.environ["FASTBALLAPI_API_KEY"]},
)
with urllib.request.urlopen(req, timeout=30) as resp:
print("HTTP", resp.status)
game = json.load(resp)["data"]["games"][0]
books = game["books"]
print(len(books), "books, run line", {b["home_run_line_close"] for b in books},
"closing totals", sorted({b["total_close"] for b in books}), "result", game["result"])get_odds costs 5 credits for one game and 10 for a whole day. The free plan gives 500 credits a month, no card.
Worked example: how the total drifted in one game
In game 401908045 the API shows each book's opening and closing total. At open the eight books posted 7, 7, 6.5, 7, 7.5, 7, 7 and 7.5. At close they posted 7, 7.5, 7.5, 7.5, 7.5, 7.5, 7.5 and 7.5. Five of the eight moved up by half a run or a full run, and three did not move. The game then ended with 7 runs in 12 innings, below the 7.5 median close.
That is one game, and it proves nothing beyond what the rows say. It does show the shape of the analysis you can run on the full file: for every book and game, subtract the opening total from the closing total, then group by season or by book. The opening rows in the paid files have no capture time in the sample, so you can say how far a line moved but not how fast.
What we saw in a 25-game spot check
We took every fourth game from the latest 100 regular-season games of 2025 (September 21 to 28) and called get_odds on each of the 25.
| Measure | Value |
|---|---|
| Games with 8 books | 16 |
| Games with 1 book | 9 |
| Of the 16, closing totals differed across books | 12 |
| Mean gap between highest and lowest closing total | 0.41 runs |
| Book rows whose total moved from open to close | 42 of 128 |
| Mean of the median closing total | 8.34 |
| Mean combined runs | 7.75 |
The nine single-book games all carried one book and no more. We do not know why from the response, so before you build on a recent season, count books per game and decide what minimum you accept.
What the columns mean in practice
- Not every game has a closing row. In the sample, game 401908046 has 204 snapshot rows and 8 opening rows but no closing row, and the consensus file has no row for it. A join that assumes one closing row per game will drop it silently.
- Opening rows have no timestamp. In the sample all 16 opening rows have a blank
captured_atandminutes_before_start. Use them for the level of the opening line, not for timing. - Snapshots are thinner than closes. The 422 snapshot rows carry a moneyline and almost always a run line and a total, but no run line prices and no total prices. Only the closing rows have a full set of prices.
- Run lines look the same everywhere. The run line is almost always 1.5 on one side and -1.5 on the other. The home line in the sample is +1.5 at all eight books, and the prices carry the real information, from -163 to -175.
- Moneyline pairs cross zero. A home price of +100 and an away price of -120 sit on either side of the sign change, so a raw difference between two books can look huge when it is small. Convert to implied probability first.
- The number of books varies by game. It was 8 in the sample and in 16 of our 25 spot-check games, and 1 in the other 9.
Reading the rows
Choose one capture rule and keep it: the closing row is the last capture before the scheduled start, and the opening row is the earliest line we hold. Count games, not rows. Check which games lack a closing row before you compute any average, and report how many you dropped. If you need a single number per game, the consensus table gives one, but only where it has a row.
Game ids in this file are numeric strings such as 401908045. Older games use a different id range, so keep the id as text and do not assume a pattern.
When not to use this
- You need one game or one day. The API returns every book's lines for 5 or 10 credits.
- You need live lines. Odds are pregame only, and files refresh monthly at best.
- You need pitches, plate appearances or box scores. History tiers are not on sale yet, and the API has them.
- You need first-five-innings or alternate lines. The API's
get_market_oddsandget_alt_lineshold those. - You need player props for MLB. There is no MLB props package today.
- You want to resell the lines. The licence (version 2026-12-05) allows internal and commercial use, and publishing your own derived statistics, but not redistribution of raw files.
- You want advice. These are historical prices.
Who uses closing lines
Most buyers use the closing moneyline and total as a market baseline for team ratings and game models. Others compare books, measure how lines moved from open to close, or check how a model's numbers differ from the market over a season. Some want a keyed file that joins to results without scraping. A season of MLB is 2,430 regular-season games before the playoffs, so each job reads a lot of rows at once.
Free sample first
Every tier has a free sample zip with a few real games and the same columns. Download it from the data packages page and test one game before you pay.
Live from the API
Free to embed on your own site, with no key needed. Get the embed code.
Get a free key Or download whole seasons as Parquet
Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.