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.
Traffic calculations use the optional departure_time parameter. Matrix requests reject any non-null arrival_time value with HTTP 200 and INVALID_REQUEST. Omitting arrival_time, or setting it to JSON null in a POST body, is accepted.
Rate limit: 20 requests/2s GET and POST
Elements limit: 1000 elements/1s GET and POST
Rate limit with TRAFFIC: 20 requests/2s GET and POST
Elements limit with TRAFFIC: 1000 elements/1sGET and POST
Authorization
Header Parameters
accept-language
string
Query Parameters
origins
string required
destinations
string required
mode
string Defaults to
driving method
string Defaults to
time units
string Defaults to
metric language
string Defaults to
en avoid
string
departure_time
string
elements
string Defaults to
distance 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
detail
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"
}
}
]
}
]
}