Timetables
The timetables
endpoint provides all departures from a specific stop. All departure times are shown in H:MM
format - such as 4:32, 15:12 and 24:03. NightBus services are considered to start in the early morning, while day services can loop onto the next day (in this case, 24 is used for the hour instead of 0).
Multiple timetables may be in effect
Be aware that at certain times (up to several weeks before a service change) this endpoint may include more than one timetable - when this happens, each journey may be duplicated - one for the current timetable, one for the forthcoming timetable. Use the
valid_from
field to filter and sort journeys into separate tables.
Resource
GET /v1/timetables/{stop_id}
Authorisation
API Authentication Token
Update frequency
Once a day
Query Parameters
Name | Type | Description |
---|---|---|
stop_id | int | The SMS code of the stop you want the timetable for |
Response
Status-Code: 200 OK
{
"stop_id": 36232897,
"stop_name": "Easter Road",
"departures": [
{
"service_name": "1",
"time": "5:01",
"destination": "Easter Road",
"day": 0,
"note_id": "c",
"valid_from": 1414886400
},
{
"service_name": "35",
"time": "5:10",
"destination": "Ocean Terminal",
"day": 5,
"note_id": null,
"valid_from": 1414886400
},
{
"service_name": "1",
"time": "5:31",
"destination": "Easter Road",
"day": 6,
"note_id": null,
"valid_from": 1414886400
},
...
]
}
Name | Type | Description |
---|---|---|
service_name | string | The service name of the departure (Edinburgh Trams is T50) |
time | string | The time of the departure in H:MM |
destination | string | The destination displayed on the vehicle's destination board |
day | int | The day(s) this departure operates. 1 is Mon-Fri, 5 is Saturday and 6 is Sunday. |
note_id | string | The note ID for this departure time |
valid_from | int | The time from which this departure is valid (can be superseded by newer timetables) |
Updated less than a minute ago