Distance Matrix API

Compute travel times and distances between multiple origins and destinations

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 for every pair, and distance when you ask for it.

See it in action

An example request and its response, drawn on the map.

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 "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

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 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.