Developers can foresee the future with Google Maps API

(Image Credit: iStockPhoto/pidjoe)

Developers who require the use of future travel information in their apps can put away their crystal ball as Google has opened-up access to Maps' trusted predictive journey times with the debut of a new API. 

Google Maps uses historical traffic data over time and days to predict where and when a build-up could occur, which may affect your journey time, and offer an alternative route where available. Many developers benefit from the use of Google Maps in their apps; with some already using live traffic data from its APIs.

Developers can decide between optimistic, pessimistic, or best guess estimates

From today, all developers can now use both live and predicted traffic information from Google Maps to plan journeys from now, in hours, days, or even weeks in advance. Traffic features available in the Directions and Distance Matrix APIs will be available under the Standard Plan which allows for 2500 requests/day free. 

The number of waypoints allowed has also been increased from 8 to 23, although traffic features and higher waypoint limits in the JavaScript Maps API remain limited to Google Maps for Work customers for now. In order to get started with the new traffic features, all you need to do is add the departure_time parameter to Directions API or Distance Matrix API queries, and the results will contain the estimated journey time based on the predicted traffic conditions. 

For more granular control over the future predictions, developers can decide between optimistic, pessimistic, or best guess estimates of the journey time by setting an optional parameter. One initial customer using the Maps API, Redfin, has decided to use the "pessimistic" traffic model when predicting how long it will take when driving between homes to ensure plenty of time. For a developer creating an app for a smart thermostat, an "optimistic" model would be preferable to ensure the house is warm before the user should be home. 

To get more information about the traffic features in the Google Maps APIs, check out the documentation for the Directions API, the Distance Matrix API and the JavaScript Maps API Directions and Distance Matrix services, or download the updated client libraries for Java or Python. 

Have you tried Google Maps' API for traffic predictions? Share your experience in the comments below.

Related Stories

Leave a comment


This will only be used to quickly provide signup information and will not allow us to post to your account or appear on your timeline.