polymarket markets namespace provides commands for retrieving individual binary market data and searching across all markets.
Get a market
Retrieve details for a single binary YES/NO market.The market slug from the URL path. Extract from URLs like
https://polymarket.com/market/will-x-happen-by-2025 → will-x-happen-by-2025Usage
Output structure
The response includes:- Market metadata (question, description, end date)
- Current YES/NO prices
- Volume and liquidity data
- Condition ID for further queries
- Market resolution status
Example output
Search markets
Search for markets matching a query string with sorting and filtering options.Search terms to match against market questions and descriptions
Sort field in camelCase format. Common values:
volumeNum, liquidity, endDateMaximum number of results to return (default: 10)
Usage
Use
markets search instead of markets list to find high-volume markets. The markets list command always sorts ascending, making it useless for finding top markets.Sorting options
The--order flag uses camelCase field names:
volumeNum- Sort by total volume (most useful)liquidity- Sort by available liquidityendDate- Sort by market close datecreatedAt- Sort by creation date
Example: Find top markets
Filtering results
Combine search terms with sorting to find specific market types:Sports markets
Politics markets
Active markets (not closed)
Filter the JSON output programmatically:Market vs event URLs
Determine which command to use based on the URL:/market/in URL → usepolymarket markets get/event/in URL → usepolymarket events get
Example URLs
Common use cases
Quick price check
Get the current price for a specific market:Monitor high-volume markets
Find markets closing soon
endDate within your timeframe.
Next steps
After retrieving a market:- Extract the
conditionIdfor CLOB queries - Use
polymarket clob market <conditionId>to get decimal token IDs - Generate price charts with the token ID
- Analyze holders or wallet trades