The Google Maps API naturally has a rich history on ProgrammableWeb. Over the last year or so, Google has released additional maps-related APIs as separate services. One of the latest ones is the Google Distance Matrix API. This allows a developer to submit a matrix of locations, as origins and destinations, and get a list of the distances in return.
The search giant says this about its API in the documentation:
The Google Distance Matrix API is a service that provides travel distance and time for a matrix of origins and destinations. The information returned is based on the recommended route between start and end points, as calculated by the Google Maps API, and consists of rows containing duration and distance values for each pair.
This service does not return detailed route information. Route information can be obtained by passing the desired single origin and destination to the Directions API.
As we always expect of Google, the API returns data in the standard formats, JSON and XML, and is RESTful like most good APIs. This is exactly the API one would use to try to solve the classic “traveling salesman problem” in real life. One could use this in a lot of applications, especially in applications already using the Google Maps API and the Google Directions API in fun ways. Below is an example of the Google Distance Matrix in action.
This API requires no API key, but does have some basic transaction limits. It solves a simple problem that developers may want to solve often, and it does it elegantly. I’d expect nothing less from the King of Search and the creator of the most popular mapping API by far.