A GraphQL API that provides nearby Japanese train stations and bus stops, running on Cloudflare Workers.
-
For automation agent and contributor workflows, see AGENTS.md.
-
For contribution guidelines, see CONTRIBUTING.md.
-
For system architecture, GTFS import ordering, and design decisions, see docs/architecture.md.
-
For the design of the transfer route search (
connectedRoutes, RAPTOR), see docs/route-search.md. -
For the source-backed operating constraints used by timetable-free search, see docs/route-service-audit.md.
-
For the Keio stopping-pattern audit and regression checks, see docs/keio-stopping-pattern-audit.md.
-
For technical debt analysis and architectural concerns, see docs/technical_debt.md.
-
For the record of the Cloudflare Workers migration, see docs/cloudflare-workers-migration.md.
-
For the published GraphQL schema, see schema/public.graphql.
This project includes a comprehensive dataset of Japanese railway information in the data/ directory. The data is maintained in CSV format and contributions are primarily targeted at Japanese speakers. For detailed information about data structure and contribution guidelines, please refer to data/README.md.
- とかしき観光バスのGTFSは、とかしき観光バス合同会社が提供し、OTTOP が配布しています。StationAPI は停留所・系統・運行パターンの検索用に加工しています。ライセンスは CC BY 4.0 です。
- Track lengths between adjacent stations (
Station.trackDistanceFromPrevious) are derived from the MLIT National Land Numerical Information railway data (N02), licensed under CC BY 4.0: 「国土数値情報(鉄道データ)」(国土交通省) (https://nlftp.mlit.go.jp/ksj/gml/datalist/KsjTmplt-N02-2025.html) を加工して作成 - Bus stops and routes are derived from the GTFS and ODPT feeds listed in
preprocessor/src/gtfs/feed.rsandpreprocessor/src/gtfs/odpt.rs. - Nagoya City Bus routes and stops use the Transportation Bureau, City of Nagoya GTFS-JP dataset (2026-03-28), CC BY 4.0, processed for TrainLCD.
- Hokkaido Chuo Bus routes and stops use the GTFS feed published on HODA (Jorudan, CC BY 4.0), processed for TrainLCD.
- Hokkaido express bus routes and stops use the Highway Express Bus GTFS feed published on HODA (Jorudan, CC BY 4.0), processed for TrainLCD.
- Jotetsu Bus routes and stops use the GTFS feed published on HODA (Jorudan, CC BY 4.0), processed for TrainLCD.
- Chiyoda Kazaguruma routes and stops use the GTFS feed from Hitachi Automobile Transportation (CC BY 4.0), processed for TrainLCD.
- Bunkyo B-guru routes and stops use the GTFS feed from Hitachi Automobile Transportation (CC BY 4.0), processed for TrainLCD.
- Nagoya City SRT bus routes and stops use the Nagoya City Housing and City Planning Bureau GTFS, CC BY 4.0, source, processed for TrainLCD.
- Odakyu Bus routes and stops use the GTFS feed from Odakyu Bus Co., Ltd. (Public Transportation Open Data Basic License), processed for TrainLCD.
- Nishi Tokyo Bus routes and stops use the GTFS feed from Nishi Tokyo Bus Co., Ltd. (Public Transportation Open Data Basic License), processed for TrainLCD.
- Minato Chiibus routes and stops use the GTFS feed from Fuji Express (CC BY), processed for TrainLCD.
- Limon Bus (Shinki Kanko): source and attribution, CC BY 4.0.
- Daito City community buses and shared taxis: source and attribution, CC BY 4.0. See the Osaka coverage audit for additional candidates and access requirements.
- Fujimino City publishes the Fujimin-go GTFS. See its source, terms of use, and processing notice.
- TrainLCD processes the additional bus GTFS feeds into StationAPI routes, stops, and operating patterns. Each feed registration identifies the source dataset and its terms of use.
- Gunma GTFS stop prefectures are assigned using prefecture boundaries derived by Kyodo News from the MLIT 2025 administrative area dataset (CC BY 4.0).
- Some of the reference travel times in
travel_times/cases.csvare derived from the Toei Subway GTFS (Bureau of Transportation, Tokyo Metropolitan Government, CC BY 4.0) and from the Tokyo Metro, Metropolitan Intercity Railway (Tsukuba Express), Tokyo Waterfront Area Rapid Transit (Rinkai Line), and Tama Toshi Monorail GTFS feeds published by the Public Transportation Open Data Center under the Public Transportation Open Data Basic License.
Thanks goes to these wonderful people (emoji key):
Kanta Demizu 🔣 🚇 💻 |
SAIGUSA Tomotada 🤔 🔣 |
mittan12 🔣 |
CodeRabbit 👀 |
tahodev 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Do you like this project? Join our Discord community! https://discord.gg/tsemdME9Nz
The build packs rail data and search indexes into Wasm. Bus lines whose services all stay on one line use versioned Static Assets for stop sequences and service types. Lines with a service that spans multiple lines keep all their services in Wasm.
rustup target add wasm32-unknown-unknown
cargo install worker-build --locked
make data # build generated/*.csv from data/, the GTFS feeds, and the MLIT railway data
make build # build the Worker (wasm)
make dev # run it locally on http://127.0.0.1:8787make help lists every target.
make test # unit tests for every native crate
make check # type-check, including the wasm32 target
make clippy # lint, including the wasm32 target
make fmt # formatting checkTests need no external services. stationapi (domain / use case) and
preprocessor (data pipeline) are covered by unit tests; the published GraphQL
schema is verified in CI by diffing the Worker's SDL against
schema/public.graphql.
make deploy # staging -> stationapi-stg
make deploy-production # production -> stationapiA data update rebuilds and deploys the Wasm and bus assets together.
久米島町営バスのデータは、久米島町が提供し、OTTOP が配布するGTFSを使用しています。StationAPI は原本を停留所・系統・運行パターンの検索用に加工しています。ライセンスは CC BY 4.0 です。
