Skip navigation

Vehicle location service


Request parameters:

Name Value Description
routes comma delimited list of route numbers (optional) If included, only vehicles traveling on these routes will be included.
blocks comma delimited list of block numbers (optional) If included, only vehicles serving these blocks included.
ids comma delimited list of vehicle numbers (optional) If included, only vehicles with these numbers will be included.
appID string (required) Your appID received during registration.
since time in milliseconds since epoch (optional) If included, only vehicle locations refreshed after the epoch time be returned. Defaults to midnight of service day.
xml boolean (optional) "true" or "false" (default is false) If true results will be returned in xml format rather than the default json.
callback string (optional) If present returns the json result in a jsonp callback function.
bbox comma delimited list of longitude and latitude values (optional) bbox arguments are lonmin, latmin, lonmax, latmax in decimal degrees. These define the lower left and upper right corners of the bounding box. Only vehicles inside the bounding box will be selected.
showNonRevenue boolean (optional) "true" or "false" (default is false) If true results include vehicles on dead head routes.
onRouteOnly boolean (optional) "true" or "false" (default is true) If true (the default) results will include only vehicles that are servicing a route.
showStale boolean (optional) "true" or "false" (default is false) If true results will include entries that have expired. The query time is greater than vehicle[@expires].

Response fields:
note: all times values are in milliseconds since epoch.

Name Description
resultSet[@queryTime] Time the result was generated. This is a suitable value to use for subsequent requests with the since value.
error This element will occur if there was an error processing your request. Contains a description of the problem.
error[@content] Contains a description of the error encountered.
vehicle Contains all vehicle attributes.
vehicle[@vehicleID] Identifies the vehicle.
vehicle[@type] Identifies the type of vehile. Can be "bus" or "rail".
vehicle[@blockID] Identifies the block number of the vehicle.
vehicle[@bearing] Bearing of the vehicle if available. 0 is north, 180 is south.
vehicle[@serviceDate] Midnight of the service day the vehicle is performing service for.
vehicle[@locationInScheduleDay] Number of seconds since midnight from the scheduleDate that the vehicle is positioned at along its schedule.
vehicle[@time] Time this position was initially recorded.
vehicle[@expires] Time this vehicle's entry should be discarded if no new position information is received from the vehicle.
vehicle[@longitude] Longitude of the vehicle.
vehicle[@latitude] Latitude of the vehicle.
vehicle[@routeNumber] Route number the vehicle is servicing.
vehicle[@direction] Direction of the route the vehicle is servicing.
vehicle[@tripID] TripID the vehicle is servicing.
vehicle[@newTrip] Will be true when the trip the vehicle is serving is new and was not part of the published schedule. When true the value vehicle[@tripID] will not be found in GTFS.
vehicle[@delay] Delay of the vehicle along its schedule. Negative is late. Positive is early.
vehicle[@messageCode] Identifier for the over head sign message. This is used internally at TriMet and can be ignored.
vehicle[@signMessage] Vehicle's over head sign text message.
vehicle[@signMessageLong] Vehicle's full over head sign text message.
vehicle[@nextLocID] Location ID (or stopID) of the next stop this vehicle is scheduled to serve.
vehicle[@nextStopSeq] Stop sequence for the next stop this vehicle is scheduled to serve. Some trips serve the same stop twice.
vehicle[@lastLocID] Location ID (or stopID) of the previous stop this vehicle was scheduled to serve.
vehicle[@lastStopSeq] Stop sequence for the next stop this vehicle is scheduled to serve. Some trips serve the same stop twice.
vehicle[@garage] Identifies the garage the vehicle originates from.
vehicle[@extrablockID] Integer value identifies a new unscheduled block the vehicle is servicing. This will not be in the published GTFS schedule.
vehicle[@offRoute] Placeholder for future. Set to true if the vehicle reported that it has gone off route.
vehicle[@inCongestion] (Experimental) Set to true if vehicle is reporting its not moving while in traffic. Bus only.
vehicle[@loadPercentage] (Experimental) Vehicles (bus only) can report when load thresholds have been crossed. Currently there are three possible thresholds, 0%, 70% and 90%. These thresholds may change so values 0 to 100 may be possible.