{"openapi":"3.1.0","info":{"title":"Train Stations API","version":"1.0.0","description":"Search a database of 69,000+ European railway stations from the Trainline open dataset. Find stations by name and country, look one up by id or UIC code, or find all stations near a coordinate (radius search). Each record includes coordinates, UIC code, timezone and a main-station flag — ideal for travel apps, journey planners, ticketing and mobility tooling.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/trainstations-api","description":"oanor gateway"}],"tags":[{"name":"Stations"},{"name":"Countries"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/nearby":{"get":{"operationId":"get_v1_nearby","tags":["Stations"],"summary":"Stations near a coordinate (radius search)","description":"","parameters":[{"name":"lat","in":"query","required":true,"description":"Latitude (-90..90)","schema":{"type":"string"},"example":"47.378"},{"name":"lon","in":"query","required":true,"description":"Longitude (-180..180)","schema":{"type":"string"},"example":"8.540"},{"name":"radius_km","in":"query","required":false,"description":"Search radius in km (1-500, default 20)","schema":{"type":"string"},"example":"5"},{"name":"main_only","in":"query","required":false,"description":"Only main stations (true/false)","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max results (1-100, default 20)","schema":{"type":"string"},"example":"20"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":20,"center":{"lat":47.378,"lon":8.54},"results":[{"id":67344,"name":"Zuerich HB","country":"CH","latitude":47.37806,"timezone":"Europe/Zurich","longitude":8.54028,"is_airport":false,"distance_km":0.02,"main_station":false},{"id":6245,"uic":"8503000","name":"Zürich HB","country":"CH","latitude":47.37819,"timezone":"Europe/Zurich","longitude":8.5392,"is_airport":false,"distance_km":0.06,"main_station":true},{"id":18235,"uic":"8503088","name":"Zürich HB SZU","country":"CH","latitude":47.37819,"timezone":"Europe/Zurich","longitude":8.5392,"is_airport":false,"distance_km":0.06,"main_station":false},{"id":22614,"uic":"8595460","name":"Zürich HB (Carpark Sihlquai)","country":"CH","latitude":47.37819,"timezone":"Europe/Zurich","longitude":8.5392,"is_airport":false,"distance_km":0.06,"main_station":false},{"id":6401,"name":"Zürich","country":"CH","latitude":47.37897,"timezone":"Europe/Zurich","longitude":8.54053,"is_airport":false,"distance_km":0.12,"main_station":false},{"id":60997,"name":"Zürich Kanonengasse","country":"CH","latitude":47.37846,"timezone":"Europe/Zurich","longitude":8.53031,"is_airport":false,"distance_km":0.73,"main_station":false},{"id":36640,"name":"Zürich Selnau","country":"CH","latitude":47.37294,"timezone":"Europe/Zurich","longitude":8.53203,"is_airport":false,"distance_km":0.82,"main_station":false},{"id":61051,"name":"Zürich Röntgenstrasse","country":"CH","latitude":47.38193,"timezone":"Europe/Zurich","longitude":8.52926,"is_airport":false,"distance_km":0.92,"main_station":false},{"id":61095,"name":"Zürich Vogelsangstrasse","country":"CH","latitude":47.38354,"timezone":"Europe/Zurich","longitude":8.54907,"is_airport":false,"distance_km":0.92,"main_station":false},{"id":61026,"name":"Zürich Militär-/Langstrasse","country":"CH","latitude":47.3796,"timezone":"Europe/Zurich","longitude":8.52763,"is_airport":false,"distance_km":0.95,"main_station":false},{"id":61077,"name":"Zürich Spyriplatz","country":"CH","latitude":47.38229,"timezone":"Europe/Zurich","longitude":8.55198,"is_airport":false,"distance_km":1.02,"main_station":false},{"id":60976,"name":"Zürich Hinterbergstrasse","country":"CH","latitude":47.38011,"timezone":"Europe/Zurich","longitude":8.55458,"is_airport":false,"distance_km":1.12,"main_station":false},{"id":61059,"name":"Zürich Scheuchzerstrasse","country":"CH","latitude":47.38779,"timezone":"Europe/Zurich","longitude":8.54423,"is_airport":false,"distance_km":1.13,"main_station":false},{"id":61035,"name":"Zürich Nordstrasse","country":"CH","latitude":47.38833,"timezone":"Europe/Zurich","longitude":8.53617,"is_airport":false,"distance_km":1.18,"main_station":false},{"id":61038,"name":"Zürich Okenstrasse","country":"CH","latitude":47.38801,"timezone":"Europe/Zurich","longitude":8.53414,"is_airport":false,"distance_km":1.2,"main_station":false},{"id":60909,"name":"Zürich Bethanien","country":"CH","latitude":47.38091,"timezone":"Europe/Zurich","longitude":8.556,"is_airport":false,"distance_km":1.25,"main_station":false},{"id":36822,"name":"Zürich Stadelhofen","country":"CH","latitude":47.36661,"timezone":"Europe/Zurich","longitude":8.54847,"is_airport":false,"distance_km":1.42,"main_station":false},{"id":36093,"name":"Zürich Stadelhofen FB","country":"CH","latitude":47.36635,"timezone":"Europe/Zurich","longitude":8.54813,"is_airport":false,"distance_km":1.43,"main_station":false},{"id":36732,"name":"Zürich Wiedikon","country":"CH","latitude":47.37147,"timezone":"Europe/Zurich","longitude":8.52346,"is_airport":false,"distance_km":1.44,"main_station":false},{"id":61076,"name":"Zürich Sprecherstrasse","country":"CH","latitude":47.36749,"timezone":"Europe/Zurich","longitude":8.55226,"is_airport":false,"distance_km":1.49,"main_station":false}],"radius_km":5},"meta":{"timestamp":"2026-05-31T01:02:51.682Z","request_id":"7da163b2-8693-4fa2-944b-024b75954249"},"status":"ok","message":"Nearby stations retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/search":{"get":{"operationId":"get_v1_search","tags":["Stations"],"summary":"Search railway stations by name and country","description":"","parameters":[{"name":"q","in":"query","required":false,"description":"Station name (substring)","schema":{"type":"string"},"example":"Berlin Hbf"},{"name":"country","in":"query","required":false,"description":"Filter by ISO-2 country code","schema":{"type":"string"},"example":"DE"},{"name":"main_only","in":"query","required":false,"description":"Only main stations (true/false)","schema":{"type":"string"},"example":"true"},{"name":"limit","in":"query","required":false,"description":"Results per page (1-100, default 20)","schema":{"type":"string"},"example":"20"},{"name":"offset","in":"query","required":false,"description":"Pagination offset","schema":{"type":"string"},"example":"0"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":1,"limit":20,"total":1,"offset":0,"filters":{"q":"berlin hbf","country":"DE","main_only":true},"results":[{"id":7630,"uic":"8065969","name":"Berlin Hbf","country":"DE","latitude":52.52559,"timezone":"Europe/Berlin","longitude":13.36955,"is_airport":false,"main_station":true}]},"meta":{"timestamp":"2026-05-31T01:02:51.768Z","request_id":"85c05000-92ca-43c1-bdcb-0ca8de57a83f"},"status":"ok","message":"Search completed","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/station":{"get":{"operationId":"get_v1_station","tags":["Stations"],"summary":"A single station by id or UIC code","description":"","parameters":[{"name":"id","in":"query","required":false,"description":"Station id","schema":{"type":"string"},"example":"1128"},{"name":"uic","in":"query","required":false,"description":"UIC code (alternative to id)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":1128,"uic":"8727102","name":"Paris Gare du Nord","country":"FR","latitude":48.88018,"timezone":"Europe/Paris","longitude":2.35515,"is_airport":false,"main_station":false},"meta":{"timestamp":"2026-05-31T01:02:51.840Z","request_id":"e5685bef-29f9-418c-82de-f8aba10f81fa"},"status":"ok","message":"Station retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/countries":{"get":{"operationId":"get_v1_countries","tags":["Countries"],"summary":"Countries with station counts","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":43,"countries":[{"country":"CH","stations":22268},{"country":"DE","stations":13741},{"country":"FR","stations":6399},{"country":"SE","stations":5767},{"country":"ES","stations":5196},{"country":"IT","stations":5038},{"country":"GB","stations":2794},{"country":"AT","stations":1545},{"country":"NO","stations":856},{"country":"HR","stations":730},{"country":"BE","stations":574},{"country":"PL","stations":530},{"country":"CZ","stations":503},{"country":"NL","stations":447},{"country":"DK","stations":381},{"country":"IE","stations":295},{"country":"FI","stations":211},{"country":"UA","stations":210},{"country":"HU","stations":200},{"country":"BG","stations":188},{"country":"PT","stations":172},{"country":"RO","stations":152},{"country":"BA","stations":137},{"country":"SK","stations":122},{"country":"RS","stations":109},{"country":"GR","stations":91},{"country":"SI","stations":84},{"country":"LT","stations":83},{"country":"LU","stations":66},{"country":"RU","stations":27},{"country":"BY","stations":20},{"country":"MK","stations":19},{"country":"ME","stations":19},{"country":"EE","stations":15},{"country":"MA","stations":11},{"country":"AD","stations":10},{"country":"AL","stations":9},{"country":"LV","stations":8},{"country":"MT","stations":8},{"country":"CY","stations":8},{"country":"MD","stations":5},{"country":"TR","stations":3},{"country":"LI","stations":2}],"total_stations":69053},"meta":{"timestamp":"2026-05-31T01:02:51.908Z","request_id":"84072ac4-4044-4a54-9944-b1176b105901"},"status":"ok","message":"Countries retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Dataset totals & coverage","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"total":69053,"fields":["id","name","country","latitude","longitude","uic","timezone","main_station","is_airport"],"source":"Trainline EU stations database","coverage":"Europe (Trainline)","countries":43,"main_stations":828},"meta":{"timestamp":"2026-05-31T01:02:51.978Z","request_id":"8db76ac7-ec8e-4879-9745-84a29dadf740"},"status":"ok","message":"Meta retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":2000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":850,"monthly_call_quota":45000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2200,"monthly_call_quota":225000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5600,"monthly_call_quota":900000,"rps_limit":45,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/trainstations-api"}