Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
data:swiss-transport [2012/03/20 13:02] – created loleg | data:swiss-transport [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Swiss public transport API | + | ====== |
- | Introduction | + | |
- | The Transport API allows interested developers to build their own applications using public timetable data, whether they' | + | |
- | API Documentation | + | |
- | The Transport API builds on REST style resources which respond in JSON. Individual resources are detailed below. | + | |
- |  | + | |
- | /stations | + | |
- | / | + | |
- | 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:// | + | |
- | 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 === | + | See details here: [[project:transport_api|Transport API]]. |
- | < | + | |
- | GET http:// | + | |
- | </ | + | |
- | + | ||
- | === Example response === | + | |
- | < | + | |
- | { | + | |
- | " | + | |
- | { | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | " | + | |
- | }, { | + | |
- | </ | + |