Dataset

DuckDB sports analytics datasets

Short answer: SportsDataHQ sells 20 one-time data packages, from $149 to $799, and 3 bundles up to $1,999. They are CSV and Parquet files, and DuckDB reads all of them in place with plain SQL. This page lists every package, links the page that covers it, and gives a query for each family that we ran against the free samples.

Why DuckDB suits these files

Sports data is wide and joined. A play table has dozens of columns, an odds table has one row per game, book and capture, and the useful question usually spans both: how did the closing total compare with the points scored, or how did the expected points of a shot compare with the result. You can answer that in a notebook with a dataframe library, in a warehouse after a load step, or in DuckDB straight off the files.

DuckDB suits the packages for four reasons. It reads CSV and Parquet in place, so there is no load. It handles glob patterns, so a table split into one file per season is one read_parquet call. It reads only the columns and row groups a query touches in Parquet. And it runs in a notebook, a script or a command line with no server.

We keep to one rule for the pages that follow: every query on this page ran. We ran them against the free sample zips, which hold a few real games with the same tables and columns as the paid files. We did not run them on the paid season files, because we have none locally. The shapes carry over, but a paid table has millions of rows where the sample has hundreds, so check your own counts.

This is market history, not advice. The lines are what each book posted, and the props are graded against what happened.

Every package

Prices are one time. Each league's tiers include the one below, so History + Odds contains History, and Complete contains History + Odds.

PackagePriceWhat is in itCovered on
nfl-history$149Every game since 1999, every play with EPA and win probability, player game statsNFL play-by-play
nfl-history-odds$449History plus lines by book, a consensus close and market win probability on every playNFL closing lines
nfl-complete$799Adds graded player props, alternate lines and the intraday line historyNFL line movement, NFL props
nfl-odds$349Games, odds by book, consensus closeNFL closing lines
nfl-props$399Graded player props and alternate lines from 2023NFL props
nba-history$199Every game and play with shot locations since 2003-04, player game statsNBA play-by-play, NBA shot charts
nba-history-odds$499History plus lines by book, opening and closing per book from July 2020NBA closing lines
nba-complete$799Adds graded props from May 2023 and the intraday line historyNBA props
nba-odds$349Games, odds by book, consensus closeNBA closing lines
nba-props$349Graded props from May 2023NBA props
nhl-history$249Games since 2015-16, play-by-play with shot locations, shifts, goalie time on iceNHL shot-level data
nhl-history-odds$499History plus lines by book since 2019-20NHL closing lines
nhl-complete$799Adds graded props from the 2023 playoffs and the intraday line historyNHL props
nhl-odds$299Games plus odds by bookNHL closing lines
nhl-props$299Graded props from the 2023 playoffsNHL props
ncaam-history$349Every Division I men's game and play since 2013-14, player game statsCollege basketball
ncaam-history-odds$499History plus lines by book since 2013-14College basketball
ncaam-odds$199Games plus odds by bookCollege basketball
mlb-odds$299Lines by book from 2015MLB closing lines
ncaaf-odds$199Lines by book from 2014, snapshots from 2020College football
bundle-odds-pro$999NFL, NBA, NHL and MLB odds packagesthe four closing-line pages
bundle-odds-all$1,199The same plus college football and college basketball odds
bundle-complete-3$1,999NFL, NBA and NHL Complete

Two sports are not packages. MLB pitch-by-pitch is covered by API, and soccer is available on request, with a page on three-way closing lines and one on Premier League match events. If your work needs the Parquet files and Polars rather than DuckDB, the Polars roundup covers the same packages.

Set up in four lines

Unzip a package into a folder named for its id, and run Python from the folder that holds the packages.

import duckdb

con = duckdb.connect("sdhq.duckdb")   # a file, so views survive between sessions
con.sql("SELECT count(*) FROM read_csv('nfl-history/plays.csv')").show()

A paid package has one file per season for the large tables. Replace a file name with a glob, such as read_parquet('nhl-history/history/package-a/play_by_play_*.parquet'). The free NHL sample uses that layout, with a history folder and a package-a or package-b folder inside, and its README describes both. The other leagues keep their files at the top of the folder.

Query 1: odds across leagues in one table

Every odds package has a game_odds file with the same core columns: game_id, bookmaker, snapshot_type, captured_at, minutes_before_start, moneylines, a spread and a total. That lets one query span leagues. UNION ALL BY NAME lines columns up by name and fills the missing ones with NULL.

