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

NameTypeDescription
stop_idintThe 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
        },
        ...
    ]
}
NameTypeDescription
service_namestringThe service name of the departure (Edinburgh Trams is T50)
timestringThe time of the departure in H:MM
destinationstringThe destination displayed on the vehicle's destination board
dayintThe day(s) this departure operates. 1 is Mon-Fri, 5 is Saturday and 6 is Sunday.
note_idstringThe note ID for this departure time
valid_fromintThe time from which this departure is valid (can be superseded by newer timetables)