Live map example
Loading the Mapsource map…
Request / Response
Compare three destinations
Calculate duration and distance from one origin to several possible destinations.
API call
curl --fail-with-body "https://api.mapsource.io/matrix" \
-H "Authorization: Bearer $MAPSOURCE_API_KEY" -H "Content-Type: application/json" \
--data '{"sources":[{"lat":47.6062,"lon":-122.3321}],"targets":[{"lat":47.6205,"lon":-122.3493},{"lat":47.5988,"lon":-122.3317},{"lat":47.6097,"lon":-122.3425}],"costing":"bicycle"}'Example response
{"schema":"mapsource-matrix.v1","profile":"bicycle","units":{"distance":"kilometers","duration":"seconds"},"durationSeconds":[[418,231,189]],"distanceKm":[[2.49,1.31,1.04]],"pairs":[{"sourceIndex":0,"targetIndex":2,"durationSeconds":189,"distanceKm":1.04}]}Compare places without requesting directions
A matrix returns duration and distance for each source–target pair. Unreachable pairs stay explicit instead of being replaced by straight-line estimates.
Power selection and planning
Rank stores from a user, compare facilities across demand points, build dispatch inputs or measure accessibility while keeping your own business rules in your application.
Service details
Built around a published contract
Inputs, outputs and limits remain inspectable in the generated API reference.
- Endpoint
- POST /api/matrix
- Capacity
- Up to 625 pairs
- Output
- Duration and distance matrices
- Profiles
- Auto, bicycle, pedestrian and more