ETAs for cross-border trips

Implement Using: Distance Matrix Flexible API


In this example, let’s request for distance and duration values for a route that a truck can take when allowed to cross country borders. We will create a Distance Matrix Flexible request with 2 origins (O) and 2 destinations (D). We set option as flexible along with:

  • mode set to “truck” to get distance and duration values for a route that a truck can take
  • cross_border option set to “true”

Request

1
curl --location 'https://api.nextbillion.io/distancematrix/json?origins=48.96845365,-110.21708796|48.96266414,-109.73794494&destinations=48.95108310,-110.22002749|48.95494374,-109.72324730&mode=truck&key=<your_api_key>&option=flexible&cross_border=true'

Response

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

© 2024 NextBillion.ai all rights reserved.