## Calculate a distance matrix between points **post** `/api/v1/matrix` Calculate a distance matrix between points ### Body Parameters - `destinations: GeoJsonGeometry` Destination points (GeoJSON MultiPoint geometry) - `coordinates: array of number or array of array of number or array of array of array of number or array of array of array of array of number` GeoJSON coordinates array (nesting depth varies by geometry type) - `array of number` - `array of array of number` - `array of array of array of number` - `array of array of array of array of number` - `type: "Point" or "LineString" or "Polygon" or 3 more` - `"Point"` - `"LineString"` - `"Polygon"` - `"MultiPoint"` - `"MultiLineString"` - `"MultiPolygon"` - `origins: GeoJsonGeometry` Origin points (GeoJSON MultiPoint geometry) - `mode: optional "auto" or "foot" or "bicycle"` Travel mode - `"auto"` - `"foot"` - `"bicycle"` ### Returns - `MatrixResult = object { distances, durations }` - `distances: array of array of number` Distance matrix (meters), origins x destinations - `durations: array of array of number` Duration matrix (seconds), origins x destinations ### Example ```http curl https://plaza.fyi/api/v1/matrix \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $PLAZA_API_KEY" \ -d '{ "destinations": { "coordinates": [ 0 ], "type": "Point" }, "origins": { "coordinates": [ 0 ], "type": "Point" } }' ``` #### Response ```json { "distances": [ [ 0 ] ], "durations": [ [ 0 ] ] } ```