Journeys
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
Name | Type | Description |
---|---|---|
service_name | string | Name 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
},
...
]
}
]
}
Name | Type | Description |
---|---|---|
direction | string | The direction of the service - useful for filtering or information display |
destination | string | The destination displayed on the vehicle's destination board during this journey |
day | int | The day(s) this journey operates (0 for Mon-Fri, 5 for Saturday, 6 for Sunday) |
note_id | string | The note ID for this departure time |
valid_from | int | The journey is valid from this date - please note this journey may be superseded with a journey from a forthcoming timetable |
stop_id | int | The stop's SMS code |
time | string | The departure time in H:MM |
timing_point | boolean | Whether this departure is considered a timing point |
Updated less than a minute ago