# Prediction Markets and Derivatives — Fetch historical orderbook snapshots for a Predict.Fun market

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, market_id, and retrieve structured data including continuation flag, reported count, result limit, returned pagination key value, and returned snapshots field for market reference and account inspection, and integration reference.

Documentation: https://openany.si/blockrun/blockrun-prediction-markets-and-derivatives-fetch-historical-orderbook-snapshots-for-a-predict-f/202f6b3e-b8b5-480b-ba5e-39f464a8bbdb/
API ID: 202f6b3e-b8b5-480b-ba5e-39f464a8bbdb
Provider: blockrun
Contract revision: 5
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/blockrun/v1/pm/predictfun/orderbooks
Page update time: 2026-12-03T02:49:53.597Z
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:52.880Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "7500",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Blockrun Fetch historical orderbook snapshots for a Predict.Fun market API

Retrieve historical orderbook snapshots for a Predict.Fun market with the BlockRun API. Provide end\_time in query, market\_id in query, start\_time 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` | Returned snapshots field |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Prediction Markets and Derivatives — Fetch historical orderbook snapshots for a Predict.Fun market 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": 200
        },
        "market_id": {
          "type": "integer",
          "description": "The PredictFun market ID"
        },
        "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)"
        }
      },
      "required": [
        "end_time",
        "market_id",
        "start_time"
      ]
    },
    "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": {}
    }
  }
}
```

## Request example
Scenario: Documentation example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/blockrun/v1/pm/predictfun/orderbooks?end_time=1793450200000&limit=1&market_id=13715&start_time=1793450140000' \
  -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": 0,
    "has_more": false,
    "limit": 1,
    "pagination_key": null
  },
  "snapshots": []
}
```

## 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); market_id in query (integer); start_time in query (integer). 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 200; 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-fetch-historical-orderbook-snapshots-for-a-predict-f/202f6b3e-b8b5-480b-ba5e-39f464a8bbdb/

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