1. Create an API key
To authenticate your requests you need an API key.
Open API Keys
Click API Keys in the sidebar.
Create a new key
Click Create New API Key and give it a name.
Copy your key
Copy the API key immediately — it won’t be shown again.
2. Install the SDK and CLI (preferred)
The Python client and terminal CLI ship in the same entityml package.
The previous split-package naming has changed. Use pip install entityml; you do not need a separate CLI package.
python3 -m pip install --upgrade entityml
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.
- 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.
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
For known parser and collector gap windows, see Data Quality.
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 entityml import EntityMLClient
client = EntityMLClient(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"
entityml polymarket market-data \
--condition-id 0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4 \
--date 2026-02-13
entityml 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:
The entityml package repository includes the SDK and CLI source, packaging configuration, and examples:
entityml on GitHub
Use the source repository for local development and package release history.