Station codes like GMR, PSE or YK are used everywhere in Indonesia, from train tickets to travel apps. The operators’ own station lists are not published as reusable data, though. Open sources exist (OpenStreetMap, Wikidata and Wikipedia), but they mix in stations that closed decades ago, and their codes sometimes disagree.
I joined the three open sources and matched every station against the operators’ passenger station lists before it went into the Railway Station API on API Indonesia (/api/v1/stasiun).
What is in it
- 1,129 stations in 13 provinces, each with latitude, longitude and Kemendagri region codes.
- 660 active stations: 449 intercity and regional rail, 155 KRL commuter, 36 LRT, 13 MRT, 4 airport rail and 3 high-speed rail. The other 469 are inactive stations whose location is still on record.
- Station codes for 993 stations, Daop/Divre (operating region) for 957 and elevation for 781.
- A
layananfield for stations served by more than one kind of train, for example Pasar Senen (intercity and KRL) or Halim (high-speed rail and LRT). - Nearest-station search from a point.
How it was checked
The passenger station lists from KAI, KAI Commuter, MRT Jakarta and LRT Jabodebek are not copied, because they are not openly licensed. They are only used to check:
- whether a station actually serves passengers (
melayani_penumpang, confirmed for 518 stations), - which code is right when the open sources disagree.
Of 44 conflicting codes, 12 could be settled with an operator list. The rest are left empty rather than wrong.
validasi = terverifikasi means at least two sources agree within 1 km with a matching code or name, and for active stations a match in an operator list as well. 491 active stations pass.
Things that are not railway stations were removed too: amusement park rides, platform labels, building parts and even an office that had been tagged as a station.
Using it
Look a station up by code:
curl "https://use.apiindonesia.id/api/v1/stasiun/GMR" \
-H "x-api-key: YOUR_API_KEY"
Nearest KRL stations to a point:
curl "https://use.apiindonesia.id/api/v1/stasiun/nearby?lat=-6.2&lng=106.82&jenis=krl" \
-H "x-api-key: YOUR_API_KEY"
Limits
Station class (large, medium, small) is not included, because no open source records it. Some active stations are confirmed by open sources only, not by an operator list yet, such as parts of the South Sumatra LRT and Jakarta LRT.
A few more things to know:
- The
nearbyendpoint only returns active stations. Addstatus=semuaif you also want inactive ones. - The data includes OpenStreetMap (ODbL 1.0) and Wikipedia (CC BY-SA) data. Every response carries
meta.attribution.
Pricing: 2 credits (Rp2) per successful request, and failed requests are free.
Product page: https://apiindonesia.id/produk/stasiun/ Docs: https://docs.apiindonesia.id/#stasiun