Public API

Transit API

日本の公共交通の乗り換え・経路検索 API。読み取り専用・認証不要・CORS 開放で、どこからでも利用できます。

https://api.transit.ls8h.com
📘 API リファレンス
対話的に試せる Scalar ドキュメント
📄 OpenAPI (JSON)
クライアント自動生成に使える機械可読仕様
JR時刻表データ取得方針
JR由来の公開時刻表情報を取得・GTFS化する際の立場と運用
利用規約・免責事項
無償提供、非公式性、データ保証範囲、API 利用条件

クイックスタート

# 駅やランドマークの座標から経路を検索(出発検索)
curl "https://api.transit.ls8h.com/api/v1/plan?from=geo:35.681,139.767&to=geo:35.690,139.700"

エンドポイント

planning

Journey search and guide-UI route options.

GET/api/v1/planJourney search (出発 / 到着 / 始発 / 終電)
GET/api/v1/guidance/planGuidance plan: ranked options, comparison basis, map geometry

search

Station, place and reverse-geocoding autocomplete.

GET/api/v1/locations/suggestStation autocomplete (parent-station, multilingual prefix)
GET/api/v1/places/suggestPlace autocomplete: stations, stops, facilities, addresses
GET/api/v1/places/reverseNearby places for a picked map point

stations

Station detail and departure boards.

GET/api/v1/stations/{id}Station detail: platforms and serving routes
GET/api/v1/stations/{id}/departuresDeparture board for a station

catalog

Ingested feeds and operator branding/license metadata.

GET/api/v1/feedsList ingested feeds with license attribution
GET/api/v1/operatorsList operator branding marks and logo/data licenses

map

Map scene assets for guidance rendering.

GET/api/v1/map/3d-sceneBounded 3D building scene layer URLs for a viewport

system

Operational probes.

GET/api/healthLiveness probe

型付きクライアントを生成

OpenAPI から任意の言語のクライアントを生成できます(openapi-typescript / orval / openapi-generator など)。

# OpenAPI から型付きクライアントを生成
bunx openapi-typescript https://api.transit.ls8h.com/api/openapi.json -o transit-api.d.ts
import createClient from "openapi-fetch";
import type { paths } from "./transit-api";

const api = createClient<paths>({ baseUrl: "https://api.transit.ls8h.com" });
const { data } = await api.GET("/api/v1/plan", {
  params: { query: { from: "geo:35.681,139.767", to: "geo:35.690,139.700" } },
});

利用上の注意