data:swiss-transport

This is an old revision of the document!


Swiss public transport API Introduction The Transport API allows interested developers to build their own applications using public timetable data, whether they're on the web, the desktop or mobile devices. Find out more about how you can start exploring the timetable data playground or just browse the API Documentation. API Documentation The Transport API builds on REST style resources which respond in JSON. Individual resources are detailed below.  /stations /connections /stationboard Returns the matching locations for the given parameters. The locations in the response are scored to determine which is the most exact location. This method can return a refine response, what means that the request has to be redone. Resource URL http://transport.opendata.ch/v1/locations Request Parameters Name query type Required Description Example Basel address required Specifies the location name to search for optional Specifies the location type, possible types are: all (default): Looks up for all types of locations station: Looks up for stations (train station, bus station) poi: Looks up for points of interest (Clock tower, China garden) address: Looks up for an address (Zurich Bahnhofstrasse 33)  Response parameters Name id type name score coordinates type x y Example Request Description The id of the location Type of the location, can contain: station: Location is a train station, bus station poi: Location is a point of interest (Clock tower, China garden) address: Location is an address refine: Location is not defined, the user has to relocate The location name The accuracy of fire The type of the given coordinate Latitude Longitude

=== Example Request ===

GET http://transport.opendata.ch/v1/locations?query=Basel

Example response

{
"stations": [
{
"coordinate": {
"type": "WGS84", "x": "8540192", "y": "47378177"
},
"id": "008503000", "name": "Zuerich", "score": "100"
}, {
  • data/swiss-transport.1332244932.txt.gz
  • Last modified: 2012/03/20 00:00
  • (external edit)