Distance Matrix API
Compute travel times and distances between multiple origins and destinations
How it works
Send origins and destinations
Arrays of coordinates — NxM combinations.
Plaza computes the matrix
All pairs on the real road network, not straight lines.
Get the matrix
Duration for every pair, and distance when you ask for it.
See it in action
An example request and its response, drawn on the map.
Who uses this
Teams building with Distance Matrix API.
Logistics optimization
Assign packages to the nearest available driver.
Site selection
Score candidate locations by total travel time to customers.
Sales territory planning
Balance travel times across sales territories.
What you can build
Example apps powered by Distance Matrix API.
Driver Assigner
Match deliveries to the nearest available driver in real time.
Warehouse Optimizer
Score candidate warehouse locations against customer density.
Multi-Stop Planner
Pre-compute travel times for all stop combinations.
Start building
curl -X POST "https://plaza.fyi/api/v1/matrix" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destinations": [
{
"coordinates": [
-77.01,
38.88
],
"type": "Point"
},
{
"coordinates": [
-77.04,
38.91
],
"type": "Point"
}
],
"origins": [
{
"coordinates": [
-77.03,
38.9
],
"type": "Point"
}
]
}'
View endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/matrix | Compute NxM distance and duration matrix between origins and destinations |
How it compares
Common questions
Does the matrix support traffic?
Yes. Pass depart_at and traffic_model like you would on a route, and every pair is timed with that hour's traffic profile. Without depart_at, durations are free-flow.
What annotations are available?
Duration in seconds by default. Send annotations: "duration,distance" to get road distance in metres too.
How large can a matrix be?
Up to 2,500 origin-destination pairs per request (origins x destinations). Split larger matrices into batches.