Learn how to find Polymarket Market IDs, CLOB IDS, token IDs, condition IDs, and slugs. Step-by-step guide to extracting Polymarket metadata for API queries and historical analysis.

When I first started using the Polymarket API for research, I was completely stumped by how everything was structured. Even if you understand the difference between the Gamma API, Data API, and CLOB API, you still need to navigate:
Everything ultimately flows through Events and Markets. Whether you're building a bot, running quant-level backtests, tracking probability momentum, or just researching odds, extracting the correct ID becomes crucial.
The challenge is that the ID you actually need is rarely the one you start with.
A Polymarket Market ID is the unique identifier for a specific binary market inside an event.
Each market has:
The Market ID is typically required when making:
However, you usually don’t start with the market ID. You start with:
Which means you need to derive the market ID first.
Polymarket uses multiple identifiers, which is where confusion starts.
Market ID
Token ID (CLOB Token ID)
Condition ID
Slug
Every binary market returns token IDs like:
["YES_TOKEN_ID", "NO_TOKEN_ID"]
These are the actual asset IDs used in price queries.
| Identifier | Used For | Example |
|---|---|---|
| Market ID | Metadata lookup | 558934 |
| Condition ID | Settlement logic | 0x7976b8dbacf9077eb1453a62bcefd6ab2df199acd28aad276ff0d920d6992892 |
| Token ID | Trading / price data | 4394372887385518214471608448209527405727552777602031099972143344338178308080 |
| Slug | Human readable lookup | will-spain-win-the-2026-fifa-world-cup-963 |
Let’s say you want to analyze:
Will the Virginia redistricting referendum pass?
You start with the URL:
https://polymarket.com/event/will-the-virginia-redistricting-referendum-pass
The slug is:
will-the-virginia-redistricting-referendum-pass
You can use Lychee to:

Or via API:
import requests
# Example slug: copy from a Polymarket market URL
slug = "will-the-virginia-redistricting-referendum-pass"
url = f"https://gamma-api.polymarket.com/markets/slug/{slug}"
# Optional query param from docs: include_tag=true|false
response = requests.get(url, params={"include_tag": "true"}, timeout=20)
response.raise_for_status()
market = response.json()
print("market_id:", market.get("id"))
print("question:", market.get("question"))
print("condition_id:", market.get("conditionId"))
print("slug:", market.get("slug"))
print("clob_token_ids:", market.get("clobTokenIds"))
print("outcomes:", market.get("outcomes"))
print("outcome_prices:", market.get("outcomePrices"))
The response includes:
Once you retrieve market metadata, you extract:
["YES_TOKEN_ID", "NO_TOKEN_ID"]
These represent:
These IDs are required for:
Without them, you cannot query probability over time.
Market metadata typically includes:
This metadata is required to:
This metadata response is what powers all downstream Polymarket API queries. Everything flows from this metadata response.
Instead of manually:
You can search polymarket-metadata using natural language:

This returns:

This removes the entire dependency chain.
Typical workflow:
Example endpoints:
/markets
/events
/markets/{id}
These endpoints return JSON metadata including token IDs.
Common issues include:
Multi-outcome events like:
https://polymarket.com/event/2026-nba-champion
contain multiple markets, each with separate token IDs.
The only way to extract the CLOB Token ID effectively is to use lycheedata.com/polymarket-metadata
Otherwise:
If you want to hit all countries in the NBA Championship probabilities, then you will need to do this for all countries i.e. all markets.
lycheedata.com/polymarket-metadata is easier:

You must retrieve market metadata and extract clobTokenIds.
Yes. Public endpoints provide market and event metadata.
Yes, via public API endpoints returning JSON metadata.
It links outcomes to settlement conditions.
Markets map to tokens, which trade on the CLOB and represent probabilities.
Working with Polymarket data means understanding the relationship between:
Once you can reliably extract these identifiers, you unlock:
The hardest part is simply finding the right ID — after that, everything else becomes much easier.
Learn how to track Polymarket odds over time, visualize probability changes, and measure probability momentum using interactive charts. Build a live Polymarket odds tracker without coding.
guidesLearn how to stream real-time Polymarket market data using the WebSocket market channel and build live prediction market charts — no code required.
guidesLearn how to connect to Polymarket’s Events List endpoint, filter and analyze structured event data, and export datasets, from anywhere in the world — no code required.
guidesLearn how to access, query, and download Kalshi historical data instantly — no coding skills required. Perfect for backtesting prediction markets, visualizing trades, and exporting CSV, Excel, or JSON files.
guidesCompose powerful analytics with Lychee using a no-code SQL builder: filter rows, compute metrics, group for charts, and join datasets for deep research.
guidesExplore our docs or reach out to our team.