Skip to content
Product Documentation

prediction-market-closing-lines

The exchange counterpart of sportsbook-closing-lines: one row per (game, exchange, contract, side), with where the side opened, where it closed and how far it moved. Roughly 100 to 2,000 rows per game. See Prediction markets vs sportsbooks for how exchange prices compare with book odds.

Terminal window
betflux get prediction-market-closing-lines --league NBA \
--date-from 2026-11-01 --date-to 2026-11-07 --operator KALSHI
Terminal window
curl -s "https://api.betflux.ai/v1/games/NBA_LAL_DET_20261108/prediction-market-closing-lines" \
-H "Authorization: Bearer $BETFLUX_API_KEY" -o pm-closing.parquet
rows = bf.prediction_market_closing_lines.rows(league="NBA", date_from="2026-11-01", date_to="2026-11-07")

The same rules as sportsbook-closing-lines, applied to exchange quotes:

  • Closing is the last executable quote strictly before game_start: the contract open and a valid ask. An exchange whose event went dark before the start has no close for that event.
  • Opening is taken at the league’s opening cutoff, with opening_method (AS_OF_CUTOFF or FIRST_AFTER_CUTOFF) as for books. Only a quote whose book is at most 10 cents wide (ask − bid, a missing bid counting as 0) opens; opening_* is null when no quote before game_start is.
  • opening_* and closing_odds / _decimal / _implied are the all-in price: ask plus taker fee. Each end also carries its book: *_bid, *_ask, *_mid, *_microprice and *_taker_fee.
  • is_mainline is the closing quote’s flag, as prediction-market-lines sets it.
  • clv_odds and clv_implied are computed as for books, on the all-in price: what a bettor who bought at the open gained against buying at the close, fees included.
  • clv_mid = opening mid − closing mid, and clv_microprice the same on the microprice: the market’s own move, free of changes in spread and fee.
  • All are null when either end lacks the price, the opening and closing quotes are on different contracts, or the closing book is wider than 10 cents.
