{"openapi":"3.1.0","info":{"title":"Swiss Transit API","version":"1.0.0","description":"Switzerland's public-transport timetable as an API, powered by the official Swiss open transport service (transport.opendata.ch, built on the search.ch timetable). One of the densest and most punctual transit networks in the world — trains (SBB/CFF/FFS), trams, city and postbuses, boats, funiculars and cable cars — in a single clean API. Find stops, stations and addresses by name with their identifier and coordinates; plan a complete door-to-door journey between any two places with optional via stop, date and time and the option to search by arrival time, getting each connection's departure and arrival times and platforms, total duration in minutes, the number of transfers, the transport products used (for example IC 8 or S 8) and the full leg-by-leg breakdown including any walking sections; and read a station's live departure or arrival board with the line, destination, time, platform and any real-time delay. Ideal for journey-planner and mobility apps, travel tools, logistics and tourism in Switzerland. Place names accept stop names or station ids from the locations endpoint, and times include live delays where available. Data from transport.opendata.ch (Swiss open transport data); covers Switzerland and immediate cross-border connections.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/swisstransit-api","description":"oanor gateway"}],"tags":[{"name":"Transit"},{"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/connections":{"get":{"operationId":"get_v1_connections","tags":["Transit"],"summary":"Plan a journey","description":"","parameters":[{"name":"from","in":"query","required":true,"description":"Origin, e.g. Bern","schema":{"type":"string"},"example":"Bern"},{"name":"to","in":"query","required":true,"description":"Destination, e.g. Zurich","schema":{"type":"string"},"example":"Zurich"},{"name":"via","in":"query","required":false,"description":"Optional via stop","schema":{"type":"string"}},{"name":"date","in":"query","required":false,"description":"YYYY-MM-DD","schema":{"type":"string"}},{"name":"time","in":"query","required":false,"description":"HH:MM","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max connections (1-16)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"to":"Zurich","from":"Bern","count":4,"connections":[{"legs":[{"to":"St. Gallen","from":"Bern","line":"IC 1","type":"transit","arrival":"2026-06-01T19:28:00+0200","departure":"2026-06-01T18:31:00+0200","departure_platform":"8"}],"arrival":"2026-06-01T19:28:00+0200","products":["IC 1"],"departure":"2026-06-01T18:31:00+0200","transfers":0,"arrival_platform":"33","duration_minutes":61,"departure_platform":"8"},{"legs":[{"to":"Zürich HB","from":"Bern","line":"IR 16","type":"transit","arrival":"2026-06-01T19:54:00+0200","departure":"2026-06-01T18:36:00+0200","departure_platform":"12"}],"arrival":"2026-06-01T19:54:00+0200","products":["IR 16"],"departure":"2026-06-01T18:36:00+0200","transfers":0,"arrival_platform":"15","duration_minutes":77,"departure_platform":"12"},{"legs":[{"to":"Romanshorn","from":"Bern","line":"IC 8","type":"transit","arrival":"2026-06-01T19:58:00+0200","departure":"2026-06-01T19:02:00+0200","departure_platform":"2"}],"arrival":"2026-06-01T19:58:00+0200","products":["IC 8"],"departure":"2026-06-01T19:02:00+0200","transfers":0,"arrival_platform":"34","duration_minutes":65,"departure_platform":"2"},{"legs":[{"to":"St. Gallen","from":"Bern","line":"IC 1","type":"transit","arrival":"2026-06-01T20:28:00+0200","departure":"2026-06-01T19:31:00+0200","departure_platform":"8"}],"arrival":"2026-06-01T20:28:00+0200","products":["IC 1"],"departure":"2026-06-01T19:31:00+0200","transfers":0,"arrival_platform":"33","duration_minutes":62,"departure_platform":"8"}]},"meta":{"timestamp":"2026-06-01T16:24:03.513Z","request_id":"ed73a1c7-6a69-4bd0-acb0-a1073ba710da"},"status":"ok","message":"Connections 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/locations":{"get":{"operationId":"get_v1_locations","tags":["Transit"],"summary":"Find stops & stations","description":"","parameters":[{"name":"query","in":"query","required":true,"description":"Place name, e.g. Bern","schema":{"type":"string"},"example":"Bern"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":10,"query":"Bern","locations":[{"id":"8507000","name":"Bern","type":"train","latitude":46.948823,"longitude":7.439123},{"id":"8576646","name":"Bern, Bahnhof","type":"tram","latitude":46.948095,"longitude":7.440213},{"id":"8579896","name":"Bern, Hirschengraben","type":"tram","latitude":46.946664,"longitude":7.437626},{"id":"8507110","name":"Bern, Zytglogge","type":"tram","latitude":46.947834,"longitude":7.447504},{"id":"8516161","name":"Bern Wankdorf","type":"train","latitude":46.967818,"longitude":7.465483},{"id":"8504108","name":"Bern Europaplatz","type":"train","latitude":46.944204,"longitude":7.406116},{"id":"8588989","name":"Bern, Bärenplatz","type":"tram","latitude":46.948113,"longitude":7.442854},{"id":"8579897","name":"Bern, Kocherpark","type":"tram","latitude":46.945873,"longitude":7.43404},{"id":"8507061","name":"Bern, Brunnadernstrasse","type":"tram","latitude":46.941175,"longitude":7.463722},{"id":"8507060","name":"Bern, Helvetiaplatz","type":"tram","latitude":46.943893,"longitude":7.44921}]},"meta":{"timestamp":"2026-06-01T16:24:04.430Z","request_id":"28505e80-e1fe-4859-99b8-8b489f0550f8"},"status":"ok","message":"Locations 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/stationboard":{"get":{"operationId":"get_v1_stationboard","tags":["Transit"],"summary":"Live departure/arrival board","description":"","parameters":[{"name":"station","in":"query","required":true,"description":"Station, e.g. Bern","schema":{"type":"string"},"example":"Bern"},{"name":"type","in":"query","required":false,"description":"departure|arrival","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Max (1-40)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"type":"departure","board":[{"to":"Jegenstorf","line":"S 8","operator":"RBS","platform":"24","departure":"2026-06-01T18:24:00+0200","delay_minutes":0},{"to":"Worb Dorf","line":"S 7","operator":"RBS","platform":"23","departure":"2026-06-01T18:30:00+0200","delay_minutes":0},{"to":"Biel/Bienne","line":"S 3","operator":"BLS-bls","platform":"10","departure":"2026-06-01T18:30:00+0200","delay_minutes":0},{"to":"St. Gallen","line":"IC 1","operator":"SBB","platform":"8","departure":"2026-06-01T18:31:00+0200","delay_minutes":5},{"to":"Unterzollikofen","line":"S 9","operator":"RBS","platform":"22","departure":"2026-06-01T18:31:00+0200","delay_minutes":0},{"to":"Belp","line":"S 3","operator":"BLS-bls","platform":"1A-D","departure":"2026-06-01T18:32:00+0200","delay_minutes":0},{"to":"Basel SBB","line":"EC 000064","operator":"SBB","platform":"5","departure":"2026-06-01T18:33:00+0200","delay_minutes":1},{"to":"Domodossola (I)","line":"EC 000067","operator":"SBB","platform":"7","departure":"2026-06-01T18:34:00+0200","delay_minutes":0},{"to":"Genève-Aéroport","line":"IC 1","operator":"SBB","platform":"6","departure":"2026-06-01T18:34:00+0200","delay_minutes":2},{"to":"Murten/Morat","line":"S 52","operator":"BLS-bls","platform":"13D-F","departure":"2026-06-01T18:34:00+0200","delay_minutes":0},{"to":"Ins","line":"S 52","operator":"BLS-bls","platform":"13D-F","departure":"2026-06-01T18:34:00+0200","delay_minutes":0}],"count":11,"station":"Bern"},"meta":{"timestamp":"2026-06-01T16:24:05.413Z","request_id":"a1e784fd-1bd6-41ef-8d5f-ccd60a5a8a0a"},"status":"ok","message":"Stationboard 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":"Usage notes","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Switzerland's complete public-transport timetable — trains (SBB/CFF/FFS), trams, buses, postbuses, boats, funiculars and cable cars. /v1/locations?query=Zürich = find stops, stations and addresses with their id and coordinates; /v1/connections?from=Zürich&to=Bern = plan a door-to-door journey (optional via, date as YYYY-MM-DD, time as HH:MM, arrival=true to search by arrival time) returning each option's departure & arrival times and platforms, total duration in minutes, number of transfers, the transport products used (e.g. IC 8) and the leg-by-leg breakdown including walking sections; /v1/stationboard?station=Bern (type=departure|arrival) = the live board for a station — line, destination, time, platform and any delay. Place names accept stop names or station ids from /v1/locations. Times include live delays where available. Data from transport.opendata.ch (Swiss open transport data). Covers Switzerland and immediate cross-border connections.","source":"Swiss public transport API — transport.opendata.ch (search.ch / Swiss open data)","endpoints":["/v1/locations","/v1/connections","/v1/stationboard","/v1/meta"]},"meta":{"timestamp":"2026-06-01T16:24:05.467Z","request_id":"b7998463-0c50-4754-9900-74b0a2955b35"},"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":595,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":710,"monthly_call_quota":21600,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2150,"monthly_call_quota":91200,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5950,"monthly_call_quota":388000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/swisstransit-api"}