Basic Distance Matrix Flexible - POST Request

Implement Using: Distance Matrix Flexible API


Let’s see how to build a Distance Matrix Flexible POST method request for the same scenario from the trips in future example

Request

1
curl --location --request POST 'https://api.nextbillion.io/distancematrix/json?key=<your_api_key>&option=flexible' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"origins":"34.05456317,-118.31528428|33.99167000,-118.25687955|34.00792776,-118.33063151|33.94535370,-118.33148414",
5
"destinations":"33.96763110,-118.23215346|33.93969502,-118.26583210|33.90184293,-118.1963432",
6
"mode":"truck",
7
"departure_time":1685371968
8
}'

Response

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

© 2024 NextBillion.ai all rights reserved.