Skip to main content

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.

Choose a workflow

Find a Polymarket condition

Resolve a Polymarket slug or URL into condition IDs.

Audit a timestamp range

Pull raw records across an inclusive timestamp window with cursor pagination.

Find asset IDs

Extract CLOB token IDs for per-outcome Polymarket orderbook summaries.

Build OHLC quotes

Get best bid, best ask, midpoint, spread, and OHLC candles.

Check data quality

Validate stored dates and April 2026 known windows before a backtest.

Find a Polymarket condition

from entityml import EntityMLClient

client = EntityMLClient()
result = client.lookup.polymarket_slug(slug="will-bitcoin-hit-100k")

for market in result["markets"]:
    print(market["question"], market["conditionId"])

Find Polymarket asset IDs

Polymarket summaries are per outcome token. First use the condition ID to pull a small raw page, then collect the unique asset_id values from the returned events.
from entityml import EntityMLClient

client = EntityMLClient(api_key="YOUR_API_KEY")

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

asset_ids = sorted({row["asset_id"] for row in page["data"] if row.get("asset_id")})
print(asset_ids)
A binary Polymarket usually has two asset_id values. The API does not label which token is which outcome in raw orderbook records, so join against Polymarket market metadata when you need outcome names.

Audit a timestamp range

Range endpoints accept Unix seconds or milliseconds. Use next_cursor unchanged while has_more is true.
from entityml import EntityMLClient

client = EntityMLClient(api_key="YOUR_API_KEY")

cursor = None
while True:
    page = client.polymarket.get_market_data_range(
        condition_id="0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
        start_timestamp=1770940800000,
        end_timestamp=1770944400000,
        cursor=cursor,
        limit=1000,
    )
    print(page["data_count"])
    cursor = page["pagination"]["next_cursor"]
    if not cursor:
        break

Build OHLC quotes

Polymarket orderbook summaries require a condition ID and an asset_id. Kalshi summaries require a ticker.
from entityml import EntityMLClient

client = EntityMLClient(api_key="YOUR_API_KEY")

summary = client.polymarket.get_orderbook_summary(
    condition_id="0x8213d395e079614d6c4d7f4cbb9be9337ab51648a21cc2a334ae8f1966d164b4",
    asset_id="97684905927345553455494278582909124912046930226695064344571162061840768197777",
    date="2026-02-13",
    resolution=60,
)

first = summary["data"][0]
print(first["mid_price"], first["mid_price_ohlc"])

Check data quality

1

Check stored dates

Call get_market_date_range for the condition ID or ticker.
2

Sample raw data

Pull a small page from the exact UTC date or timestamp range you need.
3

Inspect summary buckets

Confirm quote_count, is_forward_filled, and the OHLC fields before using the data in a backtest.
Affected Kalshi records from 2026-03-31 through 2026-04-24 can have null price payloads even when quote counts are nonzero.
Some Polymarket markets have gap-marked or missing data during the April 2026 collector instability window. Inspect gap_start and gap_end records when auditing this period.
See Data Quality for the full incident notes.