Distance Matrix API
Compute travel times and distances between multiple origins and destinations
Compute travel times between hundreds of points in a single request.
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 and distance for every origin-destination pair.
See it in action
A real API request, visualized.
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 "Content-Type: application/json" \
-d '{
"origins": [{"lat": 38.9, "lng": -77.03}],
"destinations": [
{"lat": 38.88, "lng": -77.01},
{"lat": 38.91, "lng": -77.04}
]
}'
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 the depart_at parameter to get traffic-adjusted durations alongside free-flow estimates.
What annotations are available?
Duration (seconds) and distance (meters) by default. You can also request the estimated weight/cost for each origin-destination pair via the annotations parameter.
How large can a matrix be?
The API supports NxM matrices. Practical limits depend on geographic spread and network complexity. For very large matrices, split into smaller batches.