Documentation menu
POST/locate
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 | 1 call per request. Class: standard, or premium for truck and ADR work. Published as unit_rules.default in /pricing.json. |
| Premium | When the body asks for truck routing: "costing": "truck", a top-level adr object or "hazmat": true |
What it does
Snaps each location to the road graph.
An API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Price: 1 call per request.
Call it
curl -fsS -X POST "https://api.mapmap.ai/locate" \
-H "Authorization: Bearer $MAPMAP_KEY" \
-H "Content-Type: application/json" \
-d '{"costing":"auto","locations":[{"lat":51.5074,"lon":-0.1278}],"verbose":true}'Request body
application/json
Valhalla locate request JSON: locations, costing, optional costing_options, verbose (default false) and units. Each location may carry heading (degrees clockwise from north) and heading_tolerance (degrees either side, default 60): only edges whose direction of travel at the point is within the tolerance are reported, so at a junction the heading picks the road and direction you are on. When no edge is within the tolerance the location's edges list is empty (no fallback to the nearest edge). radius (metres) and search_filter narrow or widen the search as on /route. exclude_locations on /route, /matrix and /isochrone are matched by the same search and take the same fields: with heading an exclusion closes one direction only, and a point within about 5 m of a junction closes every road at that junction
Example: From website/public/docs/api-reference.md:2240
{
"costing": "auto",
"locations": [
{
"lat": 51.5074,
"lon": -0.1278
}
],
"verbose": true
}Responses
verbose mode, nodes with a dense administrative/access/geometry attribute tree. A location with no nearby graph edges (open sea, an unmapped area) answers an entry with empty edges/nodes arrays, never an errorExample: Recorded from the hosted gateway on 2026-11-05 with a test key: POST /locate with the request example; lists trimmed to their first items
[
{
"edges": [
{
"access_restrictions": [],
"bounding_circle": {
"lat": 51.507498,
"lon": -0.127905,
"radius": 9
},
"correlated_lat": 51.507478,
"correlated_lon": -0.127964,
"distance": 14.3,
"edge": {
"access": {
"HOV": true,
"bicycle": true,
"bus": true,
"car": true,
"emergency": false,
"moped": true,
"motorcycle": true,
"pedestrian": true,
"taxi": true,
"truck": true,
"wheelchair": true
},
"access_restriction": false,
"bike_network": true,
"bridge": false,
"classification": {
"classification": "primary",
"internal": false,
"link": false,
"surface": "paved_smooth",
"use": "road"
},
"country_crossing": false,
"cycle_lane": "none",
"deadend": false,
"destination_only": false,
"destination_only_hgv": false,
"end_node": {
"id": 297350,
"level": 0,
"tile_id": 3194,
"value": 9977410380752
},
"end_restriction": {
"HOV": false,
"bicycle": false,
"bus": false,
"car": false,
"emergency": false,
"moped": false,
"motorcycle": false,
"pedestrian": false,
"taxi": false,
"truck": false,
"wheelchair": false
},
"forward": true,
"geo_attributes": {
"curvature": 15,
"length": 17,
"max_down_slope": -4,
"max_up_slope": 0,
"weighted_grade": -3.33
},
"has_sign": false,
"lane_count": 3,
"not_thru": false,
"part_of_complex_restriction": false,
"round_about": true,
"sac_scale": "none",
"sidewalk_left": false,
"sidewalk_right": false,
"speeds": {
"constrained_flow": 0,
"default": 32,
"free_flow": 0,
"predicted": false,
"type": "tagged"
},
"start_restriction": {
"HOV": false,
"bicycle": false,
"bus": false,
"car": false,
"emergency": false,
"moped": false,
"motorcycle": false,
"pedestrian": false,
"taxi": false,
"truck": false,
"wheelchair": false
},
"stop_sign": false,
"toll": false,
"traffic_signal": false,
"truck_route": false,
"tunnel": false,
"yield_sign": false
},
"edge_id": {
"id": 701784,
"level": 0,
"tile_id": 3194,
"value": 23547963532240
},
"edge_info": {
"bike_network": {
"local": true,
"mountain": false,
"national": false,
"regional": false
},
"mean_elevation": 12,
"names": [
"Charing Cross"
],
"shape": "knwfaBv~xFe@]k@u@]i@]o@_@iA]yA",
"speed_limit": 32,
"speed_limit_type": "zone",
"way_id": 43118738
},
"heading": 45.8,
"inbound_reach": 50,
"linear_reference": "K//osySgpVREAAAQAAsUVD8=",
"live_speed": {},
"outbound_reach": 50,
"percent_along": 0.24819,
"predicted_speeds": [],
"shoulder": false,
"side_of_street": "right"
}
],
"input_lat": 51.5074,
"input_lon": -0.1278,
"nodes": []
}
]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
text/plain
rate-limited, with Retry-After), or monthly quota exhausted with no payment path (quota-exceeded)application/problem+json · Problem
application/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_locate