> ## 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.

# Unified historical orderbook

> Kalshi and Polymarket orderbooks in one response shape.

Unified historical orderbook for Kalshi and Polymarket. Supports interval and
unified formats depending on market type.

## Request

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

### Query parameters

<ParamField query="exchange" type="string" required>
  `kalshi` or `polymarket`.
</ParamField>

<ParamField query="market_id" type="string" required>
  Venue-native market ID (Kalshi ticker or Polymarket condition / numeric id).
</ParamField>

<ParamField query="format" type="string">
  `interval` or `unified`. Defaults based on market type when omitted.
</ParamField>

<ParamField query="start_time" type="string">
  Range start in Unix **milliseconds**.
</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>

## Examples

### Polymarket interval market

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

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

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

### Kalshi bracket market

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

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

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