{"_id":"54cbbea561698d0d00baf85d","project":"54995cb59da9390b00cffac6","user":"54995c979da9390b00cffac5","category":{"_id":"5499610f0195cc0b00dc32e2","pages":["549961290195cc0b00dc32e3","549961320195cc0b00dc32e5","5499613c0195cc0b00dc32e7","549961499da9390b00cffad7","549961549da9390b00cffad9","5499615f9da9390b00cffadb","5499646c0195cc0b00dc32fb","549a60225b50c21400fae6b8","54cbbea561698d0d00baf85d"],"project":"54995cb59da9390b00cffac6","version":"54995cb59da9390b00cffac9","__v":9,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-23T12:33:19.815Z","from_sync":false,"order":9999,"slug":"api-reference","title":"API Reference"},"version":{"_id":"54995cb59da9390b00cffac9","__v":3,"project":"54995cb59da9390b00cffac6","createdAt":"2014-12-23T12:14:45.422Z","releaseDate":"2014-12-23T12:14:45.422Z","categories":["54995cb59da9390b00cffaca","54995e289da9390b00cffad0","5499610f0195cc0b00dc32e2"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"githubsync":"","__v":14,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-01-30T17:25:57.622Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"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.\n\n## Resource\n\n    GET /v1/stoptostop-timetable/?start_stop_id={start_stop_id}&finish_stop_id={finish_stop_id}&date={date}&duration={duration}\n\n## Authorisation\n\nAPI Authentication Token\n\n## Query Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`start_stop_id`\",\n    \"0-1\": \"`integer`\",\n    \"1-0\": \"`finish_stop_id`\",\n    \"1-1\": \"`integer`\",\n    \"2-0\": \"`date`\",\n    \"2-1\": \"`integer`\",\n    \"3-0\": \"`duration`\",\n    \"3-1\": \"`integer`\",\n    \"0-2\": \"The stop ID for the stop that begins the journey\",\n    \"1-2\": \"The stop ID for the stop that ends the journey\",\n    \"2-2\": \"The date and time (in UNIX timestamp format) that the timetables will start from\",\n    \"3-2\": \"The number of minutes from `date` to limit the number of timetables returned. The maximum `duration` is 120 (two hours).\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]\n## Response\n\n    Status-Code: 200 OK\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"start_stop_id\\\": 36236495,\\n    \\\"finish_stop_id\\\": 36232896,\\n    \\\"date\\\": 1424260800,\\n    \\\"duration\\\": 120,\\n    \\\"journeys\\\": [\\n        {\\n            \\\"service_name\\\": \\\"1\\\",\\n            \\\"destination\\\": \\\"Easter Road (foot)\\\",\\n            \\\"departures\\\": [\\n                {\\n                    \\\"stop_id\\\": 36236495,\\n                    \\\"name\\\": \\\"Viewforth\\\",\\n                    \\\"time\\\": \\\"12:06\\\",\\n                    \\\"timing_point\\\": false\\n                },\\n                {\\n                    \\\"stop_id\\\": 36236487,\\n                    \\\"name\\\": \\\"Grove Street\\\",\\n                    \\\"time\\\": \\\"12:07\\\",\\n                    \\\"timing_point\\\": false\\n                },\\n                {\\n                    \\\"stop_id\\\": 36232896,\\n                    \\\"name\\\": \\\"S Clair Ave\\\",\\n                    \\\"time\\\": \\\"12:30\\\",\\n                    \\\"timing_point\\\": false\\n                }\\n            ]\\n        },\\n        {\\n            \\\"service_name\\\": \\\"35\\\",\\n            \\\"destination\\\": \\\"Ocean Terminal\\\",\\n            \\\"departures\\\": [\\n                {\\n                    \\\"stop_id\\\": 36236495,\\n                    \\\"name\\\": \\\"Viewforth\\\",\\n                    \\\"time\\\": \\\"12:03\\\",\\n                    \\\"timing_point\\\": false\\n                },\\n                {\\n                    \\\"stop_id\\\": 36236392,\\n                    \\\"name\\\": \\\"Semple Street\\\",\\n                    \\\"time\\\": \\\"12:06\\\",\\n                    \\\"timing_point\\\": true\\n                },\\n                {\\n                    \\\"stop_id\\\": 36232896,\\n                    \\\"name\\\": \\\"S Clair Ave\\\",\\n                    \\\"time\\\": \\\"12:31\\\",\\n                    \\\"timing_point\\\": false\\n                }\\n            ]\\n        }\\n    ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`service_name`\",\n    \"0-1\": \"`string`\",\n    \"0-2\": \"The service name for this journey\",\n    \"1-0\": \"`destination`\",\n    \"1-1\": \"`string`\",\n    \"1-2\": \"The destination shown on front of the vehicle\",\n    \"2-0\": \"`departures`\",\n    \"2-1\": \"`Array`\",\n    \"2-2\": \"A 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](http://en.wikipedia.org/wiki/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`\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]","excerpt":"","slug":"stop-to-stop-timetables","type":"basic","title":"Stop-to-stop timetables"}

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 [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`start_stop_id`", "0-1": "`integer`", "1-0": "`finish_stop_id`", "1-1": "`integer`", "2-0": "`date`", "2-1": "`integer`", "3-0": "`duration`", "3-1": "`integer`", "0-2": "The stop ID for the stop that begins the journey", "1-2": "The stop ID for the stop that ends the journey", "2-2": "The date and time (in UNIX timestamp format) that the timetables will start from", "3-2": "The number of minutes from `date` to limit the number of timetables returned. The maximum `duration` is 120 (two hours)." }, "cols": 3, "rows": 4 } [/block] ## Response Status-Code: 200 OK [block:code] { "codes": [ { "code": "{\n \"start_stop_id\": 36236495,\n \"finish_stop_id\": 36232896,\n \"date\": 1424260800,\n \"duration\": 120,\n \"journeys\": [\n {\n \"service_name\": \"1\",\n \"destination\": \"Easter Road (foot)\",\n \"departures\": [\n {\n \"stop_id\": 36236495,\n \"name\": \"Viewforth\",\n \"time\": \"12:06\",\n \"timing_point\": false\n },\n {\n \"stop_id\": 36236487,\n \"name\": \"Grove Street\",\n \"time\": \"12:07\",\n \"timing_point\": false\n },\n {\n \"stop_id\": 36232896,\n \"name\": \"S Clair Ave\",\n \"time\": \"12:30\",\n \"timing_point\": false\n }\n ]\n },\n {\n \"service_name\": \"35\",\n \"destination\": \"Ocean Terminal\",\n \"departures\": [\n {\n \"stop_id\": 36236495,\n \"name\": \"Viewforth\",\n \"time\": \"12:03\",\n \"timing_point\": false\n },\n {\n \"stop_id\": 36236392,\n \"name\": \"Semple Street\",\n \"time\": \"12:06\",\n \"timing_point\": true\n },\n {\n \"stop_id\": 36232896,\n \"name\": \"S Clair Ave\",\n \"time\": \"12:31\",\n \"timing_point\": false\n }\n ]\n }\n ]\n}", "language": "json" } ] } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`service_name`", "0-1": "`string`", "0-2": "The service name for this journey", "1-0": "`destination`", "1-1": "`string`", "1-2": "The destination shown on front of the vehicle", "2-0": "`departures`", "2-1": "`Array`", "2-2": "A 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](http://en.wikipedia.org/wiki/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`" }, "cols": 3, "rows": 3 } [/block]