Click on a nightclub to see the cycling travel time (in minutes) to all other nightclubs on the map.
We just launched the Distance API to calculate travel times between many points with only one API request. It’s an API designed specifically for building a distance table or matrix. It works worldwide and is available for the routing profiles driving
, cycling
and walking
. The API is now available in private beta – read the documentation and drop us a line for access!
Technically, it’s already possible to calculate the travel time between many points with our Directions API, but the new Distance API makes this calculation orders of magnitude more efficient. For example, if you have 100 points, there are actually (100 * 100) - 100 = 9900
routes to be calculated (both directions for every two-point-pair, minus the routes to self). Once we account for compounding network latency for so many HTTP requests, building such a table would take a significant amount of time. This is where the Distance API comes in, making this heavy calculation available in a single HTTP call and returning results in milliseconds.
Visualizing the nearest restaurant
Imagine you want to find a restaurant nearby. Using a traditional radial search does not consider travel times on the roads the user actually takes. So if you are standing on one side of a river, the restaurant right on the other side of the river might be nearest in terms of point-to-point as the crow flies, but if there is not a bridge this does not matter. Use the Distance API to filter and sort the restaurants by actual travel time and deliver more relevant results.
The blue restaurant is closer with point-to-point distance, but further away with actual travel time than the green restaurant.
Dispatch the fastest courier
The Distance API is especially useful for on-demand logistic companies. You can calculate the travel time of all couriers to your customer in a single request, enabling optimal dispatching within seconds.
The blue courier is closer with point-to-point distance, but due to one-way streets needs significantly longer than the green courier to reach the customer.
A traveling salesperson
In logistics one driver often needs to deliver packages to several locations with minimal travel time. Our Distance API delivers the data basis for running algorithms calculating these routes.
As more points are added to the tour, the routes are changing accordingly.
Check the Distance API documentation and drop us a line if you’d like access for testing.