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

# EntityML Market Data API

> Retrieve real-time and historical Polymarket and Kalshi order book data.

<Warning>
  **Historical Data Availability** — Coverage is market-specific.

  * Orderbook data exists for a subset of markets from **2025-09-01** on Polymarket and **2026-02-17** for Kalshi, but coverage is not continuous.
  * Broad Polymarket crypto-related market coverage begins on **2026-02-04**. Broad Kalshi crypto-related market coverage begins on **2026-02-25**.
  * Broad all-market capture begins on **2026-04-02** for Polymarket and **2026-03-31** for Kalshi, with known April 2026 quality exceptions.

  Use the date-range endpoints and [Data Quality](/data-quality) before relying on a specific condition ID, ticker, or April 2026 day.
</Warning>

## Overview

The EntityML Market Data API gives you programmatic access to Polymarket and Kalshi order book data, including live snapshots and historical event-level L2 updates.

For most integrations, use the official SDK or CLI first. Raw HTTP is still supported for custom workflows.

Use it to:

* Retrieve full order book snapshots (bids and asks)
* Track price changes over time
* Build trading strategies and analytics dashboards

## Quick start (SDK/CLI preferred)

<CardGroup cols={2}>
  <Card title="Create an API key" icon="key" href="/getting-started">
    Sign up and generate your first API key in under a minute.
  </Card>

  <Card title="Python SDK" icon="code" href="/sdk-python">
    Use the official SDK for both Polymarket and Kalshi endpoints.
  </Card>

  <Card title="CLI" icon="terminal" href="/cli">
    Use the bundled CLI for Polymarket and Kalshi endpoints.
  </Card>

  <Card title="Query examples" icon="sparkles" href="/examples">
    Copy pagination, OHLC, and slug lookup examples.
  </Card>

  <Card title="Data quality" icon="triangle-alert" href="/data-quality">
    Known coverage windows, April gaps, and incident notes.
  </Card>

  <Card title="API reference" icon="terminal" href="/api-reference/introduction">
    Full endpoint documentation with request/response examples.
  </Card>

  <Card title="GitHub repository" icon="github" href="https://github.com/anaygupta2004/entityml">
    Python SDK, CLI source, packaging, and examples.
  </Card>
</CardGroup>

## Make your first request

<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-02-13",
      limit=5,
  )

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

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

  entityml polymarket market-data \
    --condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4 \
    --date 2026-02-13 \
    --limit 5
  ```

  ```bash Raw HTTP (cURL) theme={null}
  curl -H "Authorization: Bearer YOUR_API_KEY" \
    "https://api.entityml.com/api/v1/polymarket/market/data?condition_id=8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4&date=2026-02-13&limit=5"
  ```
</CodeGroup>

<Card title="See the full getting started guide" icon="arrow-right" href="/getting-started">
  Step-by-step instructions with multi-language code examples.
</Card>
