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.
Fetching
Section titled “Fetching”Per-game only, like sportsbook-lines:
betflux get prediction-market-lines --game NBA_LAL_DET_20261108 --output pm-lines.parquetcurl -s "https://api.betflux.ai/v1/games/NBA_LAL_DET_20261108/prediction-market-lines" \ -H "Authorization: Bearer $BETFLUX_API_KEY" -o pm-lines.parquetdata = 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.
Live games
Section titled “Live games”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},KALSHIorPOLYMARKET) gives one row per contract side currently believed to be quotable.GET /v1/games/{game_id}/prediction-market-lines/live/segmentsanswers withhistory: "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:
betflux live-board NBA_LAL_DET_20261108 --dataset prediction-market-linesReading 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")Reading the grain
Section titled “Reading the grain”- A row is one side of a binary contract: Kalshi’s YES or NO leg, or one
Polymarket outcome token.
selection_external_idnames it (<ticker>:yes,<ticker>:no, or the token id);market_external_idis the Kalshi ticker or the Polymarket condition id. structureis alwaysMECE: 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/totaland 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) andoperator_categorykeep the exchange’s own vocabulary. is_mainlineis 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.
Price columns
Section titled “Price columns”implied_probabilityandoddsare 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 pointspread) describe the leg’s order book. On Kalshi the ask of one leg is 1 minus the best bid of the other.mid_fair_*andmicroprice_fair_*are the exchange’s fair value: the mid, and the mid weighted toward the side with less size behind it.fair_methodnames the one to read first (MICROPRICEwhen both sizes are known, elseMID). An exchange has no built-in margin, so nothing is de-vigged: a contract’s YES and NO mids sum to exactly 1.price_sourcesays howaskwas 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.
Coverage
Section titled “Coverage”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.
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. |
timestamp | string | no | UTC timestamp (Parquet timestamptz). |
market_external_id | string | no | Kalshi contract ticker, or Polymarket condition id (`0x…`). |
market_type | string | no | Market type as of this row, classified as sportsbook-lines classifies a book's market, e.g. SPREAD, MONEYLINE, TOTAL, PLAYER_METRIC_MILESTONE. |
structure | string | no | Always MECE: one binary contract, whose two sides cover every outcome. |
period | string | no | |
market_status | string | yes | |
market_name | string | no | |
sgp | boolean | no | |
market_team_ids | string[] | yes | |
market_player_ids | string[] | yes | |
market_min_amount | number | yes | |
market_max_amount | number | yes | |
market_period_elapsed_start_sec | integer | yes | |
market_period_elapsed_end_sec | integer | yes | |
market_ordinal_position | integer | yes | |
market_aggregation | string | yes | |
market_metric | string[] | yes | |
selection_count | integer | no | |
operator_status | string | yes | |
operator_market_type | string | yes | Kalshi series, or Polymarket `sportsMarketType`. |
operator_category | string | yes | The family the contract was classified under, e.g. `kalshi/NBA:1Q`. |
paired_odds_complement | boolean | no | |
selection_external_id | string | no | Kalshi `<ticker>:yes` or `<ticker>:no`; Polymarket the outcome token id. |
selection_name | string | yes | |
selection_status | string | yes | |
side | string[] | yes | |
selection_team_ids | string[] | yes | |
selection_player_ids | string[] | yes | |
selection_min_amount | number | yes | |
selection_max_amount | number | yes | |
selection_metric | string | yes | |
spread | number | yes | |
total | number | yes | |
odds | integer | no | American form of implied_probability, rounded. |
decimal_odds | number | no | |
implied_probability | number | no | All-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. |
bid | number | yes | The leg's best bid, in dollars per $1 contract. |
ask | number | yes | The leg's best ask before fees. Kalshi: 1 − the opposite leg's best bid. |
taker_fee | number | yes | Taker fee per contract at ask; null when the fee schedule is unknown. |
fee_schedule | string | yes | |
price_source | string | yes | How ask was read: from the order book, or from an archived minute candle (CANDLE_*) before polling began. |
last_trade_price | number | yes | |
volume | number | yes | |
open_interest | number | yes | |
bid_size | number | yes | Quantity at bid: contracts on Kalshi, shares on Polymarket, each paying $1. Null on candle-era rows. |
ask_size | number | yes | Quantity at ask. On Kalshi, the size of the opposite leg's best bid. Null on candle-era rows. |
quoted_spread | number | yes | ask − bid of the leg's book. Named apart from `spread`, the point spread. |
fair_method | string | yes | Which fair price to read first: MICROPRICE when both sizes are known, else MID; null when the leg has no two-sided book. |
mid_fair_prob | number | yes | (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_american | number | yes | |
mid_fair_decimal | number | yes | |
microprice_fair_prob | number | yes | (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_american | number | yes | |
microprice_fair_decimal | number | yes | |
market_key | string | yes | Global market identity: `OPERATOR:market_external_id`, as in the sportsbook datasets. |
is_mainline | boolean | yes | True 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_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. |