Skip to main content

1. Create an API key

To authenticate your requests you need an API key.
1

Go to your Dashboard

Navigate to your Dashboard and sign in.
2

Open API Keys

Click API Keys in the sidebar.
3

Create a new key

Click Create New API Key and give it a name.
4

Copy your key

Copy the API key immediately — it won’t be shown again.

2. Install the SDK or CLI (preferred)

Choose the integration path you want to use:
python3 -m pip install --upgrade poly-storage-sdk

Historical coverage

  • 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.
  • Continuous Polymarket crypto-related market coverage begins on 2026-02-04. Continuous Kalshi crypto-related market coverage begins on 2026-02-25.
  • Continuous coverage for all markets begins 2026-04-02 for Polymarket and 2026-03-31 for Kalshi.
The best way to confirm what exists for a specific market is to call the corresponding date-range endpoint first:
  • GET /api/v1/polymarket/market/date-range
  • GET /api/v1/kalshi/market/date-range

Look up condition IDs from a Polymarket slug

If you only have a Polymarket slug, copy it from the event URL: https://polymarket.com/event/<slug> Then use the API lookup endpoint:
import requests

slug = "will-bitcoin-reach-100k"

response = requests.get(
    "https://api.entityml.com/api/v1/lookup/slug",
    params={"slug": slug},
    timeout=30,
)
response.raise_for_status()

for market in response.json()["markets"]:
    print(market["question"], market["conditionId"])
See Look Up Polymarket Slug for the full response format.

3. Make your first request with the Python SDK

from poly_storage_sdk import PolyStorageClient

client = PolyStorageClient(api_key="YOUR_API_KEY")

polymarket_data = client.polymarket.get_market_data(
    condition_id="0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
    date="2026-02-13",
)

kalshi_data = client.kalshi.get_market_data(
    ticker="KXBTC-26FEB2606-B60125",
    date="2026-02-26",
)

print(polymarket_data["data_count"], kalshi_data["data_count"])
For full SDK usage, see Python SDK.

4. Make your first request with the CLI

export ENTITY_API_KEY="YOUR_API_KEY"

poly-storage polymarket market-data \
  --condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4 \
  --date 2026-02-13

poly-storage kalshi market-data \
  --ticker KXBTC-26FEB2606-B60125 \
  --date 2026-02-26
For the full command reference, see CLI.

5. Raw HTTP fallback

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.entityml.com/api/v1/polymarket/market/data?condition_id=8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4&date=2026-02-13"

6. Raw HTTP code examples

import os
import requests

def get_market_data():
    api_key = os.environ.get('ENTITY_API_KEY')

    headers = {
        'Authorization': f'Bearer {api_key}'
    }

    params = {
        'condition_id': '8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4',
        'date': '2026-02-13'
    }

    response = requests.get(
        'https://api.entityml.com/api/v1/polymarket/market/data',
        headers=headers,
        params=params
    )

    return response.json()

# Example usage
data = get_market_data()
print(data)

7. Demo

Watch the walkthrough to see the API in action:
We also provide helper scripts that, given a slug, will list all market condition IDs:

poly-storage-public-helpers

Python scripts for finding condition IDs, fetching data, and reproducing the graphs shown in the demo.