{"_id":"5a9d42bd714e020053e74ba3","project":"54995cb59da9390b00cffac6","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"},"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"},"user":"54995c979da9390b00cffac5","githubsync":"","__v":0,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-03-05T13:14:37.862Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"The `live_bus_times` endpoint provides real-time information on upcoming departure for a bus stop.\n\n## Update frequency\n\nEvery 30 seconds\n\n## Resource\n\n    GET /v1/live_bus_times/[stop_id]\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\": \"`stop_id`\",\n    \"0-1\": \"int\",\n    \"0-2\": \"The SMS code of the stop you want live departure times for\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n## Response\n\n    Status-Code: 200 OK\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[{\\n\\t\\t\\\"routeName\\\": \\\"25\\\",\\n\\t\\t\\\"departures\\\": [{\\n\\t\\t\\t\\t\\\"sms\\\": \\\"36235979\\\",\\n\\t\\t\\t\\t\\\"routeName\\\": \\\"25\\\",\\n\\t\\t\\t\\t\\\"destination\\\": \\\"Restalrig\\\",\\n\\t\\t\\t\\t\\\"tripId\\\": \\\"7506\\\",\\n\\t\\t\\t\\t\\\"vehicleId\\\": \\\"740\\\",\\n\\t\\t\\t\\t\\\"stopSequence\\\": 1,\\n\\t\\t\\t\\t\\\"isTerminatingHere\\\": false,\\n\\t\\t\\t\\t\\\"departureTimeUnix\\\": 1520255580,\\n\\t\\t\\t\\t\\\"departureTime\\\": \\\"2018-03-05T13:13:00+00:00\\\",\\n\\t\\t\\t\\t\\\"isLive\\\": false,\\n\\t\\t\\t\\t\\\"isDiverted\\\": false,\\n\\t\\t\\t\\t\\\"stopPoint\\\": null\\n\\t\\t\\t},\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\\"sms\\\": \\\"36235979\\\",\\n\\t\\t\\t\\t\\\"routeName\\\": \\\"25\\\",\\n\\t\\t\\t\\t\\\"destination\\\": \\\"Restalrig\\\",\\n\\t\\t\\t\\t\\\"tripId\\\": \\\"7474\\\",\\n\\t\\t\\t\\t\\\"vehicleId\\\": \\\"743\\\",\\n\\t\\t\\t\\t\\\"stopSequence\\\": 4,\\n\\t\\t\\t\\t\\\"isTerminatingHere\\\": false,\\n\\t\\t\\t\\t\\\"departureTimeUnix\\\": 1520255925,\\n\\t\\t\\t\\t\\\"departureTime\\\": \\\"2018-03-05T13:18:45+00:00\\\",\\n\\t\\t\\t\\t\\\"isLive\\\": true,\\n\\t\\t\\t\\t\\\"isDiverted\\\": false,\\n\\t\\t\\t\\t\\\"stopPoint\\\": null\\n\\t\\t\\t}\\n\\t\\t]\\n\\t},\\n\\t{\\n\\t\\t\\\"routeName\\\": \\\"22\\\",\\n\\t\\t\\\"departures\\\": [{\\n\\t\\t\\t\\t\\\"sms\\\": \\\"36235979\\\",\\n\\t\\t\\t\\t\\\"routeName\\\": \\\"22\\\",\\n\\t\\t\\t\\t\\\"destination\\\": \\\"Ocean Terminal\\\",\\n\\t\\t\\t\\t\\\"tripId\\\": \\\"4220\\\",\\n\\t\\t\\t\\t\\\"vehicleId\\\": \\\"456\\\",\\n\\t\\t\\t\\t\\\"stopSequence\\\": 2,\\n\\t\\t\\t\\t\\\"isTerminatingHere\\\": false,\\n\\t\\t\\t\\t\\\"departureTimeUnix\\\": 1520255739,\\n\\t\\t\\t\\t\\\"departureTime\\\": \\\"2018-03-05T13:15:39+00:00\\\",\\n\\t\\t\\t\\t\\\"isLive\\\": true,\\n\\t\\t\\t\\t\\\"isDiverted\\\": false,\\n\\t\\t\\t\\t\\\"stopPoint\\\": null\\n\\t\\t\\t},\\n\\t\\t\\t{\\n\\t\\t\\t\\t\\\"sms\\\": \\\"36235979\\\",\\n\\t\\t\\t\\t\\\"routeName\\\": \\\"22\\\",\\n\\t\\t\\t\\t\\\"destination\\\": \\\"Ocean Terminal\\\",\\n\\t\\t\\t\\t\\\"tripId\\\": \\\"4232\\\",\\n\\t\\t\\t\\t\\\"vehicleId\\\": \\\"414\\\",\\n\\t\\t\\t\\t\\\"stopSequence\\\": 12,\\n\\t\\t\\t\\t\\\"isTerminatingHere\\\": false,\\n\\t\\t\\t\\t\\\"departureTimeUnix\\\": 1520256812,\\n\\t\\t\\t\\t\\\"departureTime\\\": \\\"2018-03-05T13:33:32+00:00\\\",\\n\\t\\t\\t\\t\\\"isLive\\\": true,\\n\\t\\t\\t\\t\\\"isDiverted\\\": false,\\n\\t\\t\\t\\t\\\"stopPoint\\\": null\\n\\t\\t\\t}\\n\\t\\t]\\n\\t}\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`sms`\",\n    \"1-0\": \"`routeName`\",\n    \"2-0\": \"`destination`\",\n    \"3-0\": \"`tripId`\",\n    \"4-0\": \"`vehicleId`\",\n    \"5-0\": \"`stopSequence`\",\n    \"6-0\": \"`isTerminatingHere`\",\n    \"7-0\": \"`departureTimeUnix`\",\n    \"8-0\": \"`departureTime`\",\n    \"9-0\": \"`isLive`\",\n    \"10-0\": \"`isDiverted`\",\n    \"11-0\": \"`stopPoint`\",\n    \"0-1\": \"int\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"The SMS number of the stop\",\n    \"1-1\": \"string\",\n    \"1-2\": \"The service name of this journey\",\n    \"2-1\": \"string\",\n    \"2-2\": \"The destination of this journey\",\n    \"3-1\": \"int\",\n    \"3-2\": \"A unique numerical ID used for this real-time journey (this ID is not the same as the journeyID used in /timetables or /journeys)\",\n    \"4-1\": \"string\",\n    \"4-2\": \"The fleet number of the bus serving this journey\",\n    \"5-1\": \"int\",\n    \"5-2\": \"This is a number that represents how many stops into this journey this stop is\",\n    \"6-1\": \"boolean\",\n    \"6-2\": \"`true` if this is the last stop of this journey. We usually don't show terminating departures in our departure boards\",\n    \"7-1\": \"int\",\n    \"7-2\": \"The departure time of this bus from this stop in the form of a UNIX timestamp\",\n    \"8-1\": \"string\",\n    \"8-2\": \"The departure time of this bus from this stop in the form of a ISO 8601 date/time\",\n    \"9-1\": \"boolean\",\n    \"9-2\": \"`true` if the bus on this journey is being tracked and the departure time is an accurate estimation\",\n    \"10-1\": \"boolean\",\n    \"10-2\": \"`true` if this portion of the journey is being diverted past this stop.\",\n    \"11-1\": \"string\",\n    \"11-2\": \"Reserved for future use\"\n  },\n  \"cols\": 3,\n  \"rows\": 12\n}\n[/block]","excerpt":"","slug":"live-bus-times","type":"basic","title":"Live bus times"}
The `live_bus_times` endpoint provides real-time information on upcoming departure for a bus stop. ## Update frequency Every 30 seconds ## Resource GET /v1/live_bus_times/[stop_id] ## Authorisation API Authentication Token ## Query parameters [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`stop_id`", "0-1": "int", "0-2": "The SMS code of the stop you want live departure times for" }, "cols": 3, "rows": 1 } [/block] ## Response Status-Code: 200 OK [block:code] { "codes": [ { "code": "[{\n\t\t\"routeName\": \"25\",\n\t\t\"departures\": [{\n\t\t\t\t\"sms\": \"36235979\",\n\t\t\t\t\"routeName\": \"25\",\n\t\t\t\t\"destination\": \"Restalrig\",\n\t\t\t\t\"tripId\": \"7506\",\n\t\t\t\t\"vehicleId\": \"740\",\n\t\t\t\t\"stopSequence\": 1,\n\t\t\t\t\"isTerminatingHere\": false,\n\t\t\t\t\"departureTimeUnix\": 1520255580,\n\t\t\t\t\"departureTime\": \"2018-03-05T13:13:00+00:00\",\n\t\t\t\t\"isLive\": false,\n\t\t\t\t\"isDiverted\": false,\n\t\t\t\t\"stopPoint\": null\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"sms\": \"36235979\",\n\t\t\t\t\"routeName\": \"25\",\n\t\t\t\t\"destination\": \"Restalrig\",\n\t\t\t\t\"tripId\": \"7474\",\n\t\t\t\t\"vehicleId\": \"743\",\n\t\t\t\t\"stopSequence\": 4,\n\t\t\t\t\"isTerminatingHere\": false,\n\t\t\t\t\"departureTimeUnix\": 1520255925,\n\t\t\t\t\"departureTime\": \"2018-03-05T13:18:45+00:00\",\n\t\t\t\t\"isLive\": true,\n\t\t\t\t\"isDiverted\": false,\n\t\t\t\t\"stopPoint\": null\n\t\t\t}\n\t\t]\n\t},\n\t{\n\t\t\"routeName\": \"22\",\n\t\t\"departures\": [{\n\t\t\t\t\"sms\": \"36235979\",\n\t\t\t\t\"routeName\": \"22\",\n\t\t\t\t\"destination\": \"Ocean Terminal\",\n\t\t\t\t\"tripId\": \"4220\",\n\t\t\t\t\"vehicleId\": \"456\",\n\t\t\t\t\"stopSequence\": 2,\n\t\t\t\t\"isTerminatingHere\": false,\n\t\t\t\t\"departureTimeUnix\": 1520255739,\n\t\t\t\t\"departureTime\": \"2018-03-05T13:15:39+00:00\",\n\t\t\t\t\"isLive\": true,\n\t\t\t\t\"isDiverted\": false,\n\t\t\t\t\"stopPoint\": null\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"sms\": \"36235979\",\n\t\t\t\t\"routeName\": \"22\",\n\t\t\t\t\"destination\": \"Ocean Terminal\",\n\t\t\t\t\"tripId\": \"4232\",\n\t\t\t\t\"vehicleId\": \"414\",\n\t\t\t\t\"stopSequence\": 12,\n\t\t\t\t\"isTerminatingHere\": false,\n\t\t\t\t\"departureTimeUnix\": 1520256812,\n\t\t\t\t\"departureTime\": \"2018-03-05T13:33:32+00:00\",\n\t\t\t\t\"isLive\": true,\n\t\t\t\t\"isDiverted\": false,\n\t\t\t\t\"stopPoint\": null\n\t\t\t}\n\t\t]\n\t}\n]", "language": "json" } ] } [/block] [block:parameters] { "data": { "0-0": "`sms`", "1-0": "`routeName`", "2-0": "`destination`", "3-0": "`tripId`", "4-0": "`vehicleId`", "5-0": "`stopSequence`", "6-0": "`isTerminatingHere`", "7-0": "`departureTimeUnix`", "8-0": "`departureTime`", "9-0": "`isLive`", "10-0": "`isDiverted`", "11-0": "`stopPoint`", "0-1": "int", "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-2": "The SMS number of the stop", "1-1": "string", "1-2": "The service name of this journey", "2-1": "string", "2-2": "The destination of this journey", "3-1": "int", "3-2": "A unique numerical ID used for this real-time journey (this ID is not the same as the journeyID used in /timetables or /journeys)", "4-1": "string", "4-2": "The fleet number of the bus serving this journey", "5-1": "int", "5-2": "This is a number that represents how many stops into this journey this stop is", "6-1": "boolean", "6-2": "`true` if this is the last stop of this journey. We usually don't show terminating departures in our departure boards", "7-1": "int", "7-2": "The departure time of this bus from this stop in the form of a UNIX timestamp", "8-1": "string", "8-2": "The departure time of this bus from this stop in the form of a ISO 8601 date/time", "9-1": "boolean", "9-2": "`true` if the bus on this journey is being tracked and the departure time is an accurate estimation", "10-1": "boolean", "10-2": "`true` if this portion of the journey is being diverted past this stop.", "11-1": "string", "11-2": "Reserved for future use" }, "cols": 3, "rows": 12 } [/block]