Odpt

v0.1.0
io.github.pipeworx-io/odpt Checked 2 days ago Published 18 days ago

ODPT — Japan rail timetables and live train/service status (Public Transportation Open Data Center).

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

odpt_resolve_station

Find a Japan train station by name, in English or Japanese ("Shinjuku" or "新宿"), and return its ODPT station id(s), operator, railway and coordinates — for looking up Japanese railway/metro stations (Tokyo Metro, JR East, Toei and other operators). ODPT has no name-search endpoint, so this fetches station master data for the given operator (or a short list of major Tokyo operators if none is given) and matches client-side — one station can have several ids, one per operator/railway that serves it. Use the returned station_id with odpt_station_timetable. Needs an ODPT developer consumer…

ParameterTypeDescription
_apiKey *stringOptional: your own ODPT developer consumer key. Pipeworx supplies one if omitted.
query *stringStation name in English or Japanese, e.g. "Shinjuku" or "新宿".
limitnumberMax matches to return, 1-50. Default 10.
operatorstringLimit to one operator, e.g. "Tokyo Metro", "JR East", "Toei", or an exact odpt.Operator id. Default: searches several major Tokyo operators.

odpt_station_timetable

Scheduled departure timetable at a Japanese train station (Tokyo Metro, JR East, Toei and other Japan railway operators): destination, departure time, train type and direction, for weekday/Saturday/holiday calendars. Resolve the station first with odpt_resolve_station to get its exact station_id (or pass a plain station name and this will resolve it for you, taking the first match). Needs an ODPT developer consumer key via _apiKey; Pipeworx supplies one if omitted. Example: odpt_station_timetable({ station: "Shinjuku", operator: "Tokyo Metro" }).

ParameterTypeDescription
_apiKey *stringOptional: your own ODPT developer consumer key. Pipeworx supplies one if omitted.
station *stringStation name (English or Japanese) or an exact odpt.Station id from odpt_resolve_station.
calendarstringOptional: keep only this calendar, e.g. "odpt.Calendar:Weekday" or "odpt.Calendar:SaturdayHoliday".
operatorstringOperator to search when `station` is a plain name and could match more than one operator, e.g. "Tokyo Metro".
railwaystringOptional: keep only this railway, e.g. "odpt.Railway:TokyoMetro.Marunouchi".

odpt_train_timetable

Stop-by-stop scheduled timetable for one specific Japanese train run, by railway and train number: every station it calls at with arrival/departure time. Covers Tokyo Metro, JR East, Toei and other Japan railway operators. Train numbers come from odpt_station_timetable rows. Needs an ODPT developer consumer key via _apiKey; Pipeworx supplies one if omitted. Example: odpt_train_timetable({ railway: "odpt.Railway:JR-East.Yamanote", train_number: "1234G" }).

ParameterTypeDescription
_apiKey *stringOptional: your own ODPT developer consumer key. Pipeworx supplies one if omitted.
railway *stringExact odpt.Railway id, e.g. "odpt.Railway:JR-East.Yamanote" or "odpt.Railway:TokyoMetro.Marunouchi".
train_number *stringThe train number as shown in a station timetable row, e.g. "1234G".

odpt_service_status

Live service status (current train information) for a Japanese railway line: normal operation, delays, or suspension, with the operator's own status text in Japanese and English and when it was last updated. Covers Tokyo Metro, JR East, Toei and other Japan railway operators publishing to ODPT. Needs an ODPT developer consumer key via _apiKey; Pipeworx supplies one if omitted. Example: odpt_service_status({ railway: "Yamanote", operator: "JR East" }).

ParameterTypeDescription
_apiKey *stringOptional: your own ODPT developer consumer key. Pipeworx supplies one if omitted.
operator *stringOperator, e.g. "Tokyo Metro", "JR East", "Toei", or an exact odpt.Operator id. Required if railway is not an exact id.
railwaystringRailway/line name (e.g. "Yamanote", "Marunouchi") or an exact odpt.Railway id. Optional if operator is given — returns all of that operator's lines.