Skip to content
Navigation

Walking distance/duration from one origin to many destinations (JSON body variant)

Identical handler and response to the GET, with the inputs in a JSON body. The body form additionally accepts dests as an array of <lat>,<lng> strings.

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.

POST
https://res.aireon.ch/res_api/routing/table

Authorization

  • ResApiToken
    optional
    API key in header
  • ResApiTokenQuery
    optional
    API key in query

Request body JSON required

  • origin
    string
    required

    <lat>,<lng>; must lie within Switzerland (lat 45.5..48.1, lng 5.5..11.0).

    pattern: ^-?[0-9.]+,-?[0-9.]+$
  • dests
    required

    1..300 destinations as a semicolon-separated <lat>,<lng> list, or (POST body only) a JSON array of such strings, which is joined with ;.

    One of the following:

    • string
    • array<string>
  • profile
    optional
    foot

    Only foot is available; any other value is a 400 InvalidInput.

    default: "foot"

Returns

200

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

JSON
  • generator
    string
    required
  • engine
    string
    required
  • profile
    string
    required
  • code
    string
    required
  • count
    integer
    required

    Number of destinations, in request order.

  • distances
    array of
    number | null
    required

    Walking distance origin→dest in metres, 1 decimal; null for a destination outside Switzerland or unroutable.

  • durations
    array of
    number | null
    required

    Walking time origin→dest in seconds, 1 decimal; null as for distances.

  • 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.
JSON
  • code
    InvalidInput
    or
    EngineError
    or
    EngineUnavailable
    required
  • message
    string
    required

401

Missing token.
JSON
  • error
    string
    required

    Human-readable error description.

  • message
    optional
    string

    Optional underlying error message.

403

Wrong token.
JSON
  • error
    string
    required

    Human-readable error description.

  • message
    optional
    string

    Optional underlying error message.

502

EngineError: OSRM answered an HTTP error or a non-Ok code.
JSON
  • code
    InvalidInput
    or
    EngineError
    or
    EngineUnavailable
    required
  • message
    string
    required

503

EngineUnavailable: OSRM not reachable within 8 s.
JSON
  • code
    InvalidInput
    or
    EngineError
    or
    EngineUnavailable
    required
  • message
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close