Peter Georgiev
Peter Georgiev

Reputation: 29

Google API for distance doesn't consider traffic when calculate time duration between two points

As it is mentioned on The Google Maps Distance Matrix API - departure time is used to receive trip duration considering current traffic conditions.

I tried to get time between points in different days for example: Fri, 02 Oct 2015 14:10:45 GMT Friday Calculation and in the response duration is 22 min

When I set date with less traffic Sun, 04 Oct 2015 01:10:45 GMT Sunday Calculation the response duration is again 22min.

I think the time durations should be different if in calculations are considered current traffic!

Upvotes: 2

Views: 1663

Answers (1)

stry-kai
stry-kai

Reputation: 493

Just set departure_time=now in your query options. note now shouldn't be specified as a timestamp. You will see a response with duration_in_traffic as a child to the elements tag or keyword

Upvotes: 1

Related Questions