> ## Documentation Index
> Fetch the complete documentation index at: https://docs.footstep.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# get_matrix

> Calculate travel times and distances between every combination of origins and destinations

Compute a time and distance matrix between a set of origins and destinations. Returns every source-to-target pair with distance in meters and duration in seconds. Unreachable pairs come back as `null`.

Useful for logistics, dispatching, and finding the closest location from a set of options.

## Example prompts

* "How long does it take to drive between each of these 4 warehouses?"
* "Calculate travel times from our office to all 10 client locations"
* "Which of these 3 restaurants is closest to my hotel by walking?"
* "Build a distance matrix for these delivery origins and destinations"

## What you get back

A 2D matrix indexed by source and target, where each cell contains `distance_meters` and `duration_seconds`. Unreachable pairs come back as `null`. The matrix preserves the order of your input — `matrix[i][j]` is the route from `sources[i]` to `targets[j]`.

If you need to verify how a coordinate snapped to the road network, call [`/v1/routing/locate`](/api/endpoint/locate) — that's the dedicated tool for snap diagnostics.
