Quick Reference
Common commands for working with the Polymarket CLI: | Goal | Command | |------|---------|| | Get event |polymarket -o json events get <slug> |
| Get market | polymarket -o json markets get <slug> |
| Price history (recent) | polymarket -o json clob price-history --interval max <TOKEN_ID> |
| Price history (full) | polymarket -o json clob price-history --interval max --fidelity 5000 <TOKEN_ID> |
| Top holders | polymarket -o json data holders <CONDITION_ID> |
| Wallet trades | polymarket -o json data trades <WALLET> --limit 500 |
| Portfolio value | polymarket data value <WALLET> |
| Open interest | polymarket data open-interest <CONDITION_ID> |
| CLOB market info | polymarket -o json clob market <CONDITION_ID> |
| Order book | polymarket clob book <TOKEN_ID> |
| Search markets | polymarket markets search "<q>" --order volumeNum |
| Generate chart | python3 scripts/chart.py <TOKEN_ID> --title "..." |
Commands by Namespace
Events Commands
Commands for working with multi-outcome events.events get
Retrieve event metadata and all outcome markets.
<slug>- Event slug from URL (e.g.,democratic-presidential-nominee-2028)
- Event metadata
marketsarray containing all outcome marketscondition_idfor each market- Current prices for all outcomes
Markets Commands
Commands for working with individual binary markets.markets get
Retrieve a single binary YES/NO market.
<slug>- Market slug from URL
- Market metadata
- Current YES/NO prices
- Volume and liquidity data
markets search
Search for markets with optional ordering and filtering.
<query>- Search query string
--order- Sort order (use camelCase:volumeNum,liquidityNum)--limit- Maximum number of results (default: 10)
Use
markets search instead of markets list to get high-volume markets first. The list command always sorts ascending.markets list
List markets (always sorts ascending).
CLOB Commands
Commands for Central Limit Order Book operations.clob market
Get CLOB market information and decimal token IDs.
<CONDITION_ID>- Condition ID (hex format accepted)
tokensarray with decimaltoken_idvalues- Market configuration
- Trading pair information
clob price-history
Fetch historical price data for a token.
<TOKEN_ID>- Decimal token ID (not hex)
--interval- Time interval (1h,1d,1w,max)--fidelity- Number of data points (higher = more detail)
clob book
View the order book for a token.
<TOKEN_ID>- Decimal token ID
- Bid and ask orders
- Order sizes and prices
Data Commands
Commands for on-chain data analysis.data holders
Get top token holders for a market.
<CONDITION_ID>- Market condition ID
outcome_index: 0- YES holdersoutcome_index: 1- NO holders- Wallet address
- Token balance
- Current value
data trades
Get trade history for a wallet.
<WALLET_ADDRESS>- Ethereum wallet address
--limit- Maximum number of trades to return
- Trade history with timestamps
- Buy/sell direction
- Size and price for each trade
- Condition ID for filtering
Use this data to calculate cost basis by filtering trades for a specific
condition_id and summing size × price for all BUY trades.data value
Get current portfolio value for a wallet.
<WALLET_ADDRESS>- Ethereum wallet address
- Total portfolio value in USD
- Breakdown by market
data open-interest
Get open interest for a market.
<CONDITION_ID>- Market condition ID
- Open interest in USD
- Per-outcome breakdown
Chart Script
Generate interactive HTML price charts with multiple time windows.<DECIMAL_TOKEN_ID>- Decimal token ID fromclob marketcommand
--title- Chart title (recommended)
- Interactive Plotly chart
- 8 time-window tabs: 1H, 6H, 1D, 1W, 1M, 3M, 6M, All
- Default view: 1W
- Automatically opens in browser
Global Options
Output Format
Use-o json for JSON output (recommended for programmatic use):
Help
Get help for any command:Token ID Conversion
CLOB commands require decimal token IDs. If you have a hex token ID:polymarket clob market <CONDITION_ID> instead of converting manually.