本サービスの比較結果は、人間向けのレポート HTML だけでなく、 プログラムや AI エージェントから使える機械可読データとしても 提供しています。すべて認証不要・読み取り自由です (出典: 各フィードのライセンスに従います。利用規約)。
| 層 | 中身 | 向く用途 |
|---|---|---|
| digest | 比較の要約 (Markdown / JSON)。路線ごとの変化・停留所の変化・被覆率 | LLM に渡す一次資料、告知文づくり、突合 |
| routes.digest.json | 全路線の詳細 — 変化した便のレコード (trip_id 旧新付き)・時間帯別本数 | 路線の深掘り |
| mapping.json | stop_id / route_id / trip_id の旧新対応表 (N:M は配列のまま、confidence 付き) | 乗降データの経年結合、shapes 等の整備資産の世代引き継ぎ |
| events.json / rawdiffs.json | 全 ChangeEvent (44種) +証拠、生差分の全件 | エラーチェック、完全な検証 |
本ツールの特徴は「説明台帳」: 2世代間の生差分の全件が、必ず いずれかのイベントの証拠に紐づくか残差として計上され、被覆率 (explained_ratio) が常に出ます。検出は決定的ルールベースで、同じ入力からは 常に同じ出力になります。
レポート URL の .html を .digest.md に変えるだけで、
機械可読の要約が取れます:
https://diff.gtfs.jp/r/{pair}.html ← 人間向けレポート
https://diff.gtfs.jp/r/{pair}.digest.md ← AI 向け要約 (Markdown)
https://diff.gtfs.jp/r/{pair}.mapping.json ← ID 対応表 (gzip)
https://diff.gtfs.jp/r/{pair}/index.json ← 版台帳 (全成果物の URL 一覧)
URL 規則を覚える必要はありません — 版台帳 (index.json) の
versions[].artifacts に全成果物の URL が列挙されます。
フィード単位の計算済みペア一覧は
https://diff.gtfs.jp/feeds/{org}__{feed}.json にあります。
https://diff.gtfs.jp/mcp
Claude・ChatGPT 等の AI にコネクタとして登録すると、上記のデータを ツールとして対話的に使えます。認証不要 (Bearer トークン・ カスタムヘッダー等はすべて空欄のままで接続できます)。
| ツール | 説明 |
|---|---|
| find_feeds / find_generations | フィード・世代の探索 (gtfs-data.jp) |
| list_pairs | 計算済みの比較ペア一覧 |
| run_compare / get_job_status | 未計算の世代ペアをその場で計算 (日次の回数ガードあり) |
| get_digest / list_routes / get_route_detail | 要約と路線詳細 |
| get_stop_changes / get_residuals | 停留所の変化・検証サマリ (説明台帳) |
| map_ids | stop_id / route_id / trip_id / 名前から新旧対応を検索 |
| get_events | ChangeEvent の検索 (種別・重要度・路線で絞り込み) |
プロトコルは MCP 2026-07-28 版と旧世代 (initialize 方式) の
両対応。レポート URL の r/{pair}.html の {pair} 部分が
そのままツールの pair 引数になります。
# 世代一覧 (uid の確認)
curl "https://diff.gtfs.jp/api/gtfs/files?org=nagai-unyu&feed=Nagaibus"
# 比較ジョブの投入 (uid でも rid = prev_1/current 等でも可)
curl -X POST https://diff.gtfs.jp/api/jobs \
-H "Content-Type: application/json" \
-d '{"type":"gtfs_data_jp","org":"nagai-unyu","feed":"Nagaibus",
"old_rid":"prev_1","new_rid":"current"}'
# → {"job_id":"{pair}", ...}。GET /api/jobs/{pair} で succeeded を待つ
計算済みの世代ペアは即座に返ります (同一ペアは誰が実行しても 同じ公開 URL)。新規計算には日次の回数上限があり、超過時は 429 が返ります。 大量の処理は CLI をローカルでどうぞ (下記ドキュメント参照)。
処理規模の上限: アップロードは zip 100MB/ファイルに加え、 stop_times.txt の非圧縮サイズが約 100MB/世代 (≈130万便区間) を超えるものは 投入時にお断りします (国家規模の統合フィード等)。それ以上の規模は オープンソースの CLI 版で — 同じレポートを上限なしでローカル生成できます。
| ページ | 内容 |
|---|---|
| /docs/README.ja.md | 案内 — 何ができるか、層の選び方、ユースケース別レシピ (英語版: README.md) |
| /docs/reference.ja.md | リファレンス — CLI / Web API / JSON スキーマ / イベント型カタログ全44種 / digest・mapping スキーマ (英語版: reference.md) |
| /llms.txt | AI エージェント向けの機械可読な案内 |
本機能は研究プロジェクトの一部として提供しています。 不具合・要望はトップページのフィードバックからお寄せください。
Comparison results are available not only as human-readable HTML reports but also as machine-readable data for programs and AI agents. Everything is read-free with no authentication (attribution follows each feed's license — see the terms).
| Layer | Contents | Good for |
|---|---|---|
| digest | Comparison summary (Markdown / JSON): per-route changes, stop changes, coverage | Primary source for LLMs, drafting notices, cross-checking |
| routes.digest.json | Detail for every route — changed-trip records (old/new trip_ids), counts by time band | Drilling into a route |
| mapping.json | Old↔new correspondence tables for stop_id / route_id / trip_id (N:M kept as arrays, with confidence) | Joining ridership data across versions, carrying assets like shapes forward |
| events.json / rawdiffs.json | All ChangeEvents (44 types) with evidence, plus every raw diff | Error checking, full verification |
The tool's distinguishing feature is the "explanation ledger": every raw difference between the two versions is either tied to an event as evidence or reported as a residual, and the coverage ratio (explained_ratio) is always published. Detection is deterministic and rule-based — the same input always yields the same output.
Change .html to .digest.md in any report URL to
get the machine-readable summary:
https://diff.gtfs.jp/r/{pair}.html ← human-readable report
https://diff.gtfs.jp/r/{pair}.digest.md ← summary for AI (Markdown)
https://diff.gtfs.jp/r/{pair}.mapping.json ← ID mapping (gzip)
https://diff.gtfs.jp/r/{pair}/index.json ← version ledger (URLs of all artifacts)
You do not need to memorize the URL rules — the version ledger
(index.json) lists every artifact URL under
versions[].artifacts. The list of computed pairs per feed is at
https://diff.gtfs.jp/feeds/{org}__{feed}.json.
https://diff.gtfs.jp/mcp
Register it as a connector in Claude, ChatGPT or another AI client and the data above becomes interactive tools. No authentication (leave bearer tokens and custom headers empty).
| Tool | Description |
|---|---|
| find_feeds / find_generations | Explore feeds and versions (gtfs-data.jp) |
| list_pairs | List already-computed comparison pairs |
| run_compare / get_job_status | Compute a new pair on the spot (daily rate guard applies) |
| get_digest / list_routes / get_route_detail | Summary and per-route detail |
| get_stop_changes / get_residuals | Stop changes and the verification summary (explanation ledger) |
| map_ids | Look up old↔new correspondences by stop_id / route_id / trip_id / name |
| get_events | Search ChangeEvents (filter by type, severity, route) |
The server speaks both the 2026-07-28 MCP protocol and the
older initialize-style generation. The {pair} part of a report URL
(r/{pair}.html) is exactly the pair argument of the
tools.
# List versions (to find uids)
curl "https://diff.gtfs.jp/api/gtfs/files?org=nagai-unyu&feed=Nagaibus"
# Submit a comparison job (uid or rid = prev_1 / current both work)
curl -X POST https://diff.gtfs.jp/api/jobs \
-H "Content-Type: application/json" \
-d '{"type":"gtfs_data_jp","org":"nagai-unyu","feed":"Nagaibus",
"old_rid":"prev_1","new_rid":"current"}'
# → {"job_id":"{pair}", ...}; poll GET /api/jobs/{pair} until succeeded
Already-computed pairs return immediately (the same pair gets the same public URL no matter who runs it). New computations are subject to a daily limit; when exceeded, the API returns 429. For bulk processing, run the CLI locally (see the documentation below).
Size limits: uploads are capped at 100MB per zip, and feeds whose uncompressed stop_times.txt exceeds ~100MB per version (≈1.3M rows — national aggregate feeds and the like) are declined at submission. For larger feeds use the open-source CLI — it produces the same report locally with no limits.
| Page | Contents |
|---|---|
| /docs/README.md | Guide — what you can do, choosing a layer, recipes by use case (Japanese: README.ja.md) |
| /docs/reference.md | Reference — CLI / Web API / JSON schemas / all 44 event types / digest & mapping schemas (Japanese: reference.ja.md) |
| /llms.txt | Machine-readable guidance for AI agents |
This is provided as part of a research project. Please send bugs and requests via the feedback form on the top page.