Skip navigation

Trip Planner web service

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

Request parameters:

Name Value Description
fromPlace string (optional) fromPlace=pdx a successful request requires a fromPlace and/or fromCoord. if the request lacks a fromCoord, fromPlace will geocode as the origin of the trip
fromCoord string (optional) fromCoord=-122.72,45.51 if fromPlace exists along with fromCoord, then fromPlace will not engage the geocoder, thus making fromPlace simply a place label
toPlace string (optional) toPlace=zoo a successful request requires a toPlace and/or toCoord. if the request lacks a toCoord, toPlace will first be geocoded as the destination of the trip
toCoord string (optional) toCoord=-122.72,45.51 if toPlace exists along with toCoord, then toPlace will not engage the geocoder, thus making toPlace simply a place label
Date string (optional) Date=9-9-2009 Date of planned trip. If no date is given, then current date (from a server in Portland, OR) is used.
Time string (optional) Time=10:22 am Time of planned trip. If no time is given, then current time (from a server in Portland, OR) is used. NOTE: as of now (June 2009), you will need to provide a valid time parameter/value. In a future release of this service, time will be an optional field.
Min string (optional) Min=T -or- Min=X -or- Min=W Choose itineraries that offer the Quickest Trip (T); Fewest Transfers (X); or Shortest Walk (W) -- T is the default. NOTE: the "Shortest Walk (W)" option may give circuitus routing just to avoid a few steps.
Arr string (optional) Arr=D -or- Arr=A Depart by time / Arrive by time
Walk float (optional) Walk=0.01 -to- Walk=0.999 (in miles)
Mode string (optional) Mode=A -or- Mode=B -or- Mode=T (All Modes / Bus Only / Train Only)
Format string (optional) Format=XML -- The only format currently supported is XML.
MaxIntineraries string (optional) MaxIntineraries=1 -- The number of different itineraries to return. Default is 3 (maximum is 6).
appID string (required) Your appID received during registration.

Example call #1
https://developer.trimet.org/ws/V1/trips/tripplanner/maxIntineraries/6/format/xml/fromplace/pdx/toplace/zoo/date/9-9-2009/time/2:00%20PM/arr/D/min/T/walk/0.50/mode/A/appId/YourAppIdHere
Explicit URL. Note the parameters embedded in the url. Note also that parameter names are case insensitive.

Example call #2
https://developer.trimet.org/ws/V1/trips/tripplanner/fromplace/pdx/toplace/zoo/appId/YourAppIdHere
Minimal URL.

Example call #3
https://developer.trimet.org/ws/V1/trips/tripplanner?fromCoord=-122.5931,45.587579&fromPlace=Wicked%20Cool%20Airport&toPlace=zoo&date=9/9/2009&time=2:00%20PM?appId=YourAppIdHere
Here, we use both a fromCoord and a fromPlace. Note also that HTML GET parameters can also be used.


Response XML:
The tripplanner ws response will conform to these two schemas.
http://maps.trimet.org/maps/model/xml/Itinerary.xsd
http://maps.trimet.org/maps/model/xml/TypeDefs.xsd

note: one place where special care is needed in presenting customer information is for route interlines. When ever you see the 'order="thru-route"' indicator on a trip leg, that will indcate an interline); and the instruction to the customer should be to 'Stay on board' the current vehicle.

For example, (mostly) all MAX Orange Line trips from Milwaukie into Portland switch to MAX Yellow Line trains, so that's a great place to see interline trips:
http://trimet.org/ride/planner.html?from=13718&to=7777
http://ride.trimet.org/?from=13718&to=7777
https://developer.trimet.org/ws/V1/trips/tripplanner/fromPlace/13718/toPlace/7777/time/5:00%20pm/appID/