Overview
Distance Matrix API returns an N×N matrix of driving times (seconds) and distances (meters) in a single request, powered by thetable service. Ideal for nearest-store lookup, dispatch, and batch route planning.
Endpoint
Request Parameters
Service options
Unlike the array-encoded general options,
sources and destinations may contain fewer entries than the number of input coordinates. With skip_waypoints=true, both arrays are skipped in the response.General options
These options apply to all routing services. Options that take one value per coordinate use the array-like encoding{option}={element};{element}[;...] — the number of elements must match the number of coordinates (except generate_hints and exclude). Pass an empty element to use the default for that coordinate, e.g. bearings=;90,20;.
Quickstart
Response
response-example.json
Response fields
Size limits
Exceeding the limit returns
400 TooBig. For large matrices: trim to the sub-matrix you need with sources/destinations, compute in batches, and cache the results — matrices are stable and rarely need real-time recomputation.
Errors
See Errors for the full list.
Recipes
- Nearest store:
sources=0(the user) againstdestinations=all, pick the column with the smallest duration - Dispatch planning: feed the matrix into Fleet Optimization or your own VRP solver
