> ## Documentation Index
> Fetch the complete documentation index at: https://docs.probsights.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kalshi historical orderbook

> Full orderbook snapshots for Kalshi markets.

Returns full orderbook snapshots with YES bids, NO bids, and derived best bid/ask
from the YES perspective. Reads stored snapshots — no live Kalshi API calls on read.

Without `start_time` / `end_time`, returns the most recent snapshots. With a time
range, downsampled to `granularity` buckets.

## Request

```
https://api.probsights.com/historical/kalshi/orderbook
```

### Query parameters

<ParamField query="market_id" type="string" required>
  Kalshi market ticker (e.g. `KXBTC15M-26JUL111100`).
</ParamField>

<ParamField query="start_time" type="string">
  Range start in Unix **milliseconds**. Must be set together with `end_time`.
</ParamField>

<ParamField query="end_time" type="string">
  Range end in Unix **milliseconds**.
</ParamField>

<ParamField query="granularity" type="string" default="1m">
  Bucket size for range queries: `1m` or `5m`.
</ParamField>

<ParamField query="limit" type="integer" default="100">
  Max rows per page (1–200).
</ParamField>

<ParamField query="pagination_key" type="string">
  Cursor from the previous response `pagination.pagination_key`.
</ParamField>

## Response

<ResponseField name="snapshots" type="array">
  Array of orderbook snapshot objects.
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata (`limit`, `count`, `has_more`, `pagination_key`).
</ResponseField>

### Snapshot fields

<ResponseField name="market_id" type="string">
  Kalshi market ticker.
</ResponseField>

<ResponseField name="timestamp" type="integer">
  Snapshot time in Unix milliseconds.
</ResponseField>

<ResponseField name="yes_bids" type="array">
  YES bid ladder (`price` string, `size` number).
</ResponseField>

<ResponseField name="no_bids" type="array">
  NO bid ladder.
</ResponseField>

<ResponseField name="best_yes_bid" type="number">
  Top-of-book YES bid.
</ResponseField>

<ResponseField name="best_yes_ask" type="number">
  Top-of-book YES ask.
</ResponseField>

<ResponseField name="mid" type="number">
  Mid price when both sides exist.
</ResponseField>

<ResponseField name="spread" type="number">
  `best_yes_ask - best_yes_bid`.
</ResponseField>

## Examples

### Latest snapshots

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "X-API-Key: YOUR_API_KEY" \
    "https://api.probsights.com/historical/kalshi/orderbook?market_id=KXBTC15M-26JUL111100&limit=5"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.probsights.com/historical/kalshi/orderbook",
      headers={"X-API-Key": "YOUR_API_KEY"},
      params={"market_id": "KXBTC15M-26JUL111100", "limit": 5},
  )
  ```
</CodeGroup>
