matchwire.win — Mapped Prediction Markets (Kalshi, Polymarket, Predict.fun) について
matchwire.win は Node.js と Python 向けの予測市場マッピングデータを提供します。Kalshi、Polymarket US/International、Predict.fun の市場を試合ごとにまとめます。価格や板情報は扱わず、各市場の対応付けに特化しており、複数の取引所を照合する開発者向けです。
主な機能
- 014 つの取引所の試合市場を対応付け
- 02勝敗、合計、ハンディキャップなどを照合
- 03各取引所の market ID を保持
- 04対応付けの段階と信頼度を提供
- 05差分更新と SSE ストリーミングに対応
- 06Node.js と Python のクライアントを提供
活用シーン
- 01取引所をまたいで同一試合の市場を検索
- 02スポーツや取引所でマッピングデータを絞り込み
- 03変更差分でローカルデータを同期
- 04対応付けを使って市場を横断比較
MCP 対応
JSON-RPC 2.0 の MCP エンドポイントが、スポーツ、マッピング行、個別試合、取引所の市場を検索する読み取り専用ツールを AI エージェントに公開します。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 は 1 試合につき 1 行を返し、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/ディレクトリ 1 つだけです。ほかのものは一切インストールされません。 - Node.js 18 以降に対応し、ESM と CommonJS、手書きの TypeScript 宣言を提供します。
- 型付きエラーにより、文字列照合ではなく、コード上で
429と401 invalid_keyを区別できます。 - 差分とストリーミングに対応し、変更された行と削除済みレコードを取得する
since=<seq>、または SSE による同じ更新の受信が可能です。 - MCP を同梱しており、AI エージェントが
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 | 試合ごとに 1 行と、各プラットフォームの掲載情報 |
row(id) | MCP get_row | マッピング済み ID による 1 試合 |
stream(params) | GET /api/v1/push | Server-Sent Events として同じ更新を取得 |
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=スポーツ名(mlbではなくbaseball)または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 に加え、そのマーケットをプラットフォームから取得するための正確なリクエストが含まれます。マッピング済みの行を使って比較対象を特定し、価格は既存の手段で各プラットフォームから取得してください。
エージェントと MCP
POST https://api.matchwire.win/mcp は、同じ x-api-key ヘッダーにキーを指定して JSON-RPC 2.0 で通信します。ツール: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 サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。