Distance Matrix API
ETA and distance matrix for driver dispatch (many to many).
Endpoint
POST /v1/matrix
Request Body
{
"origins": [[23.81, 90.41], [23.75, 90.37]],
"destinations": [[23.75, 90.37], [23.70, 90.35]],
"vehicle_type": "car"
}
Example
cURL
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"origins":[[23.81,90.41]],"destinations":[[23.75,90.37],[23.70,90.35]],"vehicle_type":"car"}' \
"https://map.arohon.co/v1/matrix"
JavaScript
const res = await fetch('https://map.arohon.co/v1/matrix', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
origins: [[23.81, 90.41]],
destinations: [[23.75, 90.37], [23.70, 90.35]],
vehicle_type: 'car'
})
});
const data = await res.json();
Response
{
"sources_to_targets": [
[
{"distance": 5.2, "time": 420},
{"distance": 8.1, "time": 600}
]
]
}