Calculate Matrix
GET
https://api.woosmap.com/distance/distancematrix/json
Get distances and durations for a matrix of origins and destinations, based on the recommended route between start and end points for a specified travel mode.
Rate limit: 10 requests/1s GET and POST
Elements limit: 1000 elements/1s GET and POST
Rate limit with TRAFFIC: 10 requests/1s GET and POST
Elements limit with TRAFFIC: 1000 elements/1sGET and POST
Authorization
Query Parameters
mode
string Defaults to
driving method
string Defaults to
time units
string Defaults to
metric language
string Defaults to
en avoid
object
origins
string required
destinations
string required
arrival_time
object
departure_time
object
elements
string Defaults to
distance Header Parameters
accept-language
object
Response
Successful Response
Errors
401
Unable to locate credentials.
application/json
detail
string required
402
Out of free quota.
application/json
detail
string required
403
Credentials found, but not matching.
application/json
detail
string required
422
Validation Error
429
Rate limit reached
application/json
details
string required
curl -L 'https://api.woosmap.com/distance/distancematrix/json?origins=48.709%2C2.403&destinations=48.709%2C2.303%7C48.768%2C2.338&mode=driving&language=en&elements=duration_distance&method=distance&key=YOUR_PUBLIC_API_KEY' \
-H 'Referer: http://localhost'
const requestOptions = {
method: "GET",
redirect: "follow"
};
fetch("https://api.woosmap.com/distance/distancematrix/json?origins=48.709%2C2.403&destinations=48.709%2C2.303%7C48.768%2C2.338&mode=driving&language=en&elements=duration_distance&method=distance&key=YOUR_PUBLIC_API_KEY", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
import requests
url = "https://api.woosmap.com/distance/distancematrix/json?origins=48.709%2C2.403&destinations=48.709%2C2.303%7C48.768%2C2.338&mode=driving&language=en&elements=duration_distance&method=distance&key=YOUR_PUBLIC_API_KEY"
payload = {}
headers = {
'Referer': 'http://localhost'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
{
"status": "OK",
"rows": [
{
"elements": [
{
"status": "OK",
"duration": {
"value": 978,
"text": "16 mins"
},
"distance": {
"value": 10796,
"text": "10.8 km"
}
},
{
"status": "OK",
"duration": {
"value": 942,
"text": "16 mins"
},
"distance": {
"value": 10322,
"text": "10.3 km"
}
}
]
}
]
}