---
title: "Walking distance/duration from one origin to many destinations (query variant)"
description: "Proxy over the box-local OSRM instance (foot profile): one origin, up to 300 destinations, walking distance (m) and duration (s) per destination, 1 decimal. Only in-bounds destinations are sent to OSRM; out-of-bounds ones come back as `null` at their original index. `null` also marks a destination OSRM could not route.\n\n**Caching.** Redis `routing:table:foot:<sha1>` keyed on the origin and the ORIGINAL destination list (order and out-of-bounds entries included, coordinates quantised to 5 dp ≈ 1 m), 30-day TTL; a hit is returned with `cached: true`.\n\nCORS is open (`*`) on this router and `OPTIONS` answers 200. Auth: `token` header or `?token=`; errors are always real status codes with JSON bodies (no `X-RES-API-Version` needed). `GET /res_api/routing/health` is the token-free OSRM probe."
---

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

Path: RES API (public) › Score

`GET /res_api/routing/table`

Proxy over the box-local OSRM instance (foot profile): one origin, up to 300 destinations, walking distance (m) and duration (s) per destination, 1 decimal. Only in-bounds destinations are sent to OSRM; out-of-bounds ones come back as `null` at their original index. `null` also marks a destination OSRM could not route.

**Caching.** Redis `routing:table:foot:<sha1>` keyed on the origin and the ORIGINAL destination list (order and out-of-bounds entries included, coordinates quantised to 5 dp ≈ 1 m), 30-day TTL; a hit is returned with `cached: true`.

CORS is open (`*`) on this router and `OPTIONS` answers 200. Auth: `token` header or `?token=`; errors are always real status codes with JSON bodies (no `X-RES-API-Version` needed). `GET /res_api/routing/health` is the token-free OSRM probe.

## Authentication

Requires one of the following:

- `ResApiToken`, apiKey, in header, header `token`
- `ResApiTokenQuery`, apiKey, in query

## Query parameters

- `origin` (`getRoutingTable.query.origin`; string, required): `<lat>,<lng>`, inside Switzerland (lat 45.5..48.1, lng 5.5..11.0).
- `dests` (`getRoutingTable.query.dests`; string, required): Semicolon-separated `<lat>,<lng>` list, 1..300 entries. Destinations outside Switzerland are accepted and answered with `null`.
- `profile` (`getRoutingTable.query.profile`; string, optional): Only `foot` exists.
  - one of `"foot"`; default `"foot"`

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://res.aireon.ch/res_api/routing/table?origin=47.3769%2C8.5417&dests=47.3780%2C8.5400%3B47.3800%2C8.5450' \
  --header 'token: <token>'
```

### TypeScript

```typescript
const url = 'https://res.aireon.ch/res_api/routing/table?origin=47.3769%2C8.5417&dests=47.3780%2C8.5400%3B47.3800%2C8.5450';
const options = {method: 'GET', headers: {token: '<token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://res.aireon.ch/res_api/routing/table?origin=47.3769%2C8.5417&dests=47.3780%2C8.5400%3B47.3800%2C8.5450"

headers = {"token": "<token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Origin→destination matrix, arrays aligned 1:1 with the request order.

#### Example

```json
{
  "generator": "RES routing",
  "engine": "osrm",
  "profile": "foot",
  "code": "Ok",
  "count": 2,
  "distances": [
    312.4,
    655.9
  ],
  "durations": [
    224.9,
    472.3
  ],
  "cached": false
}
```

- `generator` (`getRoutingTable.response.200.generator`; string, required)
- `engine` (`getRoutingTable.response.200.engine`; string, required)
- `profile` (`getRoutingTable.response.200.profile`; string, required)
- `code` (`getRoutingTable.response.200.code`; string, required)
- `count` (`getRoutingTable.response.200.count`; integer, required): Number of destinations, in request order.
- `distances` (`getRoutingTable.response.200.distances`; array<number | null>, required): Walking distance origin→dest in metres, 1 decimal; null for a destination outside Switzerland or unroutable.
- `durations` (`getRoutingTable.response.200.durations`; array<number | null>, required): Walking time origin→dest in seconds, 1 decimal; null as for `distances`.
- `cached` (`getRoutingTable.response.200.cached`; boolean, required): True when served from the Redis cache (key = SHA-1 of origin + dests at 5 dp, 30-day TTL).

### 400

`InvalidInput`: unsupported profile, malformed or out-of-Switzerland origin, missing/empty/over-300/malformed `dests`.

#### Example

```json
{
  "code": "InvalidInput",
  "message": "dests must contain 1..300 entries"
}
```

- `code` (`getRoutingTable.response.400.code`; string, required)
  - one of `"InvalidInput"`, `"EngineError"`, `"EngineUnavailable"`
- `message` (`getRoutingTable.response.400.message`; string, required)

### 401

Missing token.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`getRoutingTable.response.401.error`; string, required): Human-readable error description.
- `message` (`getRoutingTable.response.401.message`; string, optional): Optional underlying error message.

### 403

Wrong token.

#### Example

```json
{
  "error": "string",
  "message": "string"
}
```

- `error` (`getRoutingTable.response.403.error`; string, required): Human-readable error description.
- `message` (`getRoutingTable.response.403.message`; string, optional): Optional underlying error message.

### 502

`EngineError`: OSRM answered an HTTP error or a non-`Ok` code.

#### Example

```json
{
  "code": "InvalidInput",
  "message": "string"
}
```

- `code` (`getRoutingTable.response.502.code`; string, required)
  - one of `"InvalidInput"`, `"EngineError"`, `"EngineUnavailable"`
- `message` (`getRoutingTable.response.502.message`; string, required)

### 503

`EngineUnavailable`: OSRM not reachable within 8 s.

#### Example

```json
{
  "code": "EngineUnavailable",
  "message": "routing engine not reachable"
}
```

- `code` (`getRoutingTable.response.503.code`; string, required)
  - one of `"InvalidInput"`, `"EngineError"`, `"EngineUnavailable"`
- `message` (`getRoutingTable.response.503.message`; string, required)


Source: https://docs.aireon.ch/res/get-routing-table/index.md
