Quiz Entry - updated: 2026.07.05
The transport.opendata.ch service is called a "REST API" — what does that mean in practice?
A REST API exposes data as addressable resources you reach by plain HTTP requests to URLs (endpoints), using HTTP methods like GET — so calling it is as simple as opening a URL.
REST (Representational State Transfer) is the architectural style behind most modern web APIs. The practical consequences you see in the transport example:
- Resources live at URLs. Each kind of data has its own endpoint —
/v1/locationsfor searching places,/v1/stationboardfor departures. - You use HTTP methods. Reading data is a
GET; the parameters go in the query string (?query=Basel). - It's stateless. Each request carries everything it needs; the server keeps no session between calls.
- Responses are a standard format, here JSON.
Because of all this, you can test a REST endpoint just by pasting the URL into a browser — http://transport.opendata.ch/v1/locations?query=Basel returns the JSON directly. That "it's just URLs" simplicity is a big reason REST displaced heavier styles like SOAP for public APIs.
Go deeper:
REST (Wikipedia) — the architectural constraints (statelessness, uniform interface, resources) behind the style.