Basic Distance Matrix Fast Request

Implement Using: Distance Matrix Fast API


Let’s create a simple Distance Matrix Fast request with 3 origins (O) and 3 destinations (D). We will get a 3 x 3 matrix with distance and duration values for all 9 combinations (or elements) of O x D pairs. We also set `mode=car’ to get distance and duration values for a route that a car can take

Request

1
curl --location 'https://api.nextbillion.io/distancematrix/json?origins=34.05456317,-118.31528428|33.99167000,-118.25687955|34.00792776,-118.33063151&destinations=33.96763110,-118.23215346|33.93969502,-118.26583210|33.90184293,-118.19634326&mode=car&key=<your_api_key>'

Response

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

© 2024 NextBillion.ai all rights reserved.