distance_matrix
Compute road distances and travel times for every origin → destination pair. Endpoints accept free-text addresses or 'lat,lon' strings; N × M is capped at 625 pairs. Use for fleet dispatch, nearest-depot, and bulk ETA tables. Durations do NOT include live or historical traffic — see duration_basis; use directions for a traffic-adjusted ETA between two specific points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | Distance units (default kilometers) | |
| costing | No | Transport mode (default auto) | |
| origins | Yes | Origin endpoints (1–25): address or 'lat,lon' | |
| destinations | Yes | Destination endpoints (1–25): address or 'lat,lon' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta | No | ||
| units | Yes | ||
| matrix | Yes | matrix[i][j] = origin i → destination j: { distance (in the requested units), time_seconds }; both null when no route exists | |
| costing | Yes | ||
| origins | Yes | Geocoded origin locations | |
| destinations | Yes | Geocoded destination locations | |
| duration_basis | No | How matrix durations were computed. `static_road_speeds` (the only value today): durations come from the road network's own speed data — posted limits and road-class defaults — never from historical or live traffic. Use `directions` for a traffic-adjusted ETA between two specific points. | |
| upstream_error | No | ||
| traffic_applied | No | Whether live or historical traffic influenced any matrix duration. Always false today — see `duration_basis`. |