Skip to content
Product Documentation

prediction-market-lines

The exchange counterpart of sportsbook-lines: one row per change-only observation per (exchange, contract, side) for every per-game contract Kalshi and Polymarket list on a game, from the first quote through game end. Rows run from a few hundred on a quiet game to about 200,000 on the busiest. Read Prediction markets vs sportsbooks first: an exchange price means something different from a book’s.

Per-game only, like sportsbook-lines:

Terminal window
betflux get prediction-market-lines --game NBA_LAL_DET_20261108 --output pm-lines.parquet
Terminal window
curl -s "https://api.betflux.ai/v1/games/NBA_LAL_DET_20261108/prediction-market-lines" \
-H "Authorization: Bearer $BETFLUX_API_KEY" -o pm-lines.parquet
data = bf.prediction_market_lines.raw("NBA_LAL_DET_20261108")
rows = bf.prediction_market_lines.game("NBA_LAL_DET_20261108", operator="KALSHI", mainline=True)

A game counts once per billing period whichever of its datasets you read, so the exchange files of a game you already read for its books are free. The prediction-market datasets are a plan feature (limits.prediction_markets on /v1/me); every current plan includes them.

Before a game settles, prediction-market-lines serves the current price of every contract, not its history. The price history on this page arrives with the final file, after the game.

  • GET /v1/games/{game_id}/prediction-market-lines/live/board (and /live/board/{operator}, KALSHI or POLYMARKET) gives one row per contract side currently believed to be quotable.
  • GET /v1/games/{game_id}/prediction-market-lines/live/segments answers with history: "after_settlement" and no segments.

Board rows are provisional, and the hand-off to the final file works as described under sportsbook-lines § Live games. The CLI and SDK take the dataset by name:

Terminal window
betflux live-board NBA_LAL_DET_20261108 --dataset prediction-market-lines

Reading the history of an unsettled game (betflux get, live-tail, .game(), .raw()) fails with a message that says it arrives after settlement; in the SDK that is LiveHistoryUnavailableError.

board = bf.prediction_market_lines.live_board("NBA_LAL_DET_20261108")
  • A row is one side of a binary contract: Kalshi’s YES or NO leg, or one Polymarket outcome token. selection_external_id names it (<ticker>:yes, <ticker>:no, or the token id); market_external_id is the Kalshi ticker or the Polymarket condition id.
  • structure is always MECE: the two sides of a contract cover every outcome. A spread or total ladder is one contract per strike.
  • Contracts are classified into the same market_type, period, side, spread / total and player columns the sportsbook datasets use, so a filter that works on sportsbook-lines works here. operator_market_type (the Kalshi series or Polymarket market type) and operator_category keep the exchange’s own vocabulary.
  • is_mainline is true on every full-game moneyline, and on the full-game spread and total strike whose mid is nearest 0.50. It is decided per snapshot, so it can move between strikes as prices move.
  • A row is written when the leg’s executable price, book or volume changes.
  • implied_probability and odds are the all-in cost of buying one contract of the leg now: the best ask plus the exchange’s taker fee (just the ask when the fee schedule is unknown). This is what a bettor pays, the counterpart of a book’s posted price.
  • bid, ask, bid_size, ask_size, quoted_spread (ask − bid, named apart from the point spread) describe the leg’s order book. On Kalshi the ask of one leg is 1 minus the best bid of the other.
  • mid_fair_* and microprice_fair_* are the exchange’s fair value: the mid, and the mid weighted toward the side with less size behind it. fair_method names the one to read first (MICROPRICE when both sizes are known, else MID). An exchange has no built-in margin, so nothing is de-vigged: a contract’s YES and NO mids sum to exactly 1.
  • price_source says how ask was read: from the order book, or from an archived minute candle (CANDLE_*) for Kalshi history from before polling began. Candle-era rows have no sizes, so no microprice.

Kalshi and Polymarket per-game contracts in MLB, NBA, NHL, NFL, NCAAM and NCAAF, only for games an exchange listed. Polymarket rows start at 2026-10-16, when polling began; earlier Polymarket history is not served.

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.
timestampstringnoUTC timestamp (Parquet timestamptz).
market_external_idstringnoKalshi contract ticker, or Polymarket condition id (`0x…`).
market_typestringnoMarket type as of this row, classified as sportsbook-lines classifies a book's market, e.g. SPREAD, MONEYLINE, TOTAL, PLAYER_METRIC_MILESTONE.
structurestringnoAlways MECE: one binary contract, whose two sides cover every outcome.
periodstringno
market_statusstringyes
market_namestringno
sgpbooleanno
market_team_idsstring[]yes
market_player_idsstring[]yes
market_min_amountnumberyes
market_max_amountnumberyes
market_period_elapsed_start_secintegeryes
market_period_elapsed_end_secintegeryes
market_ordinal_positionintegeryes
market_aggregationstringyes
market_metricstring[]yes
selection_countintegerno
operator_statusstringyes
operator_market_typestringyesKalshi series, or Polymarket `sportsMarketType`.
operator_categorystringyesThe family the contract was classified under, e.g. `kalshi/NBA:1Q`.
paired_odds_complementbooleanno
selection_external_idstringnoKalshi `<ticker>:yes` or `<ticker>:no`; Polymarket the outcome token id.
selection_namestringyes
selection_statusstringyes
sidestring[]yes
selection_team_idsstring[]yes
selection_player_idsstring[]yes
selection_min_amountnumberyes
selection_max_amountnumberyes
selection_metricstringyes
spreadnumberyes
totalnumberyes
oddsintegernoAmerican form of implied_probability, rounded.
decimal_oddsnumberno
implied_probabilitynumbernoAll-in cost of buying one contract of this leg at its best ask: ask plus taker_fee (just ask when the fee is unknown). What a bettor pays; the counterpart of a book's posted price.
bidnumberyesThe leg's best bid, in dollars per $1 contract.
asknumberyesThe leg's best ask before fees. Kalshi: 1 − the opposite leg's best bid.
taker_feenumberyesTaker fee per contract at ask; null when the fee schedule is unknown.
fee_schedulestringyes
price_sourcestringyesHow ask was read: from the order book, or from an archived minute candle (CANDLE_*) before polling began.
last_trade_pricenumberyes
volumenumberyes
open_interestnumberyes
bid_sizenumberyesQuantity at bid: contracts on Kalshi, shares on Polymarket, each paying $1. Null on candle-era rows.
ask_sizenumberyesQuantity at ask. On Kalshi, the size of the opposite leg's best bid. Null on candle-era rows.
quoted_spreadnumberyesask − bid of the leg's book. Named apart from `spread`, the point spread.
fair_methodstringyesWhich fair price to read first: MICROPRICE when both sizes are known, else MID; null when the leg has no two-sided book.
mid_fair_probnumberyes(bid + ask) / 2. An exchange has no built-in margin, so there is no de-vig: on a binary contract the YES and NO mids sum to exactly 1.
mid_fair_americannumberyes
mid_fair_decimalnumberyes
microprice_fair_probnumberyes(bid × ask_size + ask × bid_size) / (bid_size + ask_size): the mid weighted toward the side with less size behind it. Null without both sizes.
microprice_fair_americannumberyes
microprice_fair_decimalnumberyes
market_keystringyesGlobal market identity: `OPERATOR:market_external_id`, as in the sportsbook datasets.
is_mainlinebooleanyesTrue on every full-game moneyline, and on the full-game total and spread strike whose mid is nearest 0.50 (the spread on the favourite's ladder). Period lines and props are false. Decided per snapshot, so it can move between strikes as prices move.
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.