2

I want to calculated Travel Time between two locations based on start time based on current weather/traffic conditions in my google spreadsheet. The format is something like this:

Start Location End Location Start Time Estimated Travel Time

i am using Mapquest Api

=importXML("http://mapquestapi.com/directions/v1/route?key=APIKEY&outFormat=xml&from=" & A2 & "&to=" & B2,"//response/route/formattedTime")

but it is giving me an incorrect travel time and that travel time isn't live (based on my start time). Is there another way to achieve this?
Edit: Distance Matrix API is something that I have come across, but don't know how to integrate in Google Spreadsheet. Is there a way I can use it there via Google Scripts?

1 Answers1

0

Can you post an example with the locations that is not producing the expected travel time?

There are two types of time returned by the directions request: time and realTime. Time is purely mathematical given the distance, speed limit, and some penalties for maneuvers. The realTime is the time with traffic where available.

MQBrian
  • 452
  • 1
  • 3
  • 7