polymarket
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePolymarket — Prediction Market Data
Polymarket — 预测市场数据
Query prediction market data from Polymarket using their public REST APIs.
All endpoints are read-only and require zero authentication.
See for the full endpoint reference with curl examples.
references/api-endpoints.md通过Polymarket的公开REST API查询预测市场数据。
所有端点均为只读,无需任何身份验证。
详见获取完整的端点参考及curl示例。
references/api-endpoints.mdWhen to Use
使用场景
- User asks about prediction markets, betting odds, or event probabilities
- User wants to know "what are the odds of X happening?"
- User asks about Polymarket specifically
- User wants market prices, orderbook data, or price history
- User asks to monitor or track prediction market movements
- 用户询问预测市场、投注赔率或事件概率相关问题
- 用户想了解“X发生的概率是多少?”
- 用户专门询问Polymarket相关内容
- 用户需要市场价格、订单簿数据或价格历史
- 用户希望监控或追踪预测市场动态
Key Concepts
核心概念
- Events contain one or more Markets (1:many relationship)
- Markets are binary outcomes with Yes/No prices between 0.00 and 1.00
- Prices ARE probabilities: price 0.65 means the market thinks 65% likely
- field: JSON-encoded array like
outcomePrices["0.80", "0.20"] - field: JSON-encoded array of two token IDs [Yes, No] for price/book queries
clobTokenIds - field: hex string used for price history queries
conditionId - Volume is in USDC (US dollars)
- Events包含一个或多个Markets(一对多关系)
- Markets为二元结果,Yes/No价格介于0.00到1.00之间
- 价格即概率:价格0.65意味着市场认为事件发生的可能性为65%
- 字段:JSON编码数组,例如
outcomePrices["0.80", "0.20"] - 字段:JSON编码的两个代币ID数组 [Yes, No],用于价格/订单簿查询
clobTokenIds - 字段:十六进制字符串,用于价格历史查询
conditionId - 交易量以USDC(美元)为单位
Three Public APIs
三个公开API
- Gamma API at — Discovery, search, browsing
gamma-api.polymarket.com - CLOB API at — Real-time prices, orderbooks, history
clob.polymarket.com - Data API at — Trades, open interest
data-api.polymarket.com
- Gamma API,地址— 发现、搜索、浏览
gamma-api.polymarket.com - CLOB API,地址— 实时价格、订单簿、历史数据
clob.polymarket.com - Data API,地址— 交易记录、未平仓合约
data-api.polymarket.com
Typical Workflow
典型工作流程
When a user asks about prediction market odds:
- Search using the Gamma API public-search endpoint with their query
- Parse the response — extract events and their nested markets
- Present market question, current prices as percentages, and volume
- Deep dive if asked — use clobTokenIds for orderbook, conditionId for history
当用户询问预测市场赔率时:
- 搜索:使用Gamma API的public-search端点执行用户查询
- 解析:处理响应结果 — 提取事件及其嵌套的市场信息
- 展示:呈现市场问题、当前价格(以百分比形式)及交易量
- 深入查询:若用户有需求,使用clobTokenIds查询订单簿,使用conditionId查询历史数据
Presenting Results
结果展示格式
Format prices as percentages for readability:
- outcomePrices becomes "Yes: 65.2%, No: 34.8%"
["0.652", "0.348"] - Always show the market question and probability
- Include volume when available
Example:
"Will X happen?" — 65.2% Yes ($1.2M volume)将价格转换为百分比以提升可读性:
- outcomePrices 转换为“Yes: 65.2%, No: 34.8%”
["0.652", "0.348"] - 始终展示市场问题及概率
- 如有可用,需包含交易量信息
示例:
"X会发生吗?" — Yes:65.2%(交易量120万美元)Parsing Double-Encoded Fields
解析双重编码字段
The Gamma API returns , , and as JSON strings
inside JSON responses (double-encoded). When processing with Python, parse them with
to get the actual array.
outcomePricesoutcomesclobTokenIdsjson.loads(market['outcomePrices'])Gamma API返回的、和是JSON响应中的JSON字符串(双重编码)。使用Python处理时,需通过解析以获取实际数组。
outcomePricesoutcomesclobTokenIdsjson.loads(market['outcomePrices'])Rate Limits
速率限制
Generous — unlikely to hit for normal usage:
- Gamma: 4,000 requests per 10 seconds (general)
- CLOB: 9,000 requests per 10 seconds (general)
- Data: 1,000 requests per 10 seconds (general)
限制较为宽松,正常使用下不太可能触发:
- Gamma:每10秒4000次请求(通用)
- CLOB:每10秒9000次请求(通用)
- Data:每10秒1000次请求(通用)
Limitations
局限性
- This skill is read-only — it does not support placing trades
- Trading requires wallet-based crypto authentication (EIP-712 signatures)
- Some new markets may have empty price history
- Geographic restrictions apply to trading but read-only data is globally accessible
- 本技能为只读模式 — 不支持下单交易
- 交易需要基于钱包的加密货币身份验证(EIP-712签名)
- 部分新市场可能没有价格历史数据
- 交易存在地域限制,但只读数据全球可访问