NoCarrier
NoCarrier

Reputation: 2598

Extracting trip ETA from Google Maps API possible?

Is it possible to get the trip ETA (in number of minutes) and traffic data from the google maps API between two address points? Does anyone know if the ETA value reflects traffic conditions?

Upvotes: 13

Views: 21087

Answers (5)

Devmaleeq
Devmaleeq

Reputation: 586

Use Routes API. It's more verbose

Upvotes: 0

Vishnu
Vishnu

Reputation: 21

Google's Distance Matrix API gives the json/xml response as per Origin and Destination address/location/latitude,longitude.

Here's an example In order to change parameters, refer this Also, you need to create an Google developer account for APIKEY.

https://maps.googleapis.com/maps/api/distancematrix/json?origins=13.026790,77.635752&destinations=13.025949,77.639689&key=GOOGLE_API_KEY

Upvotes: 1

Sam
Sam

Reputation: 43

It's possible to get travel time between two points using Google Maps Directions API. Google provides a nice documentation for this.

https://developers.google.com/maps/documentation/directions/intro

Although the free version doesn't consider the traffic conditions. In order to get the real time traffic conditions using APIs you need to purchase 'Google Maps for Work' licence.

https://www.google.com/work/mapsearth/

Upvotes: 2

David Hull
David Hull

Reputation: 1285

Google has a Distance Matrix API that returns the distance and travel times between two (or more) points, which can be specified as either lat+lng or addresses.

I do not believe that it takes traffic data into account.

Upvotes: 13

RedBlueThing
RedBlueThing

Reputation: 42532

The API you are after is getDuration of the GDirections object. This will give you the number of seconds for all routes in a GDirections request. I am not sure if Google applies traffic data (if it is available). Someone else might have the answer to that?

You can get a traffic data overflow on your Google map using a GTrafficOverlay, but I am not sure about getting the underlying data. I would start looking in the Google Maps Data API.

Upvotes: 11

Related Questions