Skip navigation

RouteConfig web service

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

Request parameters:

Name Value Description
routes comma delimited list of route numbers (optional) If present results will contain only the routes with numbers that where provided in the list. If omitted every route will be returned.
route alias for routes (optional) Same as routes.
dir indicates route directions (optional) direction elements to include under route number, either 0 (outbound) or 1 (inbound), 'true' or 'yes' for both directions.
stops any non empty string (optional) If this argument is present and has any non-empty value stop elements will be included under each route direction element.
tp any non-empty string (optional) If this argument is present and has any non-empty value stop elements will be included under each route direction element that are also time points along the route. If this argument is used there is no need for the stops argument.
startSeq integer value (optional) Only stops with sequence numbers higher or equal to this argument will be included in stop lists.
endSeq integer value (optional) Only stops with sequence numbers lower or equal to this argument will be included in stop lists.
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.


Response fields:
The schema for the detours service is shared with the detour service. It is defined at http://developer.trimet.org/schema/schedule.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
errorMessage This element will occur if there was an error processing your request and contains a description of the problem.
route Contains information the configuration of a route
route[@desc] The route's description.
route[@detour] optional attribute indicates if this route has a detour in effect.
route[@type] The type of the route, either 'B' for bus, or 'R' for fixed guide way (either rail or aerial tram).
route[@routeColor] Route color designation that matches public facing material.Left empty (xml) or null (json) when unspecified. Provided as a six character Hex string.
route[@routeSortOrder] Orders the routes in a way which is ideal for presentation to customers. Routes with smaller route_sort_order values should be displayed first.
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.
stop This child element of dir occurs for stops in the direction requested.
stop[@desc] The description of the stop.
stop[@lat] The stop's latitude.
stop[@lng] The stop's longitude.
stop[@locid] The stop's locationID.
stop[@dir] The direction of traffic at the stop. The cardinal directions of a compass. For bidirectional rail platforms the value will be blank.
stop[@seq] The stop's sequence number for the route's direction.
stop[@tp] boolean value indicating if the stop is considered a time point for the route's direction.


Examples:

To get a list of all routes:
https://developer.trimet.org/ws/V1/routeConfig/appid/0000000000000000000000000

To get a list of every stop in each direction of route number 70:
https://developer.trimet.org/ws/V1/routeConfig/route/70/dir/true/stops/true/appid/0000000000000000000000000

To get a list of every stop considered a time point in direction 1 of route number 70:
https://developer.trimet.org/ws/V1/routeConfig/route/70/dir/1/tp/true/appid/0000000000000000000000000