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

GET/optimized-trips/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.
Price10 calls per started block of the engine's matrix-pair limit over the problem's unique locations (10 up to 50 locations). Class: standard, or premium for truck and ADR work. Published as unit_rules.optimise in /pricing.json.
PremiumFor the truck profile

What it does

A one-vehicle optimisation of 2 to 12 stops, then the route of the ordered trip. Billed as the optimise units plus the route units: 11 units for a trip of up to 12 coordinates (10 for the solve, 1 for the route); when the order is forced no solve runs and only the route is billed.

Call it

bash
curl -fsS -X GET "https://api.mapmap.ai/optimized-trips/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)
coordinatespathstringyes2 to 12 lon,lat pairs separated by ;; the first is the start
access_tokenquerystringnoYour MapMap key (snk_...)
roundtripquerybooleannoReturn to the first coordinate (default true)
sourcequerystringnoany (default) or first
destinationquerystringnoany (default) or last
stepsquerybooleannoTurn-by-turn steps on the trip
geometriesquerystringnopolyline (default), polyline6 or geojson
overviewquerystringnosimplified (default), full or false
annotationsquerystringnoAs on Directions: distance, duration, speed, maxspeed
languagequerystringnoBCP 47 instruction language for the trip's steps
approachesquerystringnocurb or unrestricted per coordinate, ; separated, in the order the coordinates were given

Responses

200{code, waypoints: [{waypoint_index, trips_index, location, name}], trips: [<route>]}. NotImplemented (an unsupported roundtrip/source/destination combination, not billed), NoTrips and NoRoute also answer 200 with that code
FieldTypeRequiredDescription
codestringnoOk, or a Mapbox error code.
tripsobject[]noThe trip: distance, duration, geometry and legs.
waypointsobject[]noThe input points in input order, each with its waypoint_index in the trip and trips_index.

Example: Recorded from the hosted gateway on 2026-11-05 with a test key: GET /optimized-trips/v1/mapbox/driving/-0.1410,50.8290;-0.1370,50.8220;-0.1530,50.8270; lists trimmed to their first items

json
{
  "code": "Ok",
  "trips": [
    {
      "distance": 4777,
      "duration": 930.438,
      "geometry": "cpfuHjnZJ@TBVDE~@TLD@l@RBVBC`@Jv@Zv@VNFFBB@B@NDL@P@NFD@FBlC`AFBFBRH@Q@GD]H}ALqABUHkAFq@Fs@B_@Fm@Hy@?EDm@@I@UBSDi@Bc@Fe@Bg@LyADo@Dw@@ITgBHY@MFYDWLq@JSBQJ]`@F`AHd@FXL`Ad@t@f@NHLDT?NDD@`@?F?NAR@XH\\LTPPDVBR@FAr@C\\?\\DRGH@J@F?RDR@X@v@Dj@@N@\\?V?DARKNGFEHGRCJVHPFRDTBR?\\B`A?^Gd@?BBtADrA?j@ATAPCRQhAa@lBU`AQ|@OnAAJCLC^@b@U~BGJAPCNBRSbCGNANCVDTAJANEZINKx@KjA@TAJAD?FIf@ADIb@G\\MxAAZ]`CGb@Gh@UpBGf@ALCN?FCPIz@ADANK|@C`@KzAO|ASrBGn@CLAJCZC\\Ed@AFK\\CJCTELG@IAMEMGoFyBy@]cAe@y@]cAa@K`AE|@W~COlBALAJCd@OIGEGCkAm@cCmAECQIMIGC_@Qs@_@a@xCIn@Ho@`@yCkB}@eAk@}BiAeCcCeAsAoEqHw@mA[c@ADEDE?GCEGKUCKAEAIAE@EBG@CFAB?H_@@]?wCCG?]@KCcHFiEJeAVaBBUHYDMFKZ[NO\\U^Sj@QZGXE\\CT?P@\\DZHXBT@N@H?BA@ADGBIFg@@C@C@ACWm@SEAUMD_AWEUCKA",
      "legs": [
        {
          "distance": 1190,
          "duration": 275.606,
          "summary": "North Road, A23",
          "weight": 275.606
        },
        {
          "distance": 2183,
          "duration": 338.86899999999997,
          "summary": "A259, King's Road",
          "weight": 338.86899999999997
        }
      ],
      "weight": 930.438,
      "weight_name": "duration"
    }
  ],
  "waypoints": [
    {
      "location": [
        -0.141,
        50.829
      ],
      "name": "",
      "trips_index": 0,
      "waypoint_index": 0
    },
    {
      "location": [
        -0.137,
        50.822
      ],
      "name": "",
      "trips_index": 0,
      "waypoint_index": 1
    }
  ]
}
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

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

503Optimisation is not enabled on this deployment

application/json

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_optimized_trips