ApiItinerary Data Type

An Itinerary is one complete way of getting from the start location to the end location.

Properties
name data type constraints description
duration number   Duration of the trip on this itinerary, in seconds.
startTime number   Time that the trip departs.
endTime number   Time that the trip arrives.
walkTime number required How much time is spent walking, in seconds.
transitTime number required How much time is spent on transit, in seconds.
waitingTime number required How much time is spent waiting for transit to arrive, in seconds.
walkDistance number   How far the user has to walk, in meters.
walkLimitExceeded boolean required Indicates that the walk limit distance has been exceeded for this itinerary when true.
generalizedCost number required If a generalized cost is used in the routing algorithm, this should be the total cost computed by the algorithm. This is relevant for anyone who want to debug an search and tuning the system. The unit should be equivalent to the cost of "one second of transit".

-1 indicate that the cost is not set/computed.

elevationLost number   How much elevation is lost, in total, over the course of the trip, in meters. As an example, a trip that went from the top of Mount Everest straight down to sea level, then back up K2, then back down again would have an elevationLost of Everest + K2.
elevationGained number   How much elevation is gained, in total, over the course of the trip, in meters. See elevationLost.
transfers number   The number of transfers this trip has.
fare Fare   The cost of this trip
legs array of ApiLeg   A list of Legs. Each Leg is either a walking (cycling, car) portion of the trip, or a transit trip on a particular vehicle. So a trip where the use walks to the Q train, transfers to the 6, then walks to their destination, has four legs.
systemNotices array of ApiSystemNotice   A itinerary can be tagged with a system notice. System notices should only be added to a response if explicit asked for in the request.

For example when tuning or manually testing the itinerary-filter-chain it you can enable the org.opentripplanner.routing.core.RoutingRequest#debugItineraryFilter and instead of removing itineraries from the result the itineraries would be tagged by the filters instead. This enable investigating, why an expected itinerary is missing from the result set.

tooSloped boolean required This itinerary has a greater slope than the user requested (but there are no possible itineraries with a good slope).
arrivedAtDestinationWithRentedBicycle boolean required If allowKeepingRentedVehicleAtDestination is set than it is possible to end a trip without dropping off the rented bicycle.

Example

