Time Difference when hitting route api in azure maps

Nilesh Khonde 60 Reputation points
2024-10-08T13:01:54.5066667+00:00

Hi Guys,

I am using the Route API to get the time between two coordinates in Azure Maps.

The following is the API I am using:

https://atlas.microsoft.com/route/directions/json?api-version=1.0&query=47.45567,-122.28245:47.60323,-122.33028&travelMode=car&traffic=true&computeTravelTimeFor=all&routeType=shortest&maxAlternatives=0&subscription-key=


The following API gives me results that return time in seconds. For example, 1584 seconds is equivalent to 26.4 minutes. However, using the same coordinates in Google Maps results in 18 minutes

please find below screenshot.

image_2024_10_08T12_49_12_365Z

so is there is any way which can help me to optimize the time given by the route by api.

any help will be deeply appreciated.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
723 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 18,266 Reputation points Microsoft Employee
    2024-10-08T15:46:44.85+00:00

    In your request you are asking for the shortest route but most map platforms default to the fastest (fairly certain that's what Google Maps is set to on its webpage). Try setting routeType to fastest

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.