# Matrix: times and distances from every source to every target

> /sources-to-targets returns the travel time and distance from each source to each target in Valhalla’s body. It is the input a dispatch or route-planning tool needs. On Berlin the responses were byte-identical to Valhalla 3.9.1 on 60/60 matrices.

Status: In development, not deployed: there is no routing endpoint to call yet, on geolith.app or api.geolith.app, and no routing plan, price or key.

## Matrix (/sources-to-targets) against Valhalla 3.9.1, Berlin

| Set | Requests | Byte-identical |
| --- | --- | --- |
| Matrices | 60 | 60/60 |

## Request

sources and targets are lists of points; costing is auto, pedestrian or bicycle. The path is kebab-case: Valhalla’s /sources_to_targets is /sources-to-targets here.

Request shape (no hosted endpoint):

```bash
curl -X POST "https://ROUTER_HOST/sources-to-targets" \
  -H "Content-Type: application/json" \
  -d '{
    "sources": [{ "lat": 52.5163, "lon": 13.3777 }],
    "targets": [
      { "lat": 52.5079, "lon": 13.3376 },
      { "lat": 52.5200, "lon": 13.4050 }
    ],
    "costing": "auto"
  }'
```

## Response

Valhalla’s sources_to_targets: one row per source, one cell per target, each with time, distance, from_index and to_index.

## What it is not

The matrix gives the costs; it does not choose a visiting order. A route optimizer (your own, or an open-source solver) takes the matrix and returns the order.

## Sources

1. [Routing API (planned)](https://docs.geolith.app/routing/api), geolith docs (read 2026-11-08)
2. [Valhalla turn-by-turn API reference](https://valhalla.github.io/valhalla/api/turn-by-turn/api-reference/), Valhalla (open source, MIT) (read 2026-11-08)

Routing is in development and not deployed; there is no endpoint to call yet, and no routing plan, price or key. Read the routing docs: https://docs.geolith.app/routing
