Stop-to-stop timetables

The stoptostop-timetable endpoint allows you to get timetables in the form of journeys between two stops on the same route. This information includes all services that pass by both stops at the requested time.

Resource

GET /v1/stoptostop-timetable/?start_stop_id={start_stop_id}&finish_stop_id={finish_stop_id}&date={date}&duration={duration}

Authorisation

API Authentication Token

Query Parameters

NameTypeDescription
start_stop_idintegerThe stop ID for the stop that begins the journey
finish_stop_idintegerThe stop ID for the stop that ends the journey
dateintegerThe date and time (in UNIX timestamp format) that the timetables will start from
durationintegerThe number of minutes from date to limit the number of timetables returned. The maximum duration is 120 (two hours).

Response

Status-Code: 200 OK
{
    "start_stop_id": 36236495,
    "finish_stop_id": 36232896,
    "date": 1424260800,
    "duration": 120,
    "journeys": [
        {
            "service_name": "1",
            "destination": "Easter Road (foot)",
            "departures": [
                {
                    "stop_id": 36236495,
                    "name": "Viewforth",
                    "time": "12:06",
                    "timing_point": false
                },
                {
                    "stop_id": 36236487,
                    "name": "Grove Street",
                    "time": "12:07",
                    "timing_point": false
                },
                {
                    "stop_id": 36232896,
                    "name": "S Clair Ave",
                    "time": "12:30",
                    "timing_point": false
                }
            ]
        },
        {
            "service_name": "35",
            "destination": "Ocean Terminal",
            "departures": [
                {
                    "stop_id": 36236495,
                    "name": "Viewforth",
                    "time": "12:03",
                    "timing_point": false
                },
                {
                    "stop_id": 36236392,
                    "name": "Semple Street",
                    "time": "12:06",
                    "timing_point": true
                },
                {
                    "stop_id": 36232896,
                    "name": "S Clair Ave",
                    "time": "12:31",
                    "timing_point": false
                }
            ]
        }
    ]
}
NameTypeDescription
service_namestringThe service name for this journey
destinationstringThe destination shown on front of the vehicle
departuresArrayA list of departure times for this journey. Each departure includes the stop's ID, name, time of departure (in HH:MM format) and whether or not the stop is a timing point (when displaying timetable information, we recommend only showing the start and finish stops and any stops in-between where timing_point is set to true