{
  "duration" : 12345,
  "startTime" : 12345,
  "endTime" : 12345,
  "walkTime" : 12345,
  "transitTime" : 12345,
  "waitingTime" : 12345,
  "walkDistance" : 12345.0,
  "walkLimitExceeded" : true,
  "generalizedCost" : 12345,
  "elevationLost" : 12345.0,
  "elevationGained" : 12345.0,
  "transfers" : 12345,
  "fare" : {
    "fare" : {
      "property1" : {
        "currency" : { },
        "cents" : 12345
      },
      "property2" : {
        "currency" : { },
        "cents" : 12345
      }
    },
    "details" : {
      "property1" : [ {
        "fareId" : { },
        "price" : { },
        "routes" : [ { }, { } ]
      }, {
        "fareId" : { },
        "price" : { },
        "routes" : [ { }, { } ]
      } ],
      "property2" : [ {
        "fareId" : { },
        "price" : { },
        "routes" : [ { }, { } ]
      }, {
        "fareId" : { },
        "price" : { },
        "routes" : [ { }, { } ]
      } ]
    }
  },
  "legs" : [ {
    "startTime" : 12345,
    "endTime" : 12345,
    "departureDelay" : 12345,
    "arrivalDelay" : 12345,
    "realTime" : true,
    "isNonExactFrequency" : true,
    "headway" : 12345,
    "distance" : 12345.0,
    "generalizedCost" : 12345,
    "pathway" : true,
    "mode" : "...",
    "transitLeg" : true,
    "route" : "...",
    "agencyName" : "...",
    "agencyUrl" : "...",
    "agencyBrandingUrl" : "...",
    "agencyTimeZoneOffset" : 12345,
    "routeColor" : "...",
    "routeType" : 12345,
    "routeId" : "...",
    "routeTextColor" : "...",
    "interlineWithPreviousLeg" : true,
    "tripShortName" : "...",
    "tripBlockId" : "...",
    "headsign" : "...",
    "agencyId" : "...",
    "tripId" : "...",
    "serviceDate" : "...",
    "routeBrandingUrl" : "...",
    "from" : {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "BIKESHARE",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    },
    "to" : {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "BIKEPARK",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    },
    "intermediateStops" : [ {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "BIKEPARK",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    }, {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "BIKEPARK",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    } ],
    "legGeometry" : {
      "points" : "...",
      "levels" : "...",
      "length" : 12345
    },
    "steps" : [ {
      "distance" : 12345.0,
      "relativeDirection" : "CONTINUE",
      "streetName" : "...",
      "absoluteDirection" : "EAST",
      "exit" : "...",
      "stayOn" : true,
      "area" : true,
      "bogusName" : true,
      "lon" : 12345.0,
      "lat" : 12345.0,
      "elevation" : "...",
      "walkingBike" : true,
      "alerts" : [ { }, { } ]
    }, {
      "distance" : 12345.0,
      "relativeDirection" : "CIRCLE_COUNTERCLOCKWISE",
      "streetName" : "...",
      "absoluteDirection" : "SOUTHWEST",
      "exit" : "...",
      "stayOn" : true,
      "area" : true,
      "bogusName" : true,
      "lon" : 12345.0,
      "lat" : 12345.0,
      "elevation" : "...",
      "walkingBike" : true,
      "alerts" : [ { }, { } ]
    } ],
    "alerts" : [ {
      "alertHeaderText" : "...",
      "alertDescriptionText" : "...",
      "alertUrl" : "...",
      "effectiveStartDate" : 12345,
      "effectiveEndDate" : 12345
    }, {
      "alertHeaderText" : "...",
      "alertDescriptionText" : "...",
      "alertUrl" : "...",
      "effectiveStartDate" : 12345,
      "effectiveEndDate" : 12345
    } ],
    "routeShortName" : "...",
    "routeLongName" : "...",
    "boardRule" : "...",
    "alightRule" : "...",
    "pickupBookingInfo" : {
      "contactInfo" : { },
      "bookingMethods" : [ "...", "..." ],
      "earliestBookingTime" : { },
      "latestBookingTime" : { },
      "minimumBookingNoticeSeconds" : 12345,
      "maximumBookingNoticeSeconds" : 12345,
      "message" : "...",
      "pickupMessage" : "...",
      "dropOffMessage" : "..."
    },
    "dropOffBookingInfo" : {
      "contactInfo" : { },
      "bookingMethods" : [ "...", "..." ],
      "earliestBookingTime" : { },
      "latestBookingTime" : { },
      "minimumBookingNoticeSeconds" : 12345,
      "maximumBookingNoticeSeconds" : 12345,
      "message" : "...",
      "pickupMessage" : "...",
      "dropOffMessage" : "..."
    },
    "rentedBike" : true,
    "duration" : 12345.0
  }, {
    "startTime" : 12345,
    "endTime" : 12345,
    "departureDelay" : 12345,
    "arrivalDelay" : 12345,
    "realTime" : true,
    "isNonExactFrequency" : true,
    "headway" : 12345,
    "distance" : 12345.0,
    "generalizedCost" : 12345,
    "pathway" : true,
    "mode" : "...",
    "transitLeg" : true,
    "route" : "...",
    "agencyName" : "...",
    "agencyUrl" : "...",
    "agencyBrandingUrl" : "...",
    "agencyTimeZoneOffset" : 12345,
    "routeColor" : "...",
    "routeType" : 12345,
    "routeId" : "...",
    "routeTextColor" : "...",
    "interlineWithPreviousLeg" : true,
    "tripShortName" : "...",
    "tripBlockId" : "...",
    "headsign" : "...",
    "agencyId" : "...",
    "tripId" : "...",
    "serviceDate" : "...",
    "routeBrandingUrl" : "...",
    "from" : {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "NORMAL",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    },
    "to" : {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "NORMAL",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    },
    "intermediateStops" : [ {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "TRANSIT",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    }, {
      "name" : "...",
      "stopId" : "...",
      "stopCode" : "...",
      "platformCode" : "...",
      "lon" : 12345.0,
      "lat" : 12345.0,
      "arrival" : 12345,
      "departure" : 12345,
      "zoneId" : "...",
      "stopIndex" : 12345,
      "stopSequence" : 12345,
      "vertexType" : "BIKESHARE",
      "bikeShareId" : "...",
      "vehicleParking" : { }
    } ],
    "legGeometry" : {
      "points" : "...",
      "levels" : "...",
      "length" : 12345
    },
    "steps" : [ {
      "distance" : 12345.0,
      "relativeDirection" : "HARD_LEFT",
      "streetName" : "...",
      "absoluteDirection" : "SOUTHEAST",
      "exit" : "...",
      "stayOn" : true,
      "area" : true,
      "bogusName" : true,
      "lon" : 12345.0,
      "lat" : 12345.0,
      "elevation" : "...",
      "walkingBike" : true,
      "alerts" : [ { }, { } ]
    }, {
      "distance" : 12345.0,
      "relativeDirection" : "CIRCLE_COUNTERCLOCKWISE",
      "streetName" : "...",
      "absoluteDirection" : "NORTHWEST",
      "exit" : "...",
      "stayOn" : true,
      "area" : true,
      "bogusName" : true,
      "lon" : 12345.0,
      "lat" : 12345.0,
      "elevation" : "...",
      "walkingBike" : true,
      "alerts" : [ { }, { } ]
    } ],
    "alerts" : [ {
      "alertHeaderText" : "...",
      "alertDescriptionText" : "...",
      "alertUrl" : "...",
      "effectiveStartDate" : 12345,
      "effectiveEndDate" : 12345
    }, {
      "alertHeaderText" : "...",
      "alertDescriptionText" : "...",
      "alertUrl" : "...",
      "effectiveStartDate" : 12345,
      "effectiveEndDate" : 12345
    } ],
    "routeShortName" : "...",
    "routeLongName" : "...",
    "boardRule" : "...",
    "alightRule" : "...",
    "pickupBookingInfo" : {
      "contactInfo" : { },
      "bookingMethods" : [ "...", "..." ],
      "earliestBookingTime" : { },
      "latestBookingTime" : { },
      "minimumBookingNoticeSeconds" : 12345,
      "maximumBookingNoticeSeconds" : 12345,
      "message" : "...",
      "pickupMessage" : "...",
      "dropOffMessage" : "..."
    },
    "dropOffBookingInfo" : {
      "contactInfo" : { },
      "bookingMethods" : [ "...", "..." ],
      "earliestBookingTime" : { },
      "latestBookingTime" : { },
      "minimumBookingNoticeSeconds" : 12345,
      "maximumBookingNoticeSeconds" : 12345,
      "message" : "...",
      "pickupMessage" : "...",
      "dropOffMessage" : "..."
    },
    "rentedBike" : true,
    "duration" : 12345.0
  } ],
  "systemNotices" : [ {
    "tag" : "...",
    "text" : "..."
  }, {
    "tag" : "...",
    "text" : "..."
  } ],
  "tooSloped" : true,
  "arrivedAtDestinationWithRentedBicycle" : true
}