ColumnTypeNullableDescription
game_idstringno
leaguestringno
game_datestringnoCalendar date (Parquet date, YYYY-MM-DD).
game_startstringnoUTC timestamp (Parquet timestamptz).
home_teamstringno
away_teamstringno
operatorstringnoExchange code: KALSHI or POLYMARKET.
market_typestringnoMarket type, classified as sportsbook-closing-lines classifies a book's market, e.g. SPREAD, MONEYLINE, TOTAL, PLAYER_METRIC_MILESTONE.
periodstringno
scopestringyesReserved for future market scoping; always null.
market_keystringnoGlobal market identity: `OPERATOR:market_external_id`, as in the sportsbook datasets.
selection_namestringyes
sidestringnoOne side of the leg (a row per side when a leg carries several).
opening_oddsintegeryesAmerican form of the opening all-in price.
opening_decimalnumberyes
opening_impliednumberyesAll-in cost of one contract at the opening quote: ask plus taker_fee.
opening_spreadnumberyes
opening_totalnumberyes
opening_tsstringyesWhen the opening quote was observed.
closing_oddsintegeryesAmerican form of the closing all-in price: the last executable quote before game_start.
closing_decimalnumberyes
closing_impliednumberyesAll-in cost of one contract at the closing quote: ask plus taker_fee.
closing_spreadnumberyes
closing_totalnumberyes
closing_tsstringyesWhen the closing quote was observed.
min_oddsintegeryes
max_oddsintegeryes
distinct_odds_countintegeryes
line_move_countintegeryes
pre_game_recordsintegeryes
live_recordsintegeryes
first_seen_atstringyesUTC timestamp (Parquet timestamptz).
last_seen_atstringyesUTC timestamp (Parquet timestamptz).
clv_oddsintegeryesclosing − opening all-in price in American cents from even money, as sportsbook-closing-lines; null when the opening and closing contracts differ or the closing book is wider than 10 cents.
clv_impliednumberyesopening − closing all-in implied probability, as sportsbook-closing-lines; null when the opening and closing contracts differ or the closing book is wider than 10 cents.
market_player_idsstring[]yes
selection_player_idsstring[]yes
market_metricstring[]yes
selection_metricstringyes
market_external_idstringnoKalshi contract ticker, or Polymarket condition id (`0x…`).
market_namestringyes
selection_external_idstringnoKalshi `<ticker>:yes` or `<ticker>:no`; Polymarket the outcome token id.
is_mainlinebooleanyesThe closing quote's main-line flag, as prediction-market-lines sets it.
opening_methodstringyesAS_OF_CUTOFF (the quote at the league's opening cutoff) or FIRST_AFTER_CUTOFF (the first quote after it, when the exchange was not live at the cutoff or its book was wider than 10 cents). Only a quote whose book is at most 10 cents wide opens, a missing bid counting as 0; null when no quote before game_start is.
opening_cutoff_tsstringyesUTC timestamp (Parquet timestamptz).
first_quote_oddsintegeryes
first_quote_impliednumberyes
first_quote_spreadnumberyes
first_quote_totalnumberyes
opening_bidnumberyesBest bid of the opening quote's book, dollars per $1 contract.
opening_asknumberyesBest ask of the opening quote's book, before fees.
opening_midnumberyes(bid + ask) / 2 of the opening book; null without a two-sided book.
opening_micropricenumberyesSize-weighted mid of the opening book; null without both sizes (candle-era quotes have none).
opening_taker_feenumberyesTaker fee per contract at the opening ask; null when the fee schedule is unknown.
closing_bidnumberyesBest bid of the closing quote's book.
closing_asknumberyesBest ask of the closing quote's book, before fees.
closing_midnumberyes(bid + ask) / 2 of the closing book; null without a two-sided book.
closing_micropricenumberyesSize-weighted mid of the closing book; null without both sizes.
closing_taker_feenumberyesTaker fee per contract at the closing ask.
clv_midnumberyesopening − closing mid: the market's own move, free of spread and fee changes; null when either end has no mid, the contracts differ or the closing book is wider than 10 cents.
clv_micropricenumberyesopening − closing microprice; null when either end lacks sizes, the contracts differ or the closing book is wider than 10 cents.
outcome_keystringyesSame-result key: a 16-character hash shared by every quote, at any book or exchange, that pays on the same game result (same game, player or team, stat, period, clock window, and the range in outcome_min, outcome_max and outcome_push, or the parity in outcome_parity). Null for markets without a single range of results: either-team margin bands, quarter lines (x.25, x.75), Tie No, and first-scorer, most-of, race-to and method markets. Null on games built before v2.
settlement_keystringyesSame-price key: outcome_key plus the venue's rules for the unusual cases that can change this bet (overtime, a player who does not take part, a shortened game, a result on the line), read for a straight bet at the time of the quote. Quotes sharing it are the same contract, so their prices compare directly. Null when outcome_key is null, when a rule it needs is not stated (terms_status unknown), and for venues without registered rules. Null on games built before v2.
outcome_minnumberyesThe lowest result that wins, in whole steps of the stat: Over 25.5 is 26. For moneylines, spreads and winning margins the result is the score margin between the game's two teams, ordered by team id. For overtime markets the result is the number of overtime periods (extra innings in MLB) played: 'reaches overtime' Yes is 1, No has outcome_max 0. Null when unbounded below or unkeyed.
outcome_maxnumberyesThe highest result that wins, as outcome_min. Null when unbounded above or unkeyed.
outcome_pushnumberyesThe result that neither wins nor loses: a whole-number line, or a level score on a two-way moneyline. Null when there is none.
terms_statusstringyesHow the rules in settlement_key are known: verified (the venue's own text), inferred (a general clause or other venues' text), unknown (a needed rule is not stated; settlement_key is null). Null on games built before v2.
outcome_paritystringyesFor odd/even markets, the result that wins: odd or even, on the game's combined score or the one team's score (0 counts as even). outcome_min, outcome_max and outcome_push are then null. Null for every other market and when unkeyed. Null on games built before v4.
offer_keystringyesSame-offer key: a 16-character hash of market_key, selection_external_id and the line the venue quoted (its own line field, else spread, else total), so it names one bet at one line at one venue. Some books keep a selection id while the line moves under it (FanDuel main and period lines, team totals and player over/unders; Pinnacle player props); each line is then a new offer_key under one selection_external_id. Null on games built before v5.
dataset_versionstringyesVersion of the dataset this game's file was built at, e.g. `v5`. Games in one pull can differ: versions of a compatibility line only add columns or carry documented changes (see `versions` on /v1/datasets). Columns added after a game's version read null for it. Files built before this column existed lack it entirely (null when read with DuckDB `union_by_name = true`); the `X-Betflux-Dataset-Version` response header still names their version.