• Optimization
  • Navigation
  • Tracking
  • Maps
  • Places

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

1curl --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 {
5 "elements": [
6 {
7 "duration": {
8 "value": 2056
9 },
10 "distance": {
11 "value": 16216
12 }
13 },
14 {
15 "duration": {
16 "value": 2083
17 },
18 "distance": {

Have Questions ?