Approach destinations on curbside

Implement Using: Directions Fast API

In this example, we will make a Directions Fast request to get a route where all stops are to be approached from the driving side only. We use the approaches parameter to configure the approach direction for each stop on the route. We prepare the request by adding:

  • origin & destination to to denote the starting and end locations of the trip
  • waypoints with location coordinates of 3 stops
  • mode set to “car” to get a route which a car can take
  • approaches parameter specifying “curbside” approach for all stops including the destination

Request

1curl --location 'https://api.nextbillion.io/directions/json?origin=34.06179645,-118.28182218&destination=34.01815592,-118.24560423&mode=car&key=<your_api_key>&waypoints=34.05004809,-118.25490318|34.03748485,-118.24975388|34.02888816,-118.24129738&approaches=curb;curb;curb;curb' \
2--header 'Content-Type: application/json'

Response

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

Following is a visual representation of the above route on a map

docs-image