polymarket by machina-sports/sports-skills
npx skills add https://github.com/machina-sports/sports-skills --skill polymarket在编写查询之前,请查阅 references/api-reference.md 以获取体育代码、命令参数和价格格式。
推荐使用 CLI — 它可以避免 Python 导入路径问题:
sports-skills polymarket search_markets --sport=nba --sports_market_types=moneyline
sports-skills polymarket get_todays_events --sport=epl
sports-skills polymarket search_markets --sport=epl --query="Leeds" --sports_market_types=moneyline
sports-skills polymarket get_sports_config
Python SDK(备选方案):
from sports_skills import polymarket
polymarket.search_markets(sport='nba', sports_market_types='moneyline')
polymarket.get_todays_events(sport='epl')
polymarket.search_markets(sport='epl', query='Leeds')
polymarket.get_sports_config()
关键:在调用任何市场端点之前,请验证:
sport 参数必须始终传递给 search_markets 和 。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
get_todays_eventstoken_id (CLOB),而不是 market_id (Gamma)。首先调用 get_market_details 以获取 clobTokenIds。如果没有 sport 参数:
WRONG: search_markets(query="Leeds") → 0 个结果
RIGHT: search_markets(sport='epl', query='Leeds') → 返回所有利兹联相关市场
核心命令(无依赖项,无需 API 密钥):所有读取命令开箱即用。
交易命令 需要 py_clob_client:
pip install sports-skills[polymarket]
此外还需要配置一个钱包:
export POLYMARKET_PRIVATE_KEY=0x...
search_markets --sport=nba(或 epl, nfl, bun 等)get_market_prices --token_id=<clob_token_id>。get_todays_events --sport=epl — 返回按开始日期排序的赛事。clob_token_id,然后使用 get_market_prices。search_markets --sport=nba --query="Lakers" --sports_market_types=moneylineget_market_prices --token_id=<id> 用于获取实时 CLOB 价格。search_markets --sport=nba 查找市场。clob_token_id。get_price_history --token_id=<id> --interval=1w| 命令 | 描述 |
|---|---|
get_sports_config | 可用的体育代码 |
get_todays_events | 联赛的今日赛事 |
search_markets | 按体育项目、关键词和类型查找市场 |
get_sports_markets | 浏览所有体育市场 |
get_sports_events | 浏览体育赛事 |
get_series | 列出系列赛(联赛) |
get_market_details | 单个市场详情 |
get_event_details | 单个赛事详情 |
get_market_prices | 当前 CLOB 价格 |
get_order_book | 完整订单簿 |
get_price_history | 历史价格 |
get_last_trade_price | 最新交易价格 |
完整参数列表和返回结构请参见 references/api-reference.md。
示例 1:今晚 NBA 的热门球队 用户说:"今晚 NBA 比赛谁被看好?" 操作:
search_markets(sport='nba', sports_market_types='moneyline') 结果:每场比赛及其隐含的获胜概率(价格 = 概率)示例 2:特定球队的赔率 用户说:"给我看看利兹联对阵曼城的赔率" 操作:
search_markets(sport='epl', query='Leeds', sports_market_types='moneyline') 结果:利兹联的胜平负市场及其结果价格示例 3:今日英超赛事 用户说:"今天有哪些英超比赛?" 操作:
get_todays_events(sport='epl') 结果:今日英超赛事及其嵌套市场(胜平负、让分盘、总分盘、特殊投注)示例 4:联赛冠军未来盘 用户说:"谁会赢得英超冠军?" 操作:
search_markets(query='Premier League') — 返回未来盘示例 5:德甲赔率 用户说:"给我看看多特蒙德对阵拜仁的德甲赔率" 操作:
search_markets(sport='bun', query='Dortmund', sports_market_types='moneyline') 结果:多特蒙德/拜仁的胜平负市场及其结果价格cli_search_marketssearch_markets。cli_sports_listget_sports_config。get_market_oddsget_oddsget_current_oddsget_market_prices(token_id=...)。get_implied_probabilityget_marketsget_sports_markets(浏览)或 search_markets(搜索)。get_team_schedule如果某个命令未在 references/api-reference.md 中列出,则它不存在。
错误:search_markets 返回 0 个结果 原因:缺少 sport 参数 — 没有它,搜索只会检查高交易量市场,而错过单场比赛事件 解决方案:始终向 search_markets 传递 sport='<code>'。检查 references/api-reference.md 以获取有效的体育代码
错误:get_market_prices 失败或返回错误数据 原因:使用了 market_id (Gamma) 而不是 token_id (CLOB) 解决方案:首先调用 get_market_details(market_id=<id>) 以获取 CLOB clobTokenIds,然后将其用于 get_market_prices
错误:价格似乎过时或未变 原因:低流动性市场 — 可能点差较大且交易不频繁 解决方案:检查 get_last_trade_price(token_id=<id>) 以获取最新的实际交易价格
错误:交易命令失败 原因:未安装 py_clob_client 或钱包未配置 解决方案:运行 pip install sports-skills[polymarket] 并设置 POLYMARKET_PRIVATE_KEY 环境变量
每周安装量
255
代码仓库
GitHub 星标数
54
首次出现
2026年2月16日
安全审计
已安装于
codex241
opencode239
gemini-cli238
github-copilot229
cursor229
amp223
Before writing queries, consult references/api-reference.md for sport codes, command parameters, and price format.
Prefer the CLI — it avoids Python import path issues:
sports-skills polymarket search_markets --sport=nba --sports_market_types=moneyline
sports-skills polymarket get_todays_events --sport=epl
sports-skills polymarket search_markets --sport=epl --query="Leeds" --sports_market_types=moneyline
sports-skills polymarket get_sports_config
Python SDK (alternative):
from sports_skills import polymarket
polymarket.search_markets(sport='nba', sports_market_types='moneyline')
polymarket.get_todays_events(sport='epl')
polymarket.search_markets(sport='epl', query='Leeds')
polymarket.get_sports_config()
CRITICAL: Before calling any market endpoint, verify:
sport parameter is always passed to search_markets and get_todays_events for single-game markets.token_id (CLOB), not market_id (Gamma). Call get_market_details first to get clobTokenIds.Without the sport parameter:
WRONG: search_markets(query="Leeds") → 0 results
RIGHT: search_markets(sport='epl', query='Leeds') → returns all Leeds markets
Core commands (no dependencies, no API keys): All read commands work out of the box.
Trading commands require py_clob_client:
pip install sports-skills[polymarket]
Additionally requires a configured wallet:
export POLYMARKET_PRIVATE_KEY=0x...
search_markets --sport=nba (or epl, nfl, bun, etc.)get_market_prices --token_id=<clob_token_id>.get_todays_events --sport=epl — returns events sorted by start date.clob_token_id from outcomes, then get_market_prices.search_markets --sport=nba --query="Lakers" --sports_market_types=moneylineget_market_prices --token_id=<id> for live CLOB prices.search_markets --sport=nba.clob_token_id from the outcomes.get_price_history --token_id=<id> --interval=1w| Command | Description |
|---|---|
get_sports_config | Available sport codes |
get_todays_events | Today's events for a league |
search_markets | Find markets by sport, keyword, and type |
get_sports_markets | Browse all sports markets |
get_sports_events | Browse sports events |
get_series | List series (leagues) |
See references/api-reference.md for full parameter lists and return shapes.
Example 1: Tonight's NBA favorites User says: "Who's favored in tonight's NBA games?" Actions:
search_markets(sport='nba', sports_market_types='moneyline') Result: Each matchup with implied win probabilities (price = probability)Example 2: Team-specific odds User says: "Show me Leeds vs Man City odds" Actions:
search_markets(sport='epl', query='Leeds', sports_market_types='moneyline') Result: Leeds moneyline market with outcome pricesExample 3: Today's EPL events User says: "What EPL matches are on today?" Actions:
get_todays_events(sport='epl') Result: Today's EPL events with nested markets (moneyline, spreads, totals, props)Example 4: League winner futures User says: "Who will win the Premier League?" Actions:
search_markets(query='Premier League') — returns futuresExample 5: Bundesliga odds User says: "Show me Bundesliga odds for Dortmund vs Bayern" Actions:
search_markets(sport='bun', query='Dortmund', sports_market_types='moneyline') Result: Dortmund/Bayern moneyline market with outcome pricescli_search_marketssearch_markets instead.cli_sports_listget_sports_config instead.get_market_oddsget_oddsget_current_oddsget_market_prices(token_id=...).get_implied_probabilityget_marketsIf a command is not listed in references/api-reference.md, it does not exist.
Error: search_markets returns 0 results Cause: The sport parameter is missing — without it, search only checks high-volume markets and misses single-game events Solution: Always pass sport='<code>' to search_markets. Check references/api-reference.md for valid sport codes
Error: get_market_prices fails or returns wrong data Cause: market_id (Gamma) was used instead of token_id (CLOB) Solution: Call get_market_details(market_id=<id>) first to get the CLOB clobTokenIds, then use those with get_market_prices
Error: Prices seem stale or unchanged Cause: Low-liquidity market — may have wide spreads and infrequent trades Solution: Check get_last_trade_price(token_id=<id>) for the most recent actual trade price
Error: Trading commands fail Cause: py_clob_client is not installed or wallet is not configured Solution: Run pip install sports-skills[polymarket] and set POLYMARKET_PRIVATE_KEY environment variable
Weekly Installs
255
Repository
GitHub Stars
54
First Seen
Feb 16, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
codex241
opencode239
gemini-cli238
github-copilot229
cursor229
amp223
DOCX文件创建、编辑与分析完整指南 - 使用docx-js、Pandoc和Python脚本
43,600 周安装
Nx Import 使用指南:从源仓库导入代码并保留Git历史
250 周安装
OpenPencil CLI 工具:.fig 设计文件命令行操作与 MCP 服务器 | 设计自动化
250 周安装
学术深度研究技能:AI驱动的学术文献综述与多源验证工具,生成APA格式报告
250 周安装
React PDF 渲染器 - 使用 JSON 生成 PDF 文档,支持自定义组件和流式渲染
250 周安装
后端安全编码专家 | 安全开发实践、漏洞预防与防御性编程技术指南
250 周安装
TanStack Form:高性能无头表单库,支持TypeScript、Zod、Valibot验证
250 周安装
get_market_details | Single market details |
get_event_details | Single event details |
get_market_prices | Current CLOB prices |
get_order_book | Full order book |
get_price_history | Historical prices |
get_last_trade_price | Most recent trade |
get_sports_marketssearch_marketsget_team_schedule