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

# Get Polymarket Market Data Range

> Retrieve raw Polymarket order book events across an inclusive timestamp range using cursor pagination.

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token. Example: `Bearer YOUR_API_KEY`
</ParamField>

### Query Parameters

<ParamField query="condition_id" type="string" required>
  The Polymarket market condition ID. Values are accepted with or without the `0x` prefix and normalized in the response.
</ParamField>

<ParamField query="start_timestamp" type="integer" required>
  Inclusive lower timestamp bound. Accepts Unix seconds or milliseconds.
</ParamField>

<ParamField query="end_timestamp" type="integer" required>
  Inclusive upper timestamp bound. Accepts Unix seconds or milliseconds.
</ParamField>

<ParamField query="cursor" type="string">
  Opaque cursor returned by the previous page for the same market and timestamp range.
</ParamField>

<ParamField query="limit" type="integer">
  Maximum number of records to return per page. Default: `10000`. Max: `100000`.
</ParamField>

## Response

<ResponseField name="market_condition_id" type="string">
  The normalized market condition ID with the `0x` prefix.
</ResponseField>

<ResponseField name="start_timestamp" type="integer">
  Inclusive lower timestamp bound normalized to milliseconds.
</ResponseField>

<ResponseField name="end_timestamp" type="integer">
  Inclusive upper timestamp bound normalized to milliseconds.
</ResponseField>

<ResponseField name="data_count" type="integer">
  Number of records returned in the current page.
</ResponseField>

<ResponseField name="data" type="array">
  Array of raw Polymarket events matching the requested range.
</ResponseField>

<ResponseField name="pagination" type="object">
  Cursor pagination metadata.

  <Expandable title="Pagination fields">
    <ResponseField name="limit" type="integer">
      Maximum page size requested.
    </ResponseField>

    <ResponseField name="has_more" type="boolean">
      Whether another page is available.
    </ResponseField>

    <ResponseField name="next_cursor" type="string">
      Cursor to pass back unchanged to continue the same range query, or `null` when the final page has been reached.
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  The legacy alias `GET /api/v1/market/data/range` remains available for existing integrations.
</Note>

<Warning>
  This endpoint rejects timestamp ranges earlier than `2026-02-08T00:00:00Z`, even though some backfilled Polymarket storage exists earlier for a subset of markets.
</Warning>

## Example

<CodeGroup>
  ```bash Raw HTTP (cURL) theme={null}
  curl -H "Authorization: Bearer YOUR_API_KEY" \
    "https://api.entityml.com/api/v1/polymarket/market/data/range?condition_id=0x0008043c3ed513ecff7ee64380fc943dc73eb3dfb6674f281149efe4769f7515&start_timestamp=1773964800000&end_timestamp=1774051199999&limit=500"
  ```

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

  response = requests.get(
      "https://api.entityml.com/api/v1/polymarket/market/data/range",
      headers={"Authorization": f"Bearer {os.environ['ENTITY_API_KEY']}"},
      params={
          "condition_id": "0x0008043c3ed513ecff7ee64380fc943dc73eb3dfb6674f281149efe4769f7515",
          "start_timestamp": 1773964800000,
          "end_timestamp": 1774051199999,
          "limit": 500,
      },
  )

  print(response.json())
  ```
</CodeGroup>

### Example response

```json theme={null}
{
  "market_condition_id": "0x0008043c3ed513ecff7ee64380fc943dc73eb3dfb6674f281149efe4769f7515",
  "start_timestamp": 1773964800000,
  "end_timestamp": 1774051199999,
  "data_count": 500,
  "data": [
    {
      "market": "0x0008043c3ed513ecff7ee64380fc943dc73eb3dfb6674f281149efe4769f7515",
      "asset_id": "97684905927345553455494278582909124912046930226695064344571162061840768197777",
      "timestamp": "1773966061736",
      "hash": "98894e2c3a5764942f6e6b8183b18cb330985975",
      "bids": [],
      "asks": [
        {
          "price": "0.99",
          "size": "310000"
        }
      ],
      "event_type": "book",
      "received_at": "2026-03-20T00:21:03.548509",
      "worker_id": 24
    }
  ],
  "pagination": {
    "limit": 500,
    "has_more": true,
    "next_cursor": "eyJ2IjoxLCJjb25kaXRpb25faWQiOiIweC4uLiJ9"
  }
}
```

<Tip>
  `next_cursor` is opaque. Pass it back unchanged with the same `condition_id`, `start_timestamp`, and `end_timestamp` to continue paging.
</Tip>
