provider matrix POST /v2/matrix/{profile}
@utdk/openrouteservice /v2/matrix/{profile}
Many-to-many duration / distance matrix
Returns an N×M matrix of durations (seconds) and/or distances (metres) between all origin / destination pairs. This is the primary input for a Vehicle Routing Problem solver — feed the matrix into or-tools VRPTW. Free-plan limits: 3,500 locations per request total (origins × destinations), or 25 with `metrics: ['duration', 'distance']`.
profile path required
Routing profile. `driving-hgv` is the right pick for service vans / utility vehicles — it respects bridge weight, low-clearance, and large-vehicle turn restrictions that `driving-car` ignores.
enum: driving-car, driving-hgv, cycling-regular, cycling-mountain…

Try it

Authentication
Configure credentials for OpenRouteService API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

getmatrix
POST/v2/matrix/{profile}
Returns an N×M matrix of durations (seconds) and/or distances (metres) between all origin / destination pairs. This is the primary input for a Vehicle Routing Problem solver — feed the matrix into or-tools VRPTW. Free-plan limits: 3,500 locations per request total (origins × destinations), or 25 with `metrics: ['duration', 'distance']`.

Parameters

required

Routing profile. `driving-hgv` is the right pick for service vans / utility vehicles — it respects bridge weight, low-clearance, and large-vehicle turn restrictions that `driving-car` ignores.

Input

required

All locations participating in the matrix.

Indices into `locations` to use as origins. Omit to use all locations.

Indices into `locations` to use as destinations. Omit to use all locations.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import openrouteservice from '@utdk/openrouteservice';

await openrouteservice.getmatrix({
  "metrics": "duration",
  "units": "m",
  "resolve_locations": false
})