Skip to content
Documentation menu
docs / api / get-route-v1-profile-coordinates
Routing

GET/route/v1/{profile}/{coordinates}

Access and price

AuthAn API key, as Authorization: Bearer snk_… or ?api_key=snk_…, or none on the keyless demo lane: a per-IP rate limit and daily cap, never metered. Truck and ADR parameters always need a key (401 demo-premium-requires-key). Needs a full key; a browser (maps) key is refused.
Price1 call per started block of 20 coordinates. Class: standard, or premium for truck and ADR work. Published as unit_rules.route_waypoints in /pricing.json.
PremiumFor the truck profile, or any truck or ADR query parameter

What it does

OSRM-compatible route endpoint.

An API key, as Authorization: Bearer snk_… or ?api_key=snk_…, or none on the keyless demo lane: a per-IP rate limit and daily cap, never metered. Truck and ADR parameters always need a key (401 demo-premium-requires-key). Price: 1 call per started block of 20 coordinates.

Call it

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

Parameters

NameInTypeRequiredDescription
profilepathstringyesRouting profile: driving (aliases car/auto), truck, bus, bicycle (bike/cycling), walking (foot/pedestrian), scooter or motorcycle (motorbike)
coordinatespathstringyeslon,lat pairs separated by ;, e.g. -0.1,51.5;-1.9,52.5
alternativesquerystringnotrue, false or a number of alternates (max 3)
stepsquerybooleannoInclude turn-by-turn steps (default false). Each step carries speedLimitSign (vienna or mutcd), speedLimitUnit (km/h or mph), driving_side, and where the map knows them country (ISO 3166-1 alpha-2), subdivision (ISO 3166-2), ref (route numbers only, ; separated) and road_class, all for the road the step starts on
annotationsquerystringnomaxspeed (alone or in a comma-separated list) adds annotation.maxspeed[] to each leg: one entry per geometry segment, {"speed":30,"unit":"mph"} in the ROAD's own unit (mph in GB, IM, JE, GG, US, PR, GU, VI; km/h elsewhere), {"unknown":true} or {"none":true}, plus "type":"national" on a GB national speed limit where the map carries it. Other annotation names are ignored
geometriesquerystringnopolyline (default), polyline6 or geojson
overviewquerystringnosimplified (default), full or false
avoid_tollsquerybooleannoAvoid toll roads (Valhalla use_tolls=0; motorised profiles only). Hosted gateway only: the public demo router ignores it
avoid_motorwaysquerybooleannoAvoid motorways/highways (Valhalla use_highways=0; motorised profiles only). Hosted gateway only
avoid_ferriesquerybooleannoAvoid ferries (Valhalla use_ferry=0; all profiles). Hosted gateway only
avoidquerystringnoComma-separated road features to PREFER against: tolls, highways, ferries (the same vocabulary as POST /route's avoid array). Renders as the profile's use_* factor set to 0, which the routing engine's own reference states is not guaranteed to avoid them entirely. tolls/highways are motorised-profile only; a value the engine has no field for on the requested profile is an InvalidValue rather than a silently ignored option
excludequerystringnoComma-separated road features to HARD-exclude: tolls, highways, ferries, bridges, tunnels. Renders as the profile's exclude_* boolean: allowed only at the very start or end of the path, so it can answer NoRoute rather than a detour, and it depends on the routing engine's own service_limits.allow_hard_exclusions setting
shortestquerybooleannoPrefer the shortest path over the fastest (Valhalla shortest=true; all profiles). Hosted gateway only
voice_instructionsquerybooleannoWith steps=true: add Mapbox-shaped voiceInstructions (plain + SSML, distance-triggered) to each step
banner_instructionsquerybooleannoWith steps=true: add Mapbox-shaped bannerInstructions (and lane sub-banners where OSM has turn:lanes) to each step
landmarksquerybooleannoWith steps=true: add a landmark_instruction to each step that passes a recognisable place ("Turn right just after the Shell garage") beside the step's own fields, which are never replaced. Nothing is named unless it is recognisable from the road, within 40 m of the junction and not tagged as closed, so many steps carry none. Needs the first-party place index (SN_GEOCODE_DIR); a deployment without one returns no landmarks
snap_retryquerybooleannoDefault true. When the first search finds no path (NoRoute), the gateway searches once more with a wider snap (radius 1000 m, minimum_reachability 500) at every coordinate, and the answer then carries a top-level snap_retry block: the coordinates widened, where the route really starts and ends at each (moved[].distance_m) and any jump between legs (discontinuities). Never sent when the request carries exclude_locations or exclude_polygons: a wider snap would route round the exclusion, so NoRoute stands. false turns the retry off
languagequerystringnoBCP 47 narration language, e.g. en-GB, es-ES (also sets the route voiceLocale)
heightquerynumbernoVendor: vehicle height in metres (truck profile)
widthquerynumbernoVendor: vehicle width in metres (truck profile)
lengthquerynumbernoVendor: vehicle length in metres (truck profile)
weightquerynumbernoVendor: gross weight in tonnes (truck profile)
hazmatquerybooleannoVendor: carrying dangerous goods (truck profile)
tunnel_codequerystringnoVendor: ADR 8.6.4 tunnel restriction code, e.g. B/D (truck profile; implies hazmat)
use_litquerynumbernoVendor: preference for lit streets, 0–1 (walking profile; 1 = prefer lit as strongly as possible)
pedestrian_typequerystringnoVendor: wheelchair (avoids steps/kerbs/steep grades where mapped) or blind (richer guidance); Valhalla pedestrian type (walking profile)
max_hiking_difficultyqueryintegernoVendor: maximum hiking-trail difficulty, OSM sac_scale 1–6 (walking profile; default 1) Limits: at least 0.
bicycle_typequerystringnoVendor: road, hybrid (default), city, cross or mountain (bicycle profile)
use_roadsquerynumbernoVendor: willingness to ride roads alongside traffic, 0–1 (bicycle profile; 0 = prefer cycleways)
use_living_streetsquerynumbernoVendor: preference for living/shared streets, 0–1 (bicycle profile)
avoid_bad_surfacesquerynumbernoVendor: avoidance of surfaces unsuited to the bicycle type, 0–1 (bicycle profile; 1 = strictly avoid)
use_hillsquerynumbernoVendor: willingness to take hills, 0–1 (bicycle profile; 0 = avoid climbs)
depart_atquerystringnoTime-dependent routing: specified departure time, ISO 8601 YYYY-MM-DDThh:mm local (Valhalla date_time.type=1). Mutually exclusive with arrive_by
arrive_byquerystringnoTime-dependent routing: specified arrival time, ISO 8601 YYYY-MM-DDThh:mm local (Valhalla date_time.type=2). Mutually exclusive with depart_at
speed_typesquerystringnoComma-separated speed sources to use: freeflow, constrained, predicted, current (Valhalla costing_options.<costing>.speed_types)
approachesquerystringnoCurbside preference per coordinate, ;-separated: curb (Valhalla preferred_side=same) or unrestricted (either); empty entry = no preference. Must have one entry per coordinate
street_side_tolerancequeryintegernoCurbside: street_side_tolerance in metres, applied to every location (Valhalla default 5) Limits: at least 0.
street_side_max_distancequeryintegernoCurbside: street_side_max_distance in metres, applied to every location (Valhalla default 1000) Limits: at least 0.
street_side_cutoffquerystringnoCurbside: street_side_cutoff road class (motorway…service_other), applied to every location
exclude_polygonsquerystringnoAvoid-areas: JSON array of [lon, lat] rings, e.g. [[[-0.1,51.5],[-0.11,51.5],[-0.11,51.52]]] (Valhalla exclude_polygons). The answer then carries a top-level exclusions block, as on POST /route: each polygon a leg enters is listed in passed[]
exclude_locationsquerystringnoAvoid-locations: lon,lat pairs separated by ; (Valhalla exclude_locations). The answer then carries a top-level exclusions block, as on POST /route: what the engine snapped each one to (locations[]: matched, way_ids, snapped_m) and each one a leg passes within 5 m of (passed[], leg indexing the first route's legs)
safety_alertsquerybooleannoOpt-in route safety alerts: true adds a top-level safety_alerts[] array (speed cameras, average-speed zones, French danger zones, railway level crossings along the primary route, ordered by distance along it) behind the per-country legality gate. Only effective on gateways where the operator configured SN_SAFETY_DIR; the field never appears otherwise
safety_alerts_enforcementquerystringnooptin asserts the END USER explicitly enabled enforcement alerts, unlocking countries whose law requires them off by default (e.g. DE: StVO §23(1c) is a driver-use ban). Without it those countries' cameras/zones are suppressed; forbidden and zones-only regimes are unaffected (never unlockable)

Responses

200OSRM route response (code: Ok)
FieldTypeRequiredDescription
codestringnoOk, or an OSRM error code.
exclusionsobjectnoPresent when the request sent exclude_locations or exclude_polygons: the same block as POST /route's, with leg indexing the first route's legs.
routesobject[]noRoutes: distance (metres), duration (seconds), legs, and geometry when an overview was asked for.
waypointsobject[]noThe snapped input points: location and name.

Example: Recorded from the hosted gateway on 2026-11-05, keyless: GET /route/v1/driving/-0.1278,51.5074;-0.0877,51.5079?overview=false

json
{
  "code": "Ok",
  "routes": [
    {
      "distance": 3539,
      "duration": 576.7520000000001,
      "legs": [
        {
          "distance": 3539,
          "duration": 576.7520000000001,
          "summary": "A3211, Northumberland Avenue",
          "weight": 576.7520000000001
        }
      ],
      "weight": 576.7520000000001,
      "weight_name": "duration"
    }
  ],
  "waypoints": [
    {
      "location": [
        -0.1278,
        51.5074
      ],
      "name": ""
    },
    {
      "location": [
        -0.0877,
        51.5079
      ],
      "name": ""
    }
  ]
}
400OSRM error envelope, e.g. InvalidQuery, InvalidValue, NoSegment, NoRoute

application/json

401Missing or invalid API key. Also: A malformed, unknown, revoked or expired key (unauthorized); or a keyless call on the demo lane that engaged truck or ADR parameters (demo-premium-requires-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

429Quota or rate limit exceeded. Also: Per-key rate limit (rate-limited, with Retry-After); monthly quota with no payment path (quota-exceeded); or, keyless, the demo lane's per-IP rate (rate-limited) or daily cap (demo-daily-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 Routing

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