Documentation menu
POST/route/along
Access and price
| Auth | An API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Needs a full key; a browser (maps) key is refused. |
|---|---|
| Price | A flat 10 calls, whatever max_results asks for. Class: standard, or premium for truck and ADR work. Published as unit_rules.along_route in /pricing.json. |
| Premium | When the body asks for truck routing: "costing": "truck", a top-level adr object or "hazmat": true |
What it does
Places along a route matching a query, each priced with its real detour through the routing engine.
An API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Price: A flat 10 calls, whatever max_results asks for.
Call it
curl -fsS -X POST "https://api.mapmap.ai/route/along" \
-H "Authorization: Bearer $MAPMAP_KEY" \
-H "Content-Type: application/json" \
-d '{"costing":"truck","costing_options":{"truck":{"height":4,"weight":40}},"destination":{"lat":52.4862,"lon":-1.8904},"max_detour_minutes":15,"max_results":2,"origin":{"lat":51.1279,"lon":1.3134},"query":"diesel"}'Request body
application/json
Along-route search: a route (geometry_polyline6, or origin + destination + costing), a free-text query, optional max_detour_minutes (default 10), max_results (default 5, max 25), source (geocode default | places), category (an OSM category token for geocode, the customer taxonomy for places), sort (cheapest_diesel | cheapest_petrol, fuel-enriched results by price then detour), Valhalla costing_options and an optional top-level adr profile
Example: From website/public/docs/analysis.md:347
{
"costing": "truck",
"costing_options": {
"truck": {
"height": 4,
"weight": 40
}
},
"destination": {
"lat": 52.4862,
"lon": -1.8904
},
"max_detour_minutes": 15,
"max_results": 2,
"origin": {
"lat": 51.1279,
"lon": 1.3134
},
"query": "diesel"
}Responses
{query, source, costing, route, max_detour_minutes, candidates: {considered, costed, cap}, results[]: {place, detour_minutes, detour_km, along_route_position, off_route_m}}, sorted by detour. When the geocode source browsed the first-party index by category (an explicit category, or a query that is entirely category phrases (fuel, petrol station, coffee near me), which promotes automatically), the response also carries matched_categories naming the normalised tokens browsed. With the fuel-price store configured (SN_FUEL_PRICES), fuel-station results also carry fuel_prices, fuel_brand and fuel_updated_at, and the response a fuel_attribution string| Field | Type | Required | Description |
|---|---|---|---|
| candidates | object | no | How many candidates were found near the route (considered),
how many had their detour computed (costed) and the cap. |
| charging_attribution | string | no | Charge point data attribution, present when a result carries charger data. |
| costing | string | no | The costing the route and detours were computed with. |
| eta_calibration | object | no | The typical-delay calibration applied to the route times. |
| fuel_attribution | string | no | Fuel price attribution, present when a result carries a price. |
| matched_categories | string[] | no | Categories the query was understood as. Present when a category browse ran. |
| max_detour_minutes | number | no | The detour ceiling applied, in minutes. |
| query | string | no | The query as sent. |
| results | object[] | no | Places within the detour ceiling, smallest detour first: the
place, with detour_s, detour_minutes, detour_km,
off_route_m and along_route_position (0 to 1). |
| route | object | no | The base route: distance_m, duration_s and length_m. |
| source | string | no | Where candidates came from: geocode (default) or places. |
Example: Recorded from the hosted gateway on 2026-11-05 with a test key: POST /route/along, coffee between Trafalgar Square and St Paul's by car; lists trimmed to their first items
{
"candidates": {
"cap": 25,
"considered": 31,
"costed": 25
},
"costing": "auto",
"eta_calibration": {
"applied": true,
"cells_calibrated": 51,
"cells_not_walked": 0,
"cells_unchanged": 0,
"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.",
"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"
]
},
"matched_categories": [
"cafe"
],
"max_detour_minutes": 5,
"query": "coffee",
"results": [
{
"along_route_position": 0.459,
"detour_km": 0.04,
"detour_minutes": 0.2,
"detour_s": 9,
"off_route_m": 19,
"place": {
"label": "The Garrick, Aldwych 69, WC2B 4RR, London, Knepp Wildland, United Kingdom",
"lat": 51.5134807,
"lon": -0.1165232,
"name": "The Garrick",
"type": "cafe"
}
},
{
"along_route_position": 0.025,
"detour_km": 0.34,
"detour_minutes": 0.8,
"detour_s": 49,
"off_route_m": 42,
"place": {
"label": "Costa, London, Knepp Wildland, United Kingdom",
"lat": 51.507500500000006,
"lon": -0.1267675,
"name": "Costa",
"type": "cafe"
}
}
],
"route": {
"distance_m": 2477,
"duration_s": 413.753,
"length_m": 2476
},
"source": "geocode"
}application/problem+json · Problem
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
source: "places" on a gateway without customer placesapplication/problem+json · Problem
text/plain
rate-limited, with Retry-After), or monthly quota exhausted with no payment path (quota-exceeded)application/problem+json · Problem
source: "geocode" on a gateway without a geocoder (SN_PHOTON_URL unset), or an explicit category on a gateway without the first-party geocode index (SN_GEOCODE_DIR unset; urn:sn-gateway:problem:reverse-filtering-not-enabled, the same feature-detect status GET /geocode/reverse uses for its first-party-only filters). A category *promoted* from the query degrades to free-text search instead of failingapplication/problem+json · Problem
application/problem+json · Problem
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 post_route_along