duckdb.sql("""
SELECT league, count(DISTINCT game_id) AS games, count(*) AS odds_rows, count(DISTINCT bookmaker) AS books
FROM (
  SELECT 'ncaaf' AS league, * FROM read_csv('ncaaf-odds/game_odds.csv')
  UNION ALL BY NAME SELECT 'mlb'   AS league, * FROM read_csv('mlb-odds/game_odds.csv')
  UNION ALL BY NAME SELECT 'nba'   AS league, * FROM read_csv('nba-history-odds/game_odds.csv')
  UNION ALL BY NAME SELECT 'ncaam' AS league, * FROM read_csv('ncaam-history-odds/game_odds.csv')
  UNION ALL BY NAME SELECT 'nfl'   AS league, * FROM read_csv('nfl-history-odds/game_odds.csv')
) GROUP BY league ORDER BY league
""").show()

On the samples this returns mlb 2 games and 446 rows, nba 3 and 1,373, ncaaf 3 and 3,164, ncaam 3 and 514, and nfl 3 and 1,333, each with 8 books. Two columns differ by league. NBA and college basketball use spread_away_odds, the NFL file has spread_away and spread_away_odds, and the NHL file calls the book column sportsbook. NHL also has no bookmaker, so leave it out of this union and read it alone, as in query 5.

Query 2: the closing line against the score

The NFL packages with odds carry a consensus_close file with the consensus closing spread and total for every game. Join it to games to see how far the result sat from the line. A negative home spread means the home side is favored, so margin plus spread is the amount by which the home side beat or missed the line.

duckdb.sql("""
SELECT g.game_id, g.home_score - g.away_score AS margin, c.consensus_spread_home AS spread_home,
       g.home_score + g.away_score AS points, c.consensus_total,
       g.home_score - g.away_score + c.consensus_spread_home AS margin_vs_spread
FROM read_csv('nfl-history-odds/games.csv') g
JOIN read_csv('nfl-history-odds/consensus_close.csv') c USING (game_id)
ORDER BY game_id
""").show()

The three sample games give margins of 4, -16 and -7 against spreads of 2.5, -4.5 and 1.5. The numbers are descriptions of the market against the outcome. They are not a signal, and three games prove nothing.

NHL has no consensus file. Its odds live in odds_open_close and odds_snapshots, so take the median closing total yourself, as the next query does for the open and the close.

Query 3: plays, with EPA

The NFL History package has every play with expected points added. This gives the mean EPA per play by team in the sample.

duckdb.sql("""
SELECT posteam, count(*) AS plays, round(avg(epa), 3) AS mean_epa
FROM read_csv('nfl-history/plays.csv')
WHERE posteam IS NOT NULL AND epa IS NOT NULL
GROUP BY posteam ORDER BY plays DESC
""").show()

On the sample it returns SEA 176 plays at 0.106, LA 141 at 0.035, NE 90 at -0.143 and KC 88 at -0.010. The paid file has about 1.3 million plays, so the same query needs no change and a season filter.

Query 4: basketball shots and expected points

The NBA and college basketball History packages have plays with court coordinates, distance_ft and x_points, our expected points for the shot. x_points_point_in_time is the same model fitted only on earlier data, for backtests.

duckdb.sql("""
SELECT type_text, count(*) AS shots, round(avg(distance_ft), 1) AS avg_distance_ft, round(avg(x_points), 3) AS avg_x_points
FROM read_csv('nba-history/plays.csv')
WHERE shooting_play AND x_points IS NOT NULL
GROUP BY type_text ORDER BY shots DESC LIMIT 4
""").show()

A jump shot averages 24.7 feet and 1.086 expected points in the sample, a driving layup 2.0 feet and 1.304. Free throws have no location, and the x_points IS NOT NULL filter drops them.

Query 5: NHL, Parquet by the glob

The NHL packages come as Parquet and CSV, one file per season for the large tables. A glob reads them all. filename = true tells you which season file a row came from, and a view over the glob means you write the path once.

duckdb.sql("""
CREATE OR REPLACE VIEW nhl_pbp AS
SELECT * FROM read_parquet('nhl-history/history/package-a/play_by_play_*.parquet', filename = true)
""")
duckdb.sql("""
SELECT regexp_extract(filename, '[0-9]{8}') AS season_file, count(*) AS rows
FROM nhl_pbp GROUP BY 1 ORDER BY 1
""").show()

