Skip navigation

Beta: Stop Location v2 web service

Base HTTP URL: http://developer.trimet.org/ws/v2/stops
Base HTTPS URL: https://developer.trimet.org/ws/v2/stops

Service retrieves stops within range of a coordinate, or within a bounding box of coordinates. Optionally can return arrivals for up to 128 stops inside that range.

Request parameters:

Name Value Description
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.
ll comma delimited long-lat pair (optional) Defines center of search radius in decimal degrees.
feet number (optional) Use with ll to define search radius in feet.
meters number (optional) Use with ll to define search radius in meters.
maxStops number (optional), minimum value is 1 Limits the number of stops returned. Stops closest to the center of the bbox or coordinates will be included first.
includeArrivals boolean (optional) "true" or "false" (default) When true arrivals for the first 128 stops found will be reported. If more than 128 stops are found the first 128 closest to the center of the bbox or coordinates will be included first.
Arrivals elements will be added to the ResultsSet the same as when calling the Arrivals V2 service. All parameters from the arrivals service except for locids will be honored.
embedArrivals boolean (optional) "true" or "false" (default) When true and includeArrivals is true instead of arrival elements being at the root of the result set, arrivals will be placed under the location element they are reported for.
maxStopArrivals number (optional), minimum value is 1 Limits the number of stops reporting arrivals returned when includeArrivals is true. Stops closest to the center of the bbox or coordinates will report arrivals first.
showRoutes boolean (optional) location elements will include a list of routes that service the stop(s) if this is set to 'true'.
showRouteDirs boolean (optional) route elements will include a list of 'dir' elements for each route direction that service the stop(s) if this is set to 'true'. Setting showRoutes is to 'true' is unnecessary if this is set to 'true'.
appID string (required) Your appID received during registration.
json boolean (optional) "true" (default) or "false" 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.


Response fields:
Note: all times values are in Unix time format, milliseconds since epoch.

Name Description
resultSet Root element of 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 stop
location[@desc] The public location description of the stop.
location[@dir] The direction of traffic at the stop. The cardinal directions of a compass. For bidirectional rail platforms the value will be blank.
location[@lat] The latitude of the stop.
location[@lng] The longitude of the stop.
location[@locid] LocationID of the stop.
location[@passengerCode] Passenger access code for the stop.
'E' = Either boarding or alighting
'A' = Alighting only
'B' = Boarding only
'N' = Neither boarding nor alighting
route Contains information about a route.
route[@desc] The route's description.
route[@route] The route number.
route[@type] The type of the route, either 'B' for bus, or 'R' for fixed guideway (either rail or aerial tram).
dir Child element of route contains information for each route directions.
dir[@desc] Describes the direction of the route.
dir[@dir] The number of the direction, either 1 for inbound or 0 for outbound.
detour When includeArrivals is true and arrivals are being reported detours/alerts in effect will be in the detour elements. These are documented in the Arrivals V2 service.
arrival When includeArrivals is true and arrivals are being reported arrival elements are included. These are documented in the Arrivals V2 service.