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.
Fetching
Section titled “Fetching”betflux get prediction-market-closing-lines --league NBA \ --date-from 2026-11-01 --date-to 2026-11-07 --operator KALSHIcurl -s "https://api.betflux.ai/v1/games/NBA_LAL_DET_20261108/prediction-market-closing-lines" \ -H "Authorization: Bearer $BETFLUX_API_KEY" -o pm-closing.parquetrows = bf.prediction_market_closing_lines.rows(league="NBA", date_from="2026-11-01", date_to="2026-11-07")Semantics
Section titled “Semantics”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_CUTOFForFIRST_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 beforegame_startis. opening_*andclosing_odds/_decimal/_impliedare the all-in price: ask plus taker fee. Each end also carries its book:*_bid,*_ask,*_mid,*_micropriceand*_taker_fee.is_mainlineis the closing quote’s flag, as prediction-market-lines sets it.
clv_oddsandclv_impliedare 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, andclv_micropricethe 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.
Columns
Section titled “Columns”| Column | Type | Nullable | Description |
|---|---|---|---|
game_id | string | no | |
league | string | no | |
game_date | string | no | Calendar date (Parquet date, YYYY-MM-DD). |
game_start | string | no | UTC timestamp (Parquet timestamptz). |
home_team | string | no | |
away_team | string | no | |
operator | string | no | Exchange code: KALSHI or POLYMARKET. |
market_type | string | no | Market type, classified as sportsbook-closing-lines classifies a book's market, e.g. SPREAD, MONEYLINE, TOTAL, PLAYER_METRIC_MILESTONE. |
period | string | no | |
scope | string | yes | Reserved for future market scoping; always null. |
market_key | string | no | Global market identity: `OPERATOR:market_external_id`, as in the sportsbook datasets. |
selection_name | string | yes | |
side | string | no | One side of the leg (a row per side when a leg carries several). |
opening_odds | integer | yes | American form of the opening all-in price. |
opening_decimal | number | yes | |
opening_implied | number | yes | All-in cost of one contract at the opening quote: ask plus taker_fee. |
opening_spread | number | yes | |
opening_total | number | yes | |
opening_ts | string | yes | When the opening quote was observed. |
closing_odds | integer | yes | American form of the closing all-in price: the last executable quote before game_start. |
closing_decimal | number | yes | |
closing_implied | number | yes | All-in cost of one contract at the closing quote: ask plus taker_fee. |
closing_spread | number | yes | |
closing_total | number | yes | |
closing_ts | string | yes | When the closing quote was observed. |
min_odds | integer | yes | |
max_odds | integer | yes | |
distinct_odds_count | integer | yes | |
line_move_count | integer | yes | |
pre_game_records | integer | yes | |
live_records | integer | yes | |
first_seen_at | string | yes | UTC timestamp (Parquet timestamptz). |
last_seen_at | string | yes | UTC timestamp (Parquet timestamptz). |
clv_odds | integer | yes | closing − 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_implied | number | yes | opening − 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_ids | string[] | yes | |
selection_player_ids | string[] | yes | |
market_metric | string[] | yes | |
selection_metric | string | yes | |
market_external_id | string | no | Kalshi contract ticker, or Polymarket condition id (`0x…`). |
market_name | string | yes | |
selection_external_id | string | no | Kalshi `<ticker>:yes` or `<ticker>:no`; Polymarket the outcome token id. |
is_mainline | boolean | yes | The closing quote's main-line flag, as prediction-market-lines sets it. |
opening_method | string | yes | AS_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_ts | string | yes | UTC timestamp (Parquet timestamptz). |
first_quote_odds | integer | yes | |
first_quote_implied | number | yes | |
first_quote_spread | number | yes | |
first_quote_total | number | yes | |
opening_bid | number | yes | Best bid of the opening quote's book, dollars per $1 contract. |
opening_ask | number | yes | Best ask of the opening quote's book, before fees. |
opening_mid | number | yes | (bid + ask) / 2 of the opening book; null without a two-sided book. |
opening_microprice | number | yes | Size-weighted mid of the opening book; null without both sizes (candle-era quotes have none). |
opening_taker_fee | number | yes | Taker fee per contract at the opening ask; null when the fee schedule is unknown. |
closing_bid | number | yes | Best bid of the closing quote's book. |
closing_ask | number | yes | Best ask of the closing quote's book, before fees. |
closing_mid | number | yes | (bid + ask) / 2 of the closing book; null without a two-sided book. |
closing_microprice | number | yes | Size-weighted mid of the closing book; null without both sizes. |
closing_taker_fee | number | yes | Taker fee per contract at the closing ask. |
clv_mid | number | yes | opening − 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_microprice | number | yes | opening − closing microprice; null when either end lacks sizes, the contracts differ or the closing book is wider than 10 cents. |
outcome_key | string | yes | Same-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_key | string | yes | Same-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_min | number | yes | The 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_max | number | yes | The highest result that wins, as outcome_min. Null when unbounded above or unkeyed. |
outcome_push | number | yes | The 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_status | string | yes | How 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_parity | string | yes | For 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_key | string | yes | Same-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_version | string | yes | Version 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. |