Skip to content
Documentation menu
docs / api / get-directions-matrix-v1-user-profile-coordinates
Mapbox-compatible paths

GET/directions-matrix/v1/{user}/{profile}/{coordinates}

Access and price

AuthAn API key, as Authorization: Bearer snk_…, ?api_key=snk_… or ?access_token=snk_…. Metered. Needs a full key; a browser (maps) key is refused.
Price1 call per started block of 25 elements (sources × targets), at most 10000 elements per request. Class: standard, or premium for truck and ADR work. Published as unit_rules.matrix in /pricing.json.
PremiumFor the truck profile

What it does

Mapbox-compatible Matrix.

An API key, as Authorization: Bearer snk_…, ?api_key=snk_… or ?access_token=snk_…. Metered. Price: 1 call per started block of 25 elements (sources × targets), at most 10000 elements per request.

Call it

bash
curl -fsS -X GET "https://api.mapmap.ai/directions-matrix/v1/{user}/{profile}/{coordinates}" \
  -H "Authorization: Bearer $MAPMAP_KEY"

Parameters

NameInTypeRequiredDescription
userpathstringyesmapbox or mapmap
profilepathstringyesdriving, driving-traffic (served as driving), walking, cycling or truck (premium)
coordinatespathstringyeslon,lat pairs separated by ;
access_tokenquerystringnoYour MapMap key (snk_...)
sourcesquerystringno;-separated coordinate indices, or all (default)
destinationsquerystringno;-separated coordinate indices, or all (default)
annotationsquerystringnoduration (default), distance, or both comma-separated
depart_atquerystringnoLocal departure time, YYYY-MM-DDThh:mm

Responses

200{code, durations, distances?, sources, destinations}; waypoints carry the input coordinate and an empty name (the engine reports no snapped position). Metered as POST /matrix: one unit per started block of 25 elements
FieldTypeRequiredDescription
codestringnoOk, or a Mapbox error code.
destinationsobject[]noThe snapped destinations: location and name.
distancesnumber[][]noMetres, distances[source][destination], when asked for.
durationsnumber[][]noSeconds, durations[source][destination].
eta_calibrationobjectnoThe typical-delay calibration applied to the durations, with the engine's own in engine_durations. A MapMap addition.
sourcesobject[]noThe snapped sources: location and name.

Example: Recorded from the hosted gateway on 2026-11-05 with a test key: GET /directions-matrix/v1/mapbox/driving/-0.1410,50.8290;-0.1370,50.8220;-0.1530,50.8270?sources=0&destinations=1;2&annotations=duration,distance; lists trimmed to their first items

json
{
  "code": "Ok",
  "destinations": [
    {
      "location": [
        -0.137,
        50.822
      ],
      "name": ""
    },
    {
      "location": [
        -0.153,
        50.827
      ],
      "name": ""
    }
  ],
  "distances": [
    [
      1193,
      1696
    ]
  ],
  "durations": [
    [
      274.836,
      372.253
    ]
  ],
  "eta_calibration": {
    "applied": true,
    "cells_calibrated": 2,
    "cells_not_walked": 0,
    "cells_unchanged": 0,
    "engine_durations": [
      [
        226,
        301
      ]
    ],
    "method": "gb_typical_delay_v1",
    "note": "Local roads in Great Britain carry no live traffic data, so the time on them includes the junction and congestion delay a typical car meets at this time of day, from Department for Transport statistics, on top of the routing engine's free-flowing time: the same delay POST /route adds, applied to the path each cell was costed on. It is a typical figure, not live traffic. Motorways, roads covered by National Highways traffic data and roads outside Great Britain keep the engine's own time. engine_durations holds the engine's own times.",
    "period": "all_day",
    "sources": [
      "Department for Transport, tables CGN0503 and CGN0504: average speed and delay on local 'A' roads in England, urban and rural, by time of day, rolling year to June 2026"
    ]
  },
  "sources": [
    {
      "location": [
        -0.141,
        50.829
      ],
      "name": ""
    }
  ]
}
400{code, message} for a malformed or unsupported option, not billed

application/json

401Missing or invalid key. Also: No key, or a missing, malformed, unknown, revoked or expired one (unauthorized); the body carries signup, docs and a one-call hint for a free key

application/problem+json · Problem

402Beyond the included volume with no way to pay this call: an x402 body naming how to pay (provisional key past its allowance, prepaid balance below the price, or a rejected X-PAYMENT). Not problem+json

application/json · X402PaymentRequired

403The key may not call this: a browser key outside its scope (scope-insufficient), a request from an origin the key does not allow (origin-not-allowed), or an account restriction (forbidden)

application/problem+json · Problem

404ProfileNotFound

application/json

422More than 10,000 elements, or a span beyond the engine's matrix distance

application/json

429Quota or rate limit exceeded. Also: Per-key rate limit (rate-limited, with Retry-After), or monthly quota exhausted with no payment path (quota-exceeded)

application/problem+json · Problem

504The request did not finish within the gateway's request deadline (request-timeout)

application/problem+json · Problem

Error bodies follow the shared problem model documented on API conventions.

Also under Mapbox-compatible paths

Generated from https://api.mapmap.ai/openapi.json on 2026-11-12 · operationId get_matrix