Skip to main content

Getting Orderbook Data

The Get Market Orderbook endpoint returns the current state of bids for a specific market.

Request Format

No authentication is required for this endpoint.

Example Request

Response Structure

The orderbook response is wrapped in an orderbook_fp object containing two arrays of bids: yes_dollars for YES positions and no_dollars for NO positions. Each bid is a two-element string array: [price_dollars, count_fp].
  • price_dollars: Price as a dollar string (e.g., "0.4200" = $0.42)
  • count_fp: Number of contracts as a fixed-point string (e.g., "13.00" = 13 contracts)
Both values are strings to support subpenny pricing and fractional contract sizes. See Fixed-Point Migration for details.

Example Response

Understanding the Arrays

  • First element: Price in dollars as a string (e.g., "0.4200")
  • Second element: Number of contracts as a fixed-point string (e.g., "13.00")
  • Arrays are sorted by price in ascending order
  • The highest bid (best bid) is the last element in each array

Why Only Bids?

Important: Kalshi’s orderbook only returns bids, not asks. This is because in binary prediction markets, there’s a reciprocal relationship between YES and NO positions.
In binary prediction markets, every position has a complementary opposite:
  • A YES BID at price X is equivalent to a NO ASK at price ($1.00 - X)
  • A NO BID at price Y is equivalent to a YES ASK at price ($1.00 - Y)

The Reciprocal Relationship

Since binary markets must sum to $1.00, these relationships always hold: This reciprocal nature means that by showing only bids, the orderbook provides complete market information while avoiding redundancy.

Calculating Spreads

To find the bid-ask spread for a market:
  1. YES spread:
    • Best YES bid: Highest price in the yes_dollars array
    • Best YES ask: $1.00 - (Highest price in the no_dollars array)
    • Spread = Best YES ask - Best YES bid
  2. NO spread:
    • Best NO bid: Highest price in the no_dollars array
    • Best NO ask: $1.00 - (Highest price in the yes_dollars array)
    • Spread = Best NO ask - Best NO bid

Example Calculation

Working with Orderbook Data

Display Best Prices

Calculate Market Depth

Next Steps