Documentation menu
GET/optimized-trips/v1/{user}/{profile}/{coordinates}
Access and price
| Auth | An API key, as Authorization: Bearer snk_…, ?api_key=snk_… or ?access_token=snk_…. Metered. Needs a full key; a browser (maps) key is refused. |
|---|---|
| Price | 10 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. |
| Premium | For 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
curl -fsS -X GET "https://api.mapmap.ai/optimized-trips/v1/{user}/{profile}/{coordinates}" \
-H "Authorization: Bearer $MAPMAP_KEY"Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| user | path | string | yes | mapbox or mapmap |
| profile | path | string | yes | driving, driving-traffic (served as driving), walking, cycling or truck (premium) |
| coordinates | path | string | yes | 2 to 12 lon,lat pairs separated by ;; the first is the start |
| access_token | query | string | no | Your MapMap key (snk_...) |
| roundtrip | query | boolean | no | Return to the first coordinate (default true) |
| source | query | string | no | any (default) or first |
| destination | query | string | no | any (default) or last |
| steps | query | boolean | no | Turn-by-turn steps on the trip |
| geometries | query | string | no | polyline (default), polyline6 or geojson |
| overview | query | string | no | simplified (default), full or false |
| annotations | query | string | no | As on Directions: distance, duration, speed, maxspeed |
| language | query | string | no | BCP 47 instruction language for the trip's steps |
| approaches | query | string | no | curb or unrestricted per coordinate, ; separated, in the order the coordinates were given |
Responses
{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| Field | Type | Required | Description |
|---|---|---|---|
| code | string | no | Ok, or a Mapbox error code. |
| trips | object[] | no | The trip: distance, duration, geometry and legs. |
| waypoints | object[] | no | The 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
{
"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
}
]
}{code, message} for a malformed or unsupported option, not billedapplication/json
unauthorized); the body carries signup, docs and a one-call hint for a free keyapplication/problem+json · Problem
X-PAYMENT). Not problem+jsonapplication/json · X402PaymentRequired
scope-insufficient), a request from an origin the key does not allow (origin-not-allowed), or an account restriction (forbidden)application/problem+json · Problem
ProfileNotFoundapplication/json
rate-limited, with Retry-After), or monthly quota exhausted with no payment path (quota-exceeded)application/problem+json · Problem
application/json
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