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

1

Send origins and destinations

Arrays of coordinates — NxM combinations.

2

Plaza computes the matrix

All pairs on the real road network, not straight lines.

3

Get the matrix

Duration and distance for every origin-destination pair.

See it in action

A real API request, visualized.

terminal
$

          

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.

Distance Matrix Routing Geocoding

Warehouse Optimizer

Score candidate warehouse locations against customer density.

Distance Matrix Isochrone Search

Multi-Stop Planner

Pre-compute travel times for all stop combinations.

Distance Matrix Optimization

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

Google: $5-10/1K elements
Plaza: from $1.50/1K
Mapbox: $2/1K requests
Plaza: from $1.50/1K

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.

Try it yourself