Distance matrix
distance_matrixCompute distances in km and travel times in minutes from multiple origins to destinations, up to 2500 pairs, via straight-line or OSRM road routing.
Instructions
Compute distances (km) and travel times (minutes) from each origin (rows) to each destination (columns). At most 2500 cells per request. haversine is local; osrm calls the configured OSRM server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | haversine = straight-line km with minutes at averageSpeedKmh; osrm = road km/minutes from the OSRM server | haversine |
| origins | Yes | Origin locations (1-100). origins x destinations must not exceed 2500 cells | |
| destinations | No | Destination locations (1-100). Omit for an origins x origins matrix | |
| averageSpeedKmh | No | Speed in km/h for haversine durations. Defaults to HAVERSINE_SPEED_KMH (40) |