Next bus and train times
The call for next bus and train times returns the predicted next bus and train times for a list of stops.
Each next bus and train time record includes the time prediction, block ID, trip ID, destination, route and, where available, heading and vehicle location.
Call format
Part | Description | Optional | Example |
URL | TransiCast web server instance URL | http://transicast.appspot.com/ws/V3 | |
Servlet descriptor | arrivals | arrivals | |
Parameter: agency=<agency ID> | Agency ID, as provided by the agencies call | agency=Los Angeles Metro | |
Parameter: locIDs=<stop id, ... > | Comma separated list of stop IDs, as provided by the stops call | locIDs=11918,3429 | |
Parameter: routes=<route id, ... > | Comma separated list of Route IDs, as provided by the route list call | routes=45,45,83,83,834 | |
Parameter: dbgETA=<timezone> | Timezone in Java TimeZone format | dbgETA=America/Los_Angeles |
http://transicast.appspot.com/ws/V3/arrivals?locIDs=11918,3429&routes=45,45,83,83,834&agency=Los%20Angeles%20Metro&appid=<api_key>
Response format
The call for next bus and train times first returns the list of stops through the <location> tag.
Following the locations, the individual predicted vehicles are returned through the <arrival> tag. It contains the following attributes and tags:
Attribute | Description | Key | Used in | Example |
block | Service block | block="1244" | ||
trip | Service trip | trip="52229" | ||
status | Estimation status. Use estimated tag if the value of status is estimated. Use scheduled tag if the value of status is scheduled | status="estimated" | ||
estimated | Estimated time of departure | estimated="1319425765837" | ||
scheduled | Scheduled time of departure | scheduled="1319426000000" | ||
dbgETA | If dbgETA set in request: Time of departure in clear text | dbgETA="Sat, Aug 10, 2013 10:55:05 AM PDT" | ||
route | Route ID, as provided by the route list call | Route list, as key value | route="45" | |
dest | Trip destination | dest="North to Lincoln Heights" | ||
locid | Stop ID that identifies the predicted stop, as provided by the stops call | Stops, as key value | locid="11918" | |
detour | Flag. true if the predicted vehicle is operating on a detoured route | detour="" | ||
blockPosition | Tag: Block position, see below |
Where vehicle locations are available, the <arrival> tag contains a <blockPosition> tag with the following attributes:
Attribute | Description | Key | Used in | Example |
heading | Vehicle heading in degrees off North | heading="121.5" | ||
lat | Vehicle latitude | lat="33.943523" | ||
lng | Vehicle longitude | lng="-118.27845" |
<?xml version="1.0" encoding="UTF-8"?> <resultSet queryTime="1319425536165" ct="3"> <location locid="11918"/> <location locid="3429"/> <arrival block="7409626" estimated="1319425765837" route="45" dest="North to Lincoln Heights" status="estimated" locid="3429" detour=""> <blockPosition heading="30.8" lat="34.04995" lng="-118.249184"> </blockPosition> </arrival> <arrival block="7406874" estimated="1319425899200" route="83" dest="North to York-Eagle Rock" status="estimated" locid="3429" detour=""> <blockPosition heading="30.2" lat="34.044395" lng="-118.255867"> </blockPosition> </arrival> <arrival block="7406884" estimated="1319426942011" route="84" dest="South to The Shops At Montebello Via Downtown LA" status="estimated" locid="11918" detour=""> </arrival> </resultSet>
Notes
- The time window of schedule based next bus times is between -2 and +4 hours. Ferry and train services reach out -2 to +12 hours. If no departures are scheduled within 2 and 12 hours respectively, the first departure of the next operational day is returned
- Although some original feeds do not require routes as a request parameter for next bus and train times, others do. In the aggregate, TransiCast requires the routes parameter for all calls. As original feeds may not need this parameter, and return next buses or trains times of all routes, TransiCast directly returns the content of the original feed, including next buses and trains of routes that may not have been requested in the call
- A combination of the next bus or train time provided through the estimated element while status="estimated" means that the departure time is based on real time vehicle data as provided by a real-time data feed
- A combination of the next bus or train time provided through the scheduled element while status="scheduled" means that the departure time is based on the block's schedule
- A combination of the next bus or train time provided through the scheduled element while status="estimated" means that the departure time is based on the scheduled departure time as provided by the agency's real-time data feed
Contact
By email  
© 2011 - 2023 TransiCast |