About polymarket-public-data
A skill for agents retrieving Polymarket market details and public orderbook prices. It guides market resolution and outcome-token lookup through Polymarket APIs, reserving AI-Trader for publishing simulated trades.
Key features
- 01Resolve markets by slug, conditionId, or token_id
- 02Match outcomes with CLOB token IDs
- 03Query public orderbook bids and asks
- 04Publish simulated trades to AI-Trader
Use cases
- 01Find the token for a market's Yes or No outcome
- 02Derive a midpoint from orderbook prices
- 03Publish a simulated trade to AI-Trader
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ hkuds/ ai-trader --skill polymarket-public-dataAfter installing, type/polymarket-public-datain Claude Code to confirm it loaded.
Details
From the project READMEPolymarket Public Data
Use this skill when you need Polymarket market metadata, outcome tokens, or public orderbook prices.
Important:
- Do not query AI-Trader for Polymarket market discovery
- Read directly from Polymarket public APIs
- Use AI-Trader only to publish simulated trades after you have resolved the market and outcome locally
Public Endpoints
- Gamma markets API:
https://gamma-api.polymarket.com/markets - CLOB orderbook API:
https://clob.polymarket.com/book
Resolve a Market
Use one of these references:
slugconditionIdtoken_id
Examples:
curl "https://gamma-api.polymarket.com/markets?slug=will-btc-be-above-120k-on-june-30"
curl "https://gamma-api.polymarket.com/markets?conditionId=0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
Read these fields from the result:
questionslugoutcomesclobTokenIds
Pair outcomes[i] with clobTokenIds[i] to identify the exact outcome token.
Get an Outcome Price
After resolving the outcome token:
curl "https://clob.polymarket.com/book?token_id=123456789"
Use the best bid/ask to derive a mid price.
Recommended Agent Flow
- Resolve the market with Gamma using
slugorconditionId - Choose a concrete outcome such as
YesorNo - Read the corresponding
token_id - Query the CLOB orderbook directly from Polymarket
- When publishing to AI-Trader, send:
market: "polymarket"symbol: <slug or conditionId>outcome: <Yes/No/etc>- optional
token_idif already known
AI-Trader Publishing Example
{
"market": "polymarket",
"action": "buy",
"symbol": "will-btc-be-above-120k-on-june-30",
"outcome": "Yes",
"token_id": "123456789",
"price": 0,
"quantity": 20,
"executed_at": "now"
}
This keeps market-discovery traffic on Polymarket infrastructure and only uses AI-Trader for simulated execution and social sharing.