• Optimization
  • Navigation
  • Tracking
  • Maps
  • Places

Basic Distance Matrix Fast - POST Request

Implement Using: Distance Matrix Fast API


Let’s see how to build a Distance Matrix POST method request for the same scenario from curbside example

Request

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

Response

1{
2 "status": "Ok",
3 "rows": [
4 {
5 "elements": [
6 {
7 "duration": {
8 "value": 1309
9 },
10 "distance": {
11 "value": 17102
12 }
13 },
14 {
15 "duration": {
16 "value": 1033
17 },
18 "distance": {

Have Questions ?