ETAs for custom truck dimensions

Implement Using: Distance Matrix Flexible API


In this example, we take a 3 x 3 matrix with 3 origins and 3 destinations which would result in a total of 9 combinations (or elements) in the response. We will also customize our request and set:

  • mode to truck
  • truck_size to truck height,width,length in centimeters (cm). This defines the dimensions of a truck.
  • truck_weight set with the total weight of the truck including the weight of trailer and shipped goods in kilograms (kg).
  • departure_time to indicate the time when the trip starts

Request

1
curl --location 'https://api.nextbillion.io/distancematrix/json?key=<your_api_key>&origins=34.189973,-118.934659|34.19099901,-118.92534671|34.20453867,-118.92889235&destinations=34.1792122,-118.9437976|34.17209339,-118.93331971|34.17933722,-118.94442264&mode=truck&truck_size=200,210,600&truck_weight=11770&avoid=toll&option=flexible&departure_time=1715082600'

Response

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

© 2024 NextBillion.ai all rights reserved.