Get Accurate ETAs

Product Used: Distance Matrix API

NextBillion.ai’s Distance Matrix API considers the real-time as well as historical traffic patterns to determine accurate ETAs using the most efficient routes. The Distance Matrix can cater to one to many and many to many scenarios as per given set of origin and destination locations. Users can also customize the request using a variety of other configurations that come along with the service.

Following is a request to get ETAs for multiple available agents to reach the next set of tasks to service

  1. A 3 X 3 set of “origins” and “destinations”
  2. “mode” option set to “car”
  3. “route_type” option set to “fastest”

Request

1curl --location 'https://api.nextbillion.io/distancematrix/json?origins=28.54557765,-81.38898523|28.54397387,-81.38506335|28.53904358,-81.38546906&destinations=28.52466721,-81.39270426|28.52852882,-81.39628805|28.53262792,-81.39649091&mode=car&key=<your_api_key>&option=flexible&route_type=fastest'

Response

1{
2 "status": "Ok",
3 "rows": "[...]"
4}

Visit product documentation of Distance Matrix API to know more about the available features.