Arrive on Curbside

Products Used: Directions API & Navigation API


Users can use the approaches feature in NextBillion.ai’s routing APIs to enforce the approach to always be on the curbside or the driving side. This prevents trucks from being stranded on the opposite lane after reaching an intermediate waypoint or the destination hence saving time and providing better routing experience. Depending on the type of request, the routing engine will either suggest a route which arrives at all the stops from curbside or it provides a route along with turn-by-turn instructions for easy navigation. Use the approaches parameter in the routing APIs to enforce approach preference for your trip.

Let’s take a look at the following sample request with

  • A pair of origin & destination locations

  • mode option set to truck

  • waypoints parameter containing coordinates for 3 stops before the destination

  • approaches parameter containing preference for all stops

Directions API request:

1
curl --location 'https://api.nextbillion.io/directions/json?key=<your_api_key>&origin=25.84220637,-80.36236245&destination=25.76683324,-80.21609475&mode=truck&waypoints=25.91338203,-80.34023395|25.90554444,-80.25598479|25.84769524,-80.22941337&approaches=curb;curb;curb;curb'

Directions API response

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

In order to navigate easily from one stop to another, user can get turn-by-turn restrictions as well through a Navigation API request:

1
curl --location 'https://api.nextbillion.io/navigation/json?key=<your_api_key>&origin=25.84220637,-80.36236245&destination=25.76683324,-80.21609475&mode=truck&waypoints=25.91338203,-80.34023395|25.90554444,-80.25598479|25.84769524,-80.22941337&approaches=curb;curb;curb;curb'
1
{
2
"status": "Ok",
3
"routes": "[...]"
4
}

Visit product documentation (Directions API | Navigation API) to know more about the available features

© 2024 NextBillion.ai all rights reserved.