Search code examples
restrouteshere-apihere-maps-rest

Why am i receiving different results from the HERE Routing API and the HERE Maps Website?


We are using the Routing API V8. When I call the API. I am getting a return result of 2021-03-03T18:09:52+10:00 But from the maps website. I am getting a result of https://wego.here.com/directions/mix/6-Kyabra-St,-Newstead-QLD-4006,-Australia:-27.45264,153.04265/35-Hercules-St,-Hamilton-QLD-4007,-Australia:-27.43945,153.06973?map=-27.44536,153.05502,15,normal It says a 12 minute travel time.

Here is my API Call: https://router.hereapi.com/v8/routes?transportMode=car&origin=-27.452630,153.042350&destination=-27.439750,153.069630&departureTime=2021-03-03T08:00:00Z&apiKey=

Here is the full response from the API: {"routes":[{"id":"3ff8ffc9-1f66-4b47-9ec0-a59cf2268348","sections":[{"id":"e4154bf2-2052-4846-b46c-5cfe4b4cfc01","type":"vehicle","departure":{"time":"2021-03-03T18:00:00+10:00","place":{"type":"place","location":{"lat":-27.4526753,"lng":153.0426484},"originalLocation":{"lat":-27.45263,"lng":153.0423499}}},"arrival":{"time":"2021-03-03T18:09:52+10:00","place":{"type":"place","location":{"lat":-27.4396845,"lng":153.0693942},"originalLocation":{"lat":-27.4397501,"lng":153.06963}}},"transport":{"mode":"car"}}]}]}


Solution

  • Based on HERE routing API v8 documentation, when I removed Z from end of departureTime parameter in order to assume time is local to the origin, the time is shown correctly:

    ....
    departure": {
    "time": "2021-03-03T08:00:00+10:00",
    ....
    arrival": {
    "time": "2021-03-03T08:10:20+10:00",
    ...