Hi,
in the past weeks and months, I rewrote the API which is used by the OpenRailwayMap website to search stations by name or reference, and for mileage (that's broken in the current API).
Main changes to the API are:
- All queries are fast. - Searching stations by name makes use of the ranking used for map rendering. The ranking is based on route relations with stop or platform members at that station. - Disused, abandoned, razed, proposed stations and stations under construction (applies to halts, junctions etc. as well) are supported. - Search by name includes all languages. - Search by railway line and mileage works again. - Network length API removed because these queries are either slow or require pre-processing.
Query examples:
https://api.openrailwaymap.org/v2/facility?name=Karlsruhe to search for stations whose name contains the word "Karlsruhe"
https://api.openrailwaymap.org/v2/facility?ref=RK to search by the reference code of the infrastructure operator (RK is the code for Karlsruhe Hbf).
https://api.openrailwaymap.org/v2/facility?uic_ref=<UIC ref> to search by UIC reference code
https://api.openrailwaymap.org/v2/facility?q=<string> to search by name, railway:ref and UIC number. Duplicates will be remove from the result list.
https://api.openrailwaymap.org/v2/milestone?ref=2134&position=24.6 to search milestones near km 24.6 on railway tracks with ref=2134.
Both endpoints support limit=<number> to change how many results are returned.
Please feel free to point out any issues, you find. Bugs are tracked in the GitHub repository of the API at https://github.com/OpenRailwayMap/OpenRailwayMap-api
Best regards
Michael
openrailwaymap@openrailwaymap.org