Skip navigation

Arrivals web service

Base HTTP URL: http://developer.trimet.org/ws/V1/arrivals
Base HTTPS URL: https://developer.trimet.org/ws/V1/arrivals

Request parameters:

Name Value Description
locIDs comma delimited list of location IDs (required) The location IDs to report arrivals. Arrivals are reported for each unique route and direction that services each stop identified by their location ID. Up to 10 location IDs can be reported at once.
appID string (required) Your appID received during registration.
json boolean (optional) "true" or "false" (default) If true results will be returned in json format rather than the default xml format.
callback string (optional) If present returns the json result in a jsonp callback function. Only used if json is set to true.
streetcar boolean (optional) "true" or "false" (default) If true NextBus API results will be included for those location IDs served by Portland Streetcar. The results are transformed into arrival elements. If the NextBus server is not responding or is unreachable scheduled Portland Streetcar scheduled times are provided. arrival[status] will be "estimated" for NextBus predictions. arrival[status] will be "scheduled" otherwise.


Response fields:
The schema for the arrivals service is defined at http://developer.trimet.org/schema/arrivals.xsd
note: all times values are in milliseconds since epoch. JSON times are formatted as a string 'yyyy-MM-ddTHH:mm:ss.SSSZ'.

Name Description
resultSet Root document all results
resultSet[@queryTime] Time the result was generated.
errorMessage This element will occur if there was an error processing your request and contains a description of the problem.
location Contains information about a location, usually a stop. This element can occur in two locations in a resultSet document. One to describe the stop requested, and others to describe the location of any layovers.
location[@desc] The public location description of the stop.
location[@dir] The direction of traffic at the stop.
location[@lat] The latitude of the stop.
location[@lng] The longitude of the stop.
location[@locid] LocationID of the stop.
arrival Contains arrival details.
arrival[@block] The block of the arrival.
arrival[@departed] Indicates if the vehicle has begun the trip which will arrival at the requested stop.
arrival[@detour] Indicates if the arrival may be effected by a detour in effect along the route.
arrival[@dir] The direction of the route for this arrival.
arrival[@estimated] The estimated time for this arrival. If this value is not present the arrival could not be estimated and schedule is shown instead.
arrival[@fullsign] The full text of the overhead sign of the vehicle when it arrives at the stop.
arrival[@locid] The locID of the arrival.
arrival[@piece] The piece of the block for this arrival.
arrival[@route] The route number of the arrival.
arrival[@scheduled] The scheduled stop time (or interpolated scheduled stop time when the stop is not a time point) of the arrival.
arrival[@shortSign] The short version of text from the overhead sign of the vehicle when it arrives at the stop.
arrival[@status] four possible values:
estimated = arrival time was estimated with vehicle position information
scheduled = scheduled arrival time is available only. No real time information available for estimation. Bus's radio may be down or vehicle may not be in service. Arrivals are not estimated when further than an hour away.
delayed = status of service is uncertain.
canceled = scheduled arrival was canceled for the day
blockPosition The last known position of the vehicle along its block. Includes path information from this position to the stop requested.
blockPosition[@at] The time this position was reported.
blockPosition[@feet] Number of feet the vehicle is away from the stop at the time the position was reported.
blockPosition[@heading] The heading of the vehicle at the time of the position was reported.
blockPosition[@lat] The latitude of the vehicle at the time the position was reported.
blockPosition[@lng] The longitude of the vehicle at the time the position was reported.
trip This child of the blockPosition will occur for every trip the vehicle must traverse to arrive at the stop requested.
trip[@desc] The route's direction description of the trip.
trip[@destDist] The number of feet along this trip the vehicle must traverse to arrival at the stop requested. If the vehicle must traverse the entire trip this number will always be the entire length of the trip.
trip[@dir] The direction of the route of this trip.
trip[@pattern] The pattern number for the trip.
trip[@progress] The number of feet the vehicle has traversed along this trip's pattern.
trip[@route] The route number for this trip.
trip[@tripNum] The trip number of this trip. (part of the primary key of the trip table.
layover This child of the blockPosition will occur for every layover the vehicle has between its position and the requested arrival.
layover[@start] The time the layover begins.
layover[@end] The time the layover ends.
routeStatus This element occurs to indicate conditions are influencing the reporting of arrivals being reported for a route. This occurs in inclement weather conditions.
routeStatus[@route] Route number of this routeStatus.
routeStatus[@status] possible values:
estimatedOnly = Arrivals for this route are only being reported if they can be estimated within the next hour. This occurs in inclement weather conditions.
off = No arrivals are being reported for this route. This occurs when conditions such as snow and ice cause vehicles along the route to travel off their trip patterns. In such cases predictions are highly inaccurate or impossible.