Get Live ETAs

Product Used: Distance Matrix Flexible API


NextBillion.ai’s Distance Matrix API considers the real-time as well as historical traffic patterns to determine accurate ETAs and 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 live ETAs for a fleet of pickup trucks to travel between a given set of locations

  1. A 5 X 5 set of “origins” and “destinations”
  2. “mode” option set to “car” to emulate driving conditions for a pickup trucks
  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|28.52401369,-81.38093861|28.52662774,-81.37160723&destinations=28.52466721,-81.39270426|28.52852882,-81.39628805|28.53262792,-81.39649091|28.53940000,-81.36809106|28.54391447,-81.36984914&mode=car&key=<your_api_key>&option=flexible&route_type=fastest'

Response

1{
2 "status": "Ok",
3 "rows": [
4 {
5 "elements": [
6 {
7 "duration": {
8 "value": 319
9 },
10 "distance": {
11 "value": 2735
12 }
13 },
14 {
15 "duration": {
16 "value": 297
17 },
18 "distance": {

Visit product documentation (Distance Matrix Fast API | Distance Matrix Flexible API) to know more about the available features.


Have Questions ?