关于 matchwire.win — Mapped Prediction Markets (Kalshi, Polymarket, Predict.fun)
matchwire.win 为 Node.js 和 Python 提供预测市场映射数据,将 Kalshi、Polymarket 美国与国际市场及 Predict.fun 中对应的比赛和市场整理为每场比赛一行。它只负责匹配市场,不提供价格或订单簿,适合需要跨平台核对市场的开发者。
主要功能
- 01跨四个平台匹配比赛市场
- 02按胜负、大小分、让分等匹配
- 03保留平台原始 market id
- 04提供映射置信度与匹配层级
- 05支持增量更新和 SSE 流
- 06提供 Node.js 与 Python 客户端
适用场景
- 01查找同场比赛在不同平台的市场
- 02按运动项目或平台筛选映射数据
- 03获取变更记录并同步本地数据
- 04将匹配结果用于跨平台市场比较
MCP 相关
提供 JSON-RPC 2.0 MCP 端点,向 AI Agent 暴露运动项目、映射行、单场比赛及平台市场查询等只读工具。MCP 和 HTTP API 使用相同的 API 密钥访问控制。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://api.matchwire.win/mcpclaude mcp add --transport http win-matchwire-mapping https://api.matchwire.win/mcp{"mcpServers":{"win-matchwire-mapping":{"type":"http","url":"https://api.matchwire.win/mcp"}}}在 Cursor 中打开{"servers":{"win-matchwire-mapping":{"type":"http","url":"https://api.matchwire.win/mcp"}}}在 VS Code 中打开{"mcpServers":{"win-matchwire-mapping":{"type":"http","url":"https://api.matchwire.win/mcp"}}}{"mcpServers":{"win-matchwire-mapping":{"serverUrl":"https://api.matchwire.win/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://api.matchwire.win/mcp需要授权工具
详细介绍
matchwire.win
为 Node.js 和 Python 提供映射后的预测市场数据。 一个客户端,零依赖:matchwire.win 为每场比赛返回一行数据,并匹配 Kalshi、Polymarket US、Polymarket International 和 Predict.fun 的数据,同时保留每个交易场所自身的市场 ID——让你可以比较 Kalshi API 市场和对应的 Polymarket API 市场,而无需自己维护对账任务。
市场类型也会匹配:胜负、让分和盘口、大小分以及特殊投注项。盘口线也是匹配条件的一部分,因此 over 45.5 绝不会与 over 48.5 混淆。
仅提供映射,不含价格或订单簿。 价格由各交易场所提供;这个库会告诉你哪个交易场所的哪个市场对应同一场比赛。
import { Matchwire } from 'matchwire.win';
const mw = new Matchwire({ apiKey: process.env.MATCHWIRE_API_KEY });
const { rows, seq } = await mw.rows({ sport: 'nfl', venue: ['kalshi', 'poly'] });
const game = rows.find((r) => r.listings.length > 1);
console.log(game.name, game.listings.map((l) => `${l.venue}:${l.marketId}`));
- 零依赖。 只需一个使用全局
fetch的src/目录。不需要安装任何附加内容。 - 支持 Node.js 18+,支持 ESM 和 CommonJS,并提供手写的 TypeScript 类型声明。
- 类型化错误——在代码中可以区分
429和401 invalid_key,无需通过字符串匹配判断。 - 增量更新和流式传输——使用
since=<seq>获取变更行和删除标记,或通过 SSE 获取相同更新。 - 内置 MCP——提供与 AI Agent 从
https://api.matchwire.win/mcp获取的相同工具。 - MIT 许可。
安装
npm install matchwire.win # Node.js — zero dependencies
pip install matchwire.win # Python 3.9+ — standard library only
前往 matchwire.win 获取密钥——套餐起价为每月 $99,Starter 套餐提供 14 天试用期。
快速开始
保存为 quickstart.mjs,然后运行 node quickstart.mjs(需要在环境中设置 MATCHWIRE_API_KEY):
import { Matchwire } from 'matchwire.win';
const mw = new Matchwire({ apiKey: process.env.MATCHWIRE_API_KEY });
const status = await mw.status();
console.log(`${status.store.events} games, ${status.store.bound} bound listings`);
const { sports } = await mw.sports();
console.log(sports.slice(0, 5).map((s) => `${s.sport} ${s.events}`));
const { rows } = await mw.rows({ sport: 'nfl', limit: 3 });
for (const row of rows) {
console.log(row.name, row.status, row.listings.map((l) => l.venue).join('+'));
}
仓库中附带了包含格式化和错误处理的相同示例:node examples/quickstart.mjs。
API
| 方法 | 端点 | 返回内容 |
|---|---|---|
status() | GET /api/v1/status | 服务及各交易场所的运行状况、当前 seq、覆盖数量 |
sports() | GET /api/v1/sports | 体育项目及比赛数量,以及分组 ID(esports、american-football 等) |
rows(params) | GET /api/v1/rows | 每场比赛一行数据,并列出各交易场所的市场 |
row(id) | MCP get_row | 根据映射 ID 获取单场比赛 |
stream(params) | GET /api/v1/push | 与服务器发送事件相同的更新 |
callTool(name, args) | POST /mcp | 调用 MCP 端点公布的任意工具 |
tools() | POST /mcp | 获取端点公布的工具列表 |
筛选条件
sport、venue、type、league、status 可以接受单个值或逗号分隔的列表,且可以组合使用。since=<seq> 会切换为增量模式(返回变更行和 tombstones)。
venue=kalshi·poly(Polymarket US)·polyintl(Polymarket International)·predictfuntype=winner·total·handicap·map_winner·score·eventstatus=scheduled·live·endedsport=体育项目名称(例如baseball,而不是mlb),或sports()返回的分组 ID
// Everything that changed since the last call, plus tombstones for pruned games.
let seq = 0;
const first = await mw.rows({ sport: 'esports', limit: 5000 });
seq = first.seq;
const delta = await mw.rows({ since: seq });
console.log(delta.rows.length, 'changed', delta.tombstones?.length ?? 0, 'gone');
// Stream instead of polling.
for await (const frame of mw.stream({ since: seq })) {
console.log(frame.event, frame.data.rows?.length);
if (Date.now() - started > 10_000) break; // or AbortController
}
提供映射,不提供价格
每个市场条目都包含交易场所自身的 marketId、tier(exact、normalized、fuzzy)和 confidence,以及读取该交易场所市场所需的精确请求。使用映射后的行来判断要比较什么,然后通过你已有的数据源读取各交易场所的价格。
Agent 和 MCP
POST https://api.matchwire.win/mcp 使用 JSON-RPC 2.0,并通过相同的 x-api-key 请求头传入密钥。工具包括:list_sports、find_rows、get_row、get_venue_market、report_issue、service_status。这些工具均为只读;每个工具的结果都会像 HTTP API 一样,严格受你的密钥套餐权限限制。
import { Matchwire } from 'matchwire.win';
const mw = new Matchwire({ apiKey: process.env.MATCHWIRE_API_KEY });
console.log((await mw.tools()).map((t) => t.name));
const row = await mw.row('ev:nfl:arizona-cardinals:denver-broncos:2026-10-25');
console.log(row.listings.map((l) => l.venue));
面向编码助手的纯文本说明:matchwire.win/llms.txt · MCP 参考文档:matchwire.win/docs/mcp/
错误
import { MatchwireError } from 'matchwire.win';
try {
await mw.rows({ sport: 'nope' });
} catch (error) {
if (error.isRateLimited) await sleep(error.retryAfterMs); // 429
else if (error.isAuthError) /* key missing or revoked */ ;
else if (error.isPlanError) /* outside the plan's sports/venues */ ;
else throw error;
}
文档
- 文档 — https://matchwire.win/docs/
- 事件映射说明 — https://matchwire.win/how-to-map-prediction-markets/
- Kalshi API 映射 — https://matchwire.win/kalshi-api/
- Polymarket API 映射 — https://matchwire.win/polymarket-api/
- 预测市场 API — https://matchwire.win/prediction-market-api/
- 套餐 — https://matchwire.win/#pricing
Python
from matchwire import Matchwire
mw = Matchwire(api_key=os.environ["MATCHWIRE_API_KEY"])
rows = mw.rows(sport="nfl", venue=["kalshi", "poly"])["rows"]
print(rows[0]["name"], [l["venue"] for l in rows[0]["listings"]])
请参阅 python/README.md。仅使用标准库,支持 Python 3.9 及以上版本。
许可证
MIT。与 Kalshi、Polymarket 或 Predict.fun 无关联;使用平台名称仅用于说明映射对象。
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。