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

# Polymarket historical orderbook

> Orderbook snapshots per Polymarket token.

Full orderbook snapshots with bids, asks, and derived best bid/ask **per token**.
Polymarket markets have two tokens (YES and NO) per condition; each snapshot row is
for a single token. Use `asset_id` to filter to one token, or omit it to return both.

## Request

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

### Query parameters

<ParamField query="market_id" type="string" required>
  Polymarket condition ID (`0x...`). Also accepts the numeric `source_market_id`.
</ParamField>

<ParamField query="asset_id" type="string">
  CLOB token ID. Omit to return both YES and NO tokens.
</ParamField>

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

## Examples

### Latest snapshots

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

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

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