Japan Railway Station API — Stations, Lines & Interchanges avatar

Japan Railway Station API — Stations, Lines & Interchanges

Pricing

from $1.00 / 1,000 station rows

Go to Apify Store
Japan Railway Station API — Stations, Lines & Interchanges

Japan Railway Station API — Stations, Lines & Interchanges

Every railway station in Japan with coordinates, line, operator, prefecture and municipality code - plus the interchanges at that station. 9,059 stations, 597 lines, 178 operators, Shinkansen and tram flags. Government open data, no scraping.

Pricing

from $1.00 / 1,000 station rows

Rating

0.0

(0)

Developer

Shota Tatara

Shota Tatara

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

11 days ago

Last modified

Share

Every railway station in Japan: where it is, which lines serve it, who runs them, and what you can change to there.

{
"stationName": "新宿",
"lineName": "山手線",
"operator": "東日本旅客鉄道",
"operatorType": "JR(在来線)",
"railwayClass": "普通鉄道(JR)",
"prefecture": "東京都",
"municipality": "新宿区",
"municipalityCode": "13104",
"latitude": 35.68843,
"longitude": 139.698615,
"interchangeCount": 6,
"connectingLines": [
"東京都 10号線新宿線",
"東京都 12号線大江戸線",
"東京地下鉄 4号線丸ノ内線",
"京王電鉄 京王線",
"小田急電鉄 小田原線",
"東日本旅客鉄道 中央線"
]
}

No scraping. No API keys. No rate limits. Compiled from Japanese government open data and shipped inside the Actor.


What is in it

9,059 stationsevery station in Japan, from Shinkansen termini to single-platform tram stops
10,160 station-line rowsone per station and line, because a station served by seven lines is seven facts
597 lines · 178 operatorsJR, private railways, subways, third-sector, municipal
104 Shinkansen stationsflagged, not guessed from the name
Interchangeswhich other lines serve the same physical station

What it adds to the raw data

The source (国土数値情報 鉄道) ships one line-segment per station per line, with no station identity, no area and two numeric code columns whose meanings are easy to swap. This Actor:

  • Places the station. Each feature is a stretch of track; the coordinate here is its centroid. Tokyo Station lands within 300 m of its real position — that is a regression test, not a claim.
  • Reconstructs interchanges by grouping features that share 駅グループコード. That is what turns seven unrelated rows into "Shinjuku, served by these seven lines".
  • Adds prefecture, municipality and the 5-digit municipality code, which the source does not contain at all, by matching each station to the nearest 位置参照情報 town centroid.
  • Decodes the classification columns correctly. N02_001 is 鉄道区分 and N02_002 is 事業者種別 — the opposite of what the column order suggests. Both were pinned against the real data: code 1 of 事業者種別 selects exactly the 104 Shinkansen rows, and 鉄道区分 25 selects exactly the Linimo maglev.

Use cases

  • Rank property by transport access. Combine near with a station's interchangeCount to score any address in Japan for connectivity.
  • Build a station picker or autocomplete. 9,059 names with coordinates, prefecture and municipality, in one download.
  • Join transit to any other dataset. municipalityCode is the key used by every Japanese government statistic.
  • Answer "what is the nearest station". A radius search returns stations sorted by distance.
  • Give an AI agent a Japan transit tool. It runs as an MCP tool: an agent can ask "which lines serve this station and what is nearby" and get typed rows back.

Input

{
"stationNames": ["新宿", "渋谷"],
"lineNames": ["山手"],
"operators": ["東日本旅客鉄道"],
"prefectures": ["東京都"],
"near": { "latitude": 35.6812, "longitude": 139.7671, "radiusMeters": 800 },
"shinkansenOnly": false,
"minInterchangeCount": 3,
"groupByStation": true,
"maxResults": 100
}

Every field is optional; an empty input returns the stations named 東京.

FieldMeaning
stationNamesJapanese station names, matched as substrings — 新宿 also finds 西新宿
lineNamesLine names as substrings — 山手 finds 山手線, 新幹線 finds every Shinkansen
operatorsOperator names as substrings — 東京地下鉄 for Tokyo Metro
prefecturesWith or without the suffix (東京 = 東京都)
municipalityCodes5-digit 全国地方公共団体コード
keywordSubstring across station, line, operator, prefecture and municipality
near{latitude, longitude, radiusMeters} — sorted by distance
shinkansenOnlyShinkansen stations only
minInterchangeCountSet to 3 or more to find the major hubs
groupByStationOne row per physical station, with all its lines in a lines array
maxResultsHard cap on rows — this is what determines the cost of the run

Output

One row per station and line by default, or one per station with groupByStation.

FieldDescription
stationName, lineName, operatorAs published, in Japanese
operatorTypeJR(新幹線)/ JR(在来線)/ 公営鉄道 / 民営鉄道 / 第三セクター
railwayClass普通鉄道, 軌道, 鋼索鉄道, 懸垂式鉄道, 跨座式鉄道, 案内軌条式鉄道, 無軌条鉄道, 浮上式鉄道
isShinkansen, isTram, isMonorailOrAgtReady-made booleans for the common filters
stationGroupCodeShared by every line serving the same physical station
prefecture, municipality, municipalityCodeDerived; the source has no area field
latitude, longitudeCentroid of the station's track geometry, WGS84
interchangeCount, connectingLinesThe other lines at the same station
distanceMetersRadius searches only

Pricing

Pay per event: a small charge to start the run, plus a charge per row returned. No proxy costs, because there is nothing to proxy.


Data sources

SourcePublisherLicence
国土数値情報 鉄道 (N02-23)国土交通省公共データ利用規約 第1.0版 (PDL1.0)
位置参照情報 大字・町丁目レベル国土交通省公共データ利用規約 第1.0版 (PDL1.0)

PDL1.0 permits commercial use and redistribution and requires the source credit plus a statement that the data was edited. Reproduced here and in every run's RUN_SUMMARY:

「国土数値情報(鉄道)」(国土交通省)(https://nlftp.mlit.go.jp/ksj/)をもとに jp-data-engine が加工して作成

「位置参照情報ダウンロードサービス」(国土交通省)(https://nlftp.mlit.go.jp/isj/)をもとに jp-data-engine が加工して作成


Known limits

  • Coordinates are the centroid of the track geometry, not the station building or a specific entrance. For a large station like Shinjuku that is a few hundred metres from some exits.
  • No timetables, fares or platform data. This is the network, not the schedule.
  • The municipality is inferred from the nearest town centroid rather than a boundary polygon. It is right for stations inside a built-up area; a station on a municipal border can fall on the wrong side.
  • Names are Japanese only. The source publishes no romanisation. Feed them through Japan Address Normalizer, Geocoder & Romanizer if you need the coordinates turned into a romanised address.
  • Freight-only lines and closed stations are not included; this is the passenger network as of the 2023 edition.

Local development

npm install
npm run build:data # downloads the government data and compiles the registry into data/
npm test # 12 tests, including the code-mapping regressions
npx apify run

Part of the jp-data-engine Japan data suite. See also Japan Land Price API — every survey site records its nearest station, so the two join directly.