Skip to content

50,000 free calls a month, card-free. Get an API key →

Documentation menu
docs / api / post-route
routing

POST/route

API key required, sent as Authorization: Bearer snk_… or ?api_key=snk_….

Call it

bash
curl -fsS -X POST "https://api.mapmap.ai/route" \
  -H "Authorization: Bearer $MAPMAP_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json

Request body

application/json

Valhalla RouteRequest JSON (costing may be auto, truck, bicycle, pedestrian, motor_scooter, bus or motorcycle; per-mode costing_options such as pedestrian use_lit/type/max_hiking_difficulty or bicycle bicycle_type/use_roads/use_living_streets/avoid_bad_surfaces/use_hills pass through), optionally extended with top-level avoid and exclude string arrays naming road features to keep off; avoid accepts tolls, highways and ferries and is a PREFERENCE (the engine's use_* factor set to 0, which its own reference says is not guaranteed to avoid them entirely); exclude accepts tolls, highways, ferries, bridges and tunnels and is a HARD exclusion that can answer "no path" and that depends on the routing engine's service_limits.allow_hard_exclusions setting. Both are validated per costing, so a value the engine has no field for is a 400 naming the supported set rather than a silently ignored option, and every response that used either carries a top-level avoid block echoing what was applied. Kerbside arrival uses each location's own preferred_side (same/opposite/either, aliases curb/unrestricted; resolved against the locale's driving side) with street_side_tolerance, street_side_max_distance and street_side_cutoff, optionally extended with a top-level adr vehicle profile object, a top-level truck object accepted as an alias for costing_options.truck on truck costing (merged before the search; a field declared in both places with different values is a 400 naming it, and a top-level truck object on any other costing is a 400), and a top-level rationale: true flag (truck, auto, bicycle, pedestrian and motor_scooter; opt-in because it costs up to 1 + N extra engine calls, and it draws one call of its class per engine computation it performs, at most 8 and typically fewer, reported back in rationale.metering) for a structured rationale.avoided[] block derived by route divergence, with live incidents on the route attached as context where incident data is configured, and a top-level landmarks: true flag for turn instructions anchored to recognisable places ("Turn right just after the Shell garage"), added alongside each manoeuvre's own instruction as landmark_instruction and never replacing it, and a top-level traffic: true flag for a per-leg traffic object (covered_pct, confidence in HERE's bands, sources) saying what speed data stood behind the ETA; computed from the returned geometry, so it costs no extra engine call and is not metered separately. May also carry an optional top-level emissions object (vehicle_category, fuel, euro_standard) declaring the vehicle for UK clean-air zone assessment, and a top-level avoid_zones: true flag asking the search to keep out of every zone that vehicle would be charged or banned in (applied as exclude_polygons before the route is computed, so no extra engine call and no extra metering). At most 500 locations (waypoints) per request. The routing engine takes 20 per call, so longer lists are cut at break waypoints, routed concurrently and spliced into one continuous route, and billed one call per started block of 20 waypoints

The OpenAPI document declares this body as a free-form JSON object with no field list, so there is nothing here to generate a table from. The prose above is what the gateway states about it; the raw document is the authority.

Responses

200Valhalla route response, with an adr echo when an ADR profile was applied, a rationale block when requested (avoided[] entries carry basis: "route_divergence"; see the module docs for the method's honesty limits), and, when landmarks was requested, a landmark_instruction on each manoeuvre where a recognisable place cleared the salience bar plus a landmarks summary block reporting how many were annotated, and, when traffic was requested, a traffic object on each leg plus a top-level traffic summary carrying the route aggregate, the coverage snapshot's freshness and the method's caveats, and, when the route crosses a UK clean-air or low-emission zone (or avoid_zones was set), a top-level zones block naming each crossed zone, whether the declared vehicle is charged, banned or compliant there, the published daily charge with its source URL and checked date, and an estimated_charges total kept separate from every routing cost
400Invalid request, conflicting costing_options, or more than 500 locations
401Missing or invalid API key
422More waypoints than the routing engine takes in one call, AND the route cannot be split faithfully: a run of more than 20 consecutive through/via/break_through waypoints, a time-dependent route (date_time.type 0, 1 or 2), or a request for alternates. detail says which and what to change
429Quota or rate limit exceeded
502Upstream routing engine failed

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

Also under routing

Generated from https://api.mapmap.ai/openapi.json on 2026-09-17 · operationId post_route