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

> Retrieve raw Polymarket order book events for a specific market condition and UTC date.

## 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. If you only have a slug or Polymarket URL, use [Look Up Polymarket Slug](/api-reference/endpoint/get-polymarket-slug-lookup).
</ParamField>

<ParamField query="date" type="string" required>
  UTC date in `YYYY-MM-DD` format. Orderbook data exists for a subset of Polymarket markets from `2025-09-01`, but coverage is not continuous. Broad Polymarket crypto-related coverage begins on `2026-02-04`, and broad all-market capture begins on `2026-04-02`, with known April 2026 quality exceptions. This endpoint currently rejects dates earlier than `2026-02-08`. Use [Get Polymarket Market Date Range](/api-reference/endpoint/get-polymarket-market-date-range) to inspect stored availability for a specific market.
</ParamField>

<ParamField query="offset" type="integer">
  Number of filtered records to skip. Default: `0`.
</ParamField>

<ParamField query="limit" type="integer">
  Maximum number of filtered records to return. 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="date" type="string">
  The requested UTC date.
</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. Each event can include the following fields:

  <Expandable title="Event fields">
    <ResponseField name="market" type="string">
      Market condition ID.
    </ResponseField>

    <ResponseField name="asset_id" type="string">
      CLOB token ID.
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      Event timestamp in milliseconds.
    </ResponseField>

    <ResponseField name="hash" type="string">
      Unique hash for the event.
    </ResponseField>

    <ResponseField name="event_type" type="string">
      Event type, typically `"book"` or `"price_change"`.
    </ResponseField>

    <ResponseField name="bids" type="array">
      Array of bid orders with `price` and `size` fields. Present on snapshot-style records.
    </ResponseField>

    <ResponseField name="asks" type="array">
      Array of ask orders with `price` and `size` fields. Present on snapshot-style records.
    </ResponseField>

    <ResponseField name="changes" type="array">
      Array of price changes with `price`, `side`, and `size` fields. Present on incremental records.
    </ResponseField>

    <ResponseField name="received_at" type="string">
      ISO timestamp when the event was recorded.
    </ResponseField>

    <ResponseField name="worker_id" type="integer">
      Internal ingestion worker identifier when present.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata with `offset`, `limit`, `total_count`, and `has_more`.
</ResponseField>

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

<Tip>
  For arbitrary windows across one or more days, use [Get Polymarket Market Data Range](/api-reference/endpoint/get-polymarket-market-data-range).
</Tip>

## Example

<CodeGroup>
  ```python Python SDK theme={null}
  from entityml import EntityMLClient

  client = EntityMLClient(api_key="YOUR_API_KEY")

  data = client.polymarket.get_market_data(
      condition_id="0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
      date="2026-03-20",
  )

  print(data["data_count"])
  ```

  ```bash CLI theme={null}
  export ENTITY_API_KEY="YOUR_API_KEY"

  entityml polymarket market-data \
    --condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4 \
    --date 2026-03-20
  ```

  ```bash Raw HTTP (cURL) theme={null}
  curl -H "Authorization: Bearer YOUR_API_KEY" \
    "https://api.entityml.com/api/v1/polymarket/market/data?condition_id=0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4&date=2026-03-20&offset=0&limit=500"
  ```

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

  api_key = os.environ.get('ENTITY_API_KEY')

  response = requests.get(
      'https://api.entityml.com/api/v1/polymarket/market/data',
      headers={'Authorization': f'Bearer {api_key}'},
      params={
          'condition_id': '0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4',
          'date': '2026-03-20',
          'offset': 0,
          'limit': 500,
      }
  )

  print(response.json())
  ```

  ```typescript TypeScript theme={null}
  const params = new URLSearchParams({
    condition_id: '0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4',
    date: '2026-03-20',
    offset: '0',
    limit: '500'
  });

  const response = await fetch(
    `https://api.entityml.com/api/v1/polymarket/market/data?${params}`,
    {
      headers: {
        'Authorization': `Bearer ${process.env.ENTITY_API_KEY}`
      }
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

### Example response

```json theme={null}
{
  "market_condition_id": "0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
  "date": "2026-03-20",
  "data_count": 47,
  "data": [
    {
      "market": "0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
      "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": {
    "offset": 0,
    "limit": 500,
    "total_count": 47,
    "has_more": false
  }
}
```