duckdb.sql("""
SELECT game_id,
       round(avg(total) FILTER (WHERE snapshot_type = 'opening'), 2) AS mean_open_total,
       round(avg(total) FILTER (WHERE snapshot_type = 'closing'), 2) AS mean_close_total,
       count(DISTINCT sportsbook) AS books
FROM read_parquet('nhl-history-odds/history/package-b/odds_open_close_*.parquet')
GROUP BY game_id ORDER BY game_id
""").show()

The first query returns 343 rows for 20252026 and 609 for 20262027. The second returns three games with 8 books each, and open and close totals of 5.81, 6.19 and 6.5. Opening and closing totals are the same in all three samples, so a sample cannot show line movement for the NHL. Do not read a flat line as a feature of the market.

Query 6: graded props and the line history

The Complete tiers add player_props, with an actual value and a result on each row, and line_history, which holds every capture by book and market. Count before you analyze.

duckdb.sql("""
SELECT market, count(*) AS rows, count(*) FILTER (WHERE result IS NULL) AS ungraded
FROM read_csv('nfl-complete/player_props.csv')
GROUP BY market ORDER BY rows DESC LIMIT 4
""").show()

duckdb.sql("""
SELECT market, count(*) AS rows, count(DISTINCT bookmaker) AS books,
       min(minutes_before_start) AS min_mbs, max(minutes_before_start) AS max_mbs
FROM read_csv('nba-complete/line_history.csv')
GROUP BY market ORDER BY rows DESC LIMIT 4
""").show()

On the NFL sample the largest props market is player_anytime_td with 2,518 rows, of which 336 are ungraded, then player_reception_yds with 1,656 and 36 ungraded. In the NBA sample line history, player_points has 5,326 rows from 7 books, captured from 34 up to 1,674 minutes before the start. An ungraded row is one the result could not be matched to, and it should be dropped from any hit-rate count, not read as a loss. The paid line history is Parquet only, so use read_parquet there.

Query 7: a saved view per question

Once a join is right, keep it. A view in the .duckdb file means the next session starts from the join, not from the file names.

con = duckdb.connect("sdhq.duckdb")
con.sql("""
CREATE OR REPLACE VIEW nfl_closes AS
SELECT g.game_id, g.season, g.week, c.consensus_spread_home, c.consensus_total, g.home_score, g.away_score
FROM read_csv('nfl-history-odds/games.csv') g
JOIN read_csv('nfl-history-odds/consensus_close.csv') c USING (game_id)
""")
con.sql("""
SELECT season, week, count(*) AS games,
       round(avg(abs(home_score - away_score + consensus_spread_home)), 1) AS mean_abs_miss
FROM nfl_closes GROUP BY 1, 2 ORDER BY 1, 2
""").show()

To move a CSV into Parquet, COPY (SELECT * FROM read_csv('nfl-history/plays.csv')) TO 'plays.parquet' (FORMAT parquet, COMPRESSION zstd) writes it. We did this with the 534-row sample and read back 534 rows.

What the columns mean in practice

  • `snapshot_type` is opening, closing or snapshot. The college football sample has no closing rows, so check what your file holds before you filter on it. The close is then the latest snapshot per game and book.
  • `minutes_before_start` is on every odds and props row. Filter on it to take a price at a fixed distance from the start.
  • Blank means unknown. Unknown values are blank, never 0. In DuckDB a blank in a numeric column is NULL, so avg skips it. A column that is blank on every row loads as text.
  • `game_id` type differs. NFL and NHL ids are text, and college football and MLB ids are numbers. Cast one side, as in CAST(game_id AS VARCHAR), before you join across leagues.
  • The book column has two names. bookmaker in most files and sportsbook in the NHL ones. Use COALESCE if you union them.
  • `result` on props is over, under, push, or yes or no for yes/no markets. NULL means the row could not be graded.
  • Time is UTC. captured_at and starts_at are UTC. Derive local dates from them, since late games fall on the next calendar day.

When not to use this

  • You want a database server for many users. DuckDB is a single-process engine. Load the files into a warehouse if a team needs shared access.
  • You want to resell the data. The licence allows internal and commercial use and publishing your own derived statistics, not redistribution of the raw files.
  • You want soccer files. Soccer is available on request and served by API for now.
  • You want live data. Odds are pregame only and files refresh monthly.
  • You want a recommendation. The files contain history and nothing else.

Free samples first

Download the sample for a package from sportsdatahq.com/samples/data-packages/<id>-sample.zip and run the query for its family before you buy. The data packages page has the licence, update terms and the refund rule: a full refund before your first download.

Get a free key Or download whole seasons as Parquet

Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.