# Swiss Public Transport API

Category: [Transport](https://free-web-services.com/web-services/open-data/transport/)  
Page: https://free-web-services.com/web-services/open-data/transport/swiss-public-transport-api.html  
Documentation: https://transport.opendata.ch/docs.html

The Transport API from Opendata.ch gives Swiss public transport data: stops, connections from A to B and departure boards with platforms and delays, for example to plan a train trip from Lausanne to Basel. Call its REST endpoints and get JSON. Free, no key needed; there is no fixed rate limit, but frequent repeated requests are throttled. Cache answers and name opentransportdata.swiss as the source of the timetable data. An official MCP server at https://transport.opendata.ch/mcp lets AI agents look up stations, connections and departures.

- API key: Not needed
- Pricing: Free, no key needed; there is no fixed rate limit, but frequent repeated requests are throttled.
- From the browser: Yes (CORS)
- Formats: JSON
- Interface: REST, HTTP-GET, MCP
- Provider: transport.opendata.ch

Example request:

```sh
curl 'https://transport.opendata.ch/v1/connections?from=Lausanne&to=Basel&limit=2'
```

The JavaScript works in a web page as well as in Node.js 18 or newer.

