# Prediction Markets and Derivatives — Get historical orderbook snapshots for a token

Get historical orderbook snapshots data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by BlockRun, pass parameters such as end_time, limit, start_time, and retrieve structured data including continuation flag, reported count, result limit, returned pagination key value, and returned asks field for market reference and account inspection, and integration reference.

Documentation: https://openany.si/blockrun/blockrun-prediction-markets-and-derivatives-get-historical-orderbook-snapshots-for-a-token/9225e926-166e-4968-a3de-7fd02c3923f6/
API ID: 9225e926-166e-4968-a3de-7fd02c3923f6
Provider: blockrun
Contract revision: 5
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/blockrun/v1/pm/polymarket/orderbooks
Page update time: 2026-12-03T02:49:55.419Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.0075 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:49:54.486Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "7500",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Blockrun Get historical orderbook snapshots for a token API

Retrieve historical orderbook snapshots for a token with the BlockRun API. Provide end\_time in query, start\_time in query, token\_id in query. Read the response using the field paths below, preserving identifiers and the declared value types when mapping results.

## What You Can Build

- **Market reference and account inspection**: Keep market, asset and account identities distinct when interpreting records.
- **Integration reference**: Use the selected request format and keep source identifiers with the returned result.

## Documented Response Fields

| Field | Meaning |
| --- | --- |
| `pagination.has_more` | Continuation flag |
| `pagination.count` | Reported count |
| `pagination.limit` | Result limit |
| `pagination.pagination_key` | Returned pagination key value (nullable in the reference) |
| `snapshots[].asks` | Returned asks field |
| `snapshots[].assetId` | Returned asset id field |
| `snapshots[].bids` | Returned bids field |
| `snapshots[].hash` | Returned hash field |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Prediction Markets and Derivatives — Get historical orderbook snapshots for a token request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "end_time": {
          "type": "integer",
          "description": "End time in Unix timestamp (milliseconds)"
        },
        "limit": {
          "type": "integer",
          "description": "Maximum number of snapshots to return",
          "minimum": 1,
          "maximum": 2000
        },
        "pagination_key": {
          "type": [
            "string",
            "null"
          ],
          "description": "Pagination key to get the next chunk of data"
        },
        "start_time": {
          "type": "integer",
          "description": "Start time in Unix timestamp (milliseconds)"
        },
        "token_id": {
          "type": "string",
          "description": "The token ID (asset) for the Polymarket market"
        }
      },
      "required": [
        "end_time",
        "start_time",
        "token_id"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "pagination": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer"
        },
        "has_more": {
          "type": "boolean"
        },
        "limit": {
          "type": "integer"
        },
        "pagination_key": {
          "type": "null"
        }
      }
    },
    "snapshots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "asks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "price": {
                  "type": "number"
                },
                "size": {
                  "type": "integer"
                }
              }
            }
          },
          "assetId": {
            "type": "string"
          },
          "bids": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "price": {
                  "type": "number"
                },
                "size": {
                  "type": "integer"
                }
              }
            }
          },
          "hash": {
            "type": "string"
          },
          "indexedAt": {
            "type": "integer"
          },
          "market": {
            "type": "string"
          },
          "tickSize": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer"
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Documentation example (source abbreviated)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/blockrun/v1/pm/polymarket/orderbooks?end_time=1793450223000&limit=1&start_time=1793450103000&token_id=42356562910850310722772587374429042669248036407566323679593011382225452967645' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "pagination": {
    "count": 1,
    "has_more": false,
    "limit": 1,
    "pagination_key": null
  },
  "snapshots": [
    {
      "asks": [
        {
          "price": 0.99,
          "size": 4238
        },
        {
          "price": 0.98,
          "size": 2170
        },
        {
          "price": 0.96,
          "size": 1160
        },
        {
          "price": 0.93,
          "size": 1370
        },
        {
          "price": 0.88,
          "size": 810
        }
      ],
      "assetId": "42356562910850310722772587374429042669248036407566323679593011382225452967645",
      "bids": [
        {
          "price": 0.01,
          "size": 2200
        },
        {
          "price": 0.02,
          "size": 2170
        },
        {
          "price": 0.04,
          "size": 1160
        },
        {
          "price": 0.07,
          "size": 1370
        },
        {
          "price": 0.12,
          "size": 810
        }
      ],
      "hash": "66f0e1a0a91f1d223ba477751504eaefe0886f11",
      "indexedAt": 1793450160234,
      "market": "0x54a1bfbab3a9ebd2761ec2bc5f06b6c7b03aa06eae0de40f25c2bcfec1723673",
      "tickSize": "0.010000000",
      "timestamp": 1793450160182
    }
  ]
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Which inputs identify this request?
Provide end_time in query (integer); start_time in query (integer); token_id in query (string). Keep identifiers and URLs in the formats documented for this implementation.

### Which pagination or result-size inputs are exposed?
limit is integer with minimum 1 and maximum 2000; start_time is integer. Use only the exposed inputs and the continuation metadata returned by this endpoint; a size limit is not automatically a page or cursor.

### What type does end_time use?
end_time uses the JSON type integer in query. Preserve that type; strings, numbers, booleans and arrays are not interchangeable.

### Where do URL parameters belong?
Use the documented path and query inputs. This GET implementation does not use a JSON request body; keep path values and URL query values in their declared locations.

### Which API key should I use?
Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

### Where can I check the current request price?
Check the pricing area for the selected API implementation. Follow its billing unit, quantity and any request-dependent rules before sending the request.

## Available implementations
- blockrun: https://openany.si/blockrun/blockrun-prediction-markets-and-derivatives-get-historical-orderbook-snapshots-for-a-token/9225e926-166e-4968-a3de-7fd02c3923f6/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
