Begin or end route at different times

In your request for a route, you can use the departureTime or arrivalTime parameter to specify a time at which the route begins or ends respectively.

If the route request specifies neither the departureTime nor the arrivalTime parameter, then by default departure time (departureTime) for a route is the time of the route request. departureTime=any is often referred to as "planning mode", and can be useful when the departure or arrival time of the route are not known in advance. Note that sending the same request with the parameter departureTime=any at different times may result in different responses.

You can use either departureTime or arrivalTime in a route request, but not both.

Note

The Routing API specifies time in the date-time or full-date T partial-time format according to RFC 3339.

The following sample specifies the departureTime of 2021-09-03T08:30:25+02:00.

curl -X GET \
  'https://router.hereapi.com/v8/routes?transportMode=car&origin=52.5308,13.3847&destination=52.5323,13.3789&return=summary&departureTime=2021-09-03T08:30:25+02:00&apikey={YOUR_API_KEY}'
{
  "routes" : [
    {
      "id":"f7d8121b-0577-47ca-b234-937b4bfd5d8d",
      "sections":[
        {
          "id":"feba5001-3e85-40a0-9045-e4c4637f36ab",
          "type":"vehicle",
          "departure":{
            "time":"2021-09-03T08:30:25+02:00",
            "place":{
              "type":"place",
              "location":{
                "lat":52.5309838,
                "lng":13.3845671
              },
              "originalLocation":{
                "lat":52.5307999,
                "lng":13.3847
              }
            }
          },
          "arrival":{
            "time":"2021-09-03T08:32:33+02:00",
            "place":{
              "type":"place",
              "location":{
                "lat":52.5323264,
                "lng":13.378874
              },
              "originalLocation":{
                "lat":52.5323,
                "lng":13.3789
              }
            }
          },
          "summary":{
            "duration":128,
            "length":539,
            "baseDuration":73
          },
          "transport":{
            "mode":"car"
          }
        }
      ]
    }
  ]
}

results matching ""

    No results matching ""