Look up an event
Events contain multiple outcome markets. To look up an event, use the slug from the event URL.Find the event slug
From a Polymarket event URL like:The slug is the last path segment:
democratic-presidential-nominee-2028The
outcomePrices field is a JSON string that must be parsed separately. If you’re processing the output programmatically, use json.loads() on this field.Look up a market
Individual binary YES/NO markets use a different command.Identify a market URL
Market URLs contain The slug is:
/market/ in the path:will-bitcoin-hit-100k-by-year-endGenerate a price chart
Create an interactive HTML price chart with multiple time-window tabs.Convert to decimal token ID
The chart script requires a decimal token ID, not the hex condition ID. Get it using:The output contains a Copy the
tokens array:token_id for the outcome you want to chart (YES or NO).If you installed this as a Codex skill, use the full path to the script:
Chart features
The generated chart includes:- 8 time-window tabs: 1H, 6H, 1D, 1W, 1M, 3M, 6M, All
- Interactive tooltips: Hover to see exact price and timestamp
- Zoom and pan: Click and drag to zoom, double-click to reset
- Default view: Opens to the 1W (one week) view
Common workflows
Search for high-volume markets
Search for high-volume markets
Find trending markets sorted by volume:
Use
markets search instead of markets list because list always sorts ascending (least useful markets first). The --order parameter requires camelCase: volumeNum, not volume_num.Find top holders
Find top holders
View the largest position holders for a market:The output includes:
outcome_index: 0= YES holdersoutcome_index: 1= NO holders- Wallet addresses and position sizes
Analyze a wallet's trades
Analyze a wallet's trades
Get trading history for cost-basis analysis:Filter the results by
condition_id to analyze positions in a specific market. Calculate:- Total cost: Sum of
(size × price)for all BUY trades - Total shares: Sum of
sizefor all BUY trades - Average price:
total_cost / total_shares - Current value:
shares_held × current_price - Win payout:
shares_held × $1.00 - ROI if wins:
((payout - cost) / cost) × 100
Get current price history
Get current price history
Fetch recent price data at maximum resolution:For full historical data with lower resolution:
Key gotchas
- Wrong command → 404: Match the command to the URL path (
/event/vs/market/) - Token IDs must be decimal: Never use hex
0x...format for CLOB commands - outcomePrices is a string: Parse it with
json.loads()when processing event data - Ordering is camelCase: Use
volumeNum, notvolume_num(causes 422 error) - Sum of YES prices ≈ 1.01: Normal 1% house edge, not an error
Troubleshooting
No price history returned
No price history returned
Confirm you’re using a decimal CLOB token ID, not hex. Get it via:Read the
token_id field from the tokens array (not the hex condition ID).Browser doesn't open automatically
Browser doesn't open automatically
The chart script prints the HTML file path. Open it manually:
422 error when searching markets
422 error when searching markets
The
--order parameter requires camelCase:Next steps
Now that you’ve run your first commands:- Explore different markets and generate charts for price analysis
- Use holder analysis to understand market positioning
- Analyze wallet trades to calculate cost basis and ROI
- Search for trending markets using volume sorting
View full command reference
See all available commands and options