The journeys endpoint gives you information on every journey made by a bus or tram service. Each journey contains the departure times at each stop on the journey. This information is similar to the timetables endpoint, but pivoted to show individual journeys over a range of stops, rather than a list of departures from one 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).

This endpoint is useful for applications such as producing calling points or displaying upcoming stops on a journey. Please be aware that high-frequency services such as bus services 22, 26 and 44 return results over 2Mb in size.

📘

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/journeys/{service_name}

Authorisation

API Authentication Token

Update frequency

Once a day

Query Parameters

NameTypeDescription
service_namestringName of the bus or tram service (Edinburgh Trams is T50)

Response

Status-Code: 200 OK
{
    "service_name": "1",
    "journeys": [
        {
            "direction": "East",
            "destination": "Easter Road (foot)",
            "day": 0,
            "note_id": "a",
            "valid_from": 1414886400,
            "departures": [
                {
                    "stop_id": 36237636,
                    "time": "4:21",
                    "timing_point": true
                },
                {
                    "stop_id": 36237632,
                    "time": "4:22",
                    "timing_point": false
                },
                {
                    "stop_id": 36237626,
                    "time": "4:23",
                    "timing_point": false
                },
                ...
            ]
        }
    ]
}
NameTypeDescription
directionstringThe direction of the service - useful for filtering or information display
destinationstringThe destination displayed on the vehicle's destination board during this journey
dayintThe day(s) this journey operates (0 for Mon-Fri, 5 for Saturday, 6 for Sunday)
note_idstringThe note ID for this departure time
valid_fromintThe journey is valid from this date - please note this journey may be superseded with a journey from a forthcoming timetable
stop_idintThe stop's SMS code
timestringThe departure time in H:MM
timing_pointbooleanWhether this departure is considered a timing point