Close 2,000 places in one route request
A route request can now keep clear of up to 2,000 places in one call, up from 50. Since 18 November 2026, POST /route, GET /route/v1 and the Mapbox Directions alias built on it take up to 2,000 exclude_locations, and since 7 November every route that sends exclusions also says what each one closed and whether the route went past any of them anyway.
Why did 50 stop being enough?
Because a coverage plan can avoid up to 2,000 places, and a route that cannot honour the same list cannot drive the same plan. A survey crew working a district with a dozen streets closed for works, a market and a school run quickly passes 50 places. When the coverage planner learned to avoid 2,000, the route endpoint had to keep up, or the connecting drive between two outings would happily use a street the plan had been told never to touch.
The limits now stand like this:
| Where | exclude_locations per request |
|---|---|
POST /route, GET /route/v1, Mapbox Directions alias | 2,000 |
POST /matrix, POST /isochrone | 50 |
| On-device routing in the mobile SDKs | 50 |
exclude_polygons keeps its own limits: 50 rings, 500 vertices and 10 km of perimeter per request. Exclusions do not change what a request costs.
What does an exclusion actually close?
The nearest road to each point, both ways, unless you say otherwise. Each point is matched to the road graph by the same search as POST /locate, and three optional fields change what it takes:
headingandheading_toleranceclose only one direction of travel.radiuscloses every road within that many metres, which is how you take both carriageways of a divided road.- A point within about 5 m of a junction snaps to the junction and closes every road meeting there. To close one street, put the point a little way along it.
"exclude_locations": [
{ "lat": 50.8253872, "lon": -0.1371350, "heading": 90, "heading_tolerance": 30 },
{ "lat": 50.8226, "lon": -0.1399, "radius": 15 }
]
You can see it working with no key at all, because GET /route/v1 is on the keyless demo lane. In central Brighton, a 1,019 m drive becomes a 2,604 m drive once two streets on it are closed:
curl -s "https://api.mapmap.ai/route/v1/driving/-0.1420,50.8246;-0.1340,50.8226?exclude_locations=-0.1371350,50.8253872;-0.1399,50.8226&overview=false"
On GET /route/v1 the places are ;-separated lon,lat pairs; on POST /route they are objects with the optional fields above.
An exclusion is a hard cut, not a penalty. Where it makes the destination unreachable, /route answers with a problem document rather than an empty route.
How do you know the exclusions worked?
You read the exclusions block. Every route that sends exclude_locations or exclude_polygons now carries it, on POST /route, GET /route/v1 and the Mapbox Directions alias alike:
"exclusions": {
"threshold_m": 5.0,
"locations": [
{"index": 0, "matched": true, "way_ids": [164688480], "snapped_m": 4.2}
],
"passed": [
{"kind": "location", "index": 0, "leg": 0, "distance_m": 4.8}
],
"snap_retry_used": false
}
On the Brighton request above, both places come back matched: true with the ways they closed, and passed is empty. In general, locations says, for each place you sent, whether the engine found a road for it, which OpenStreetMap ways, and how far your point was from them. matched: false means that place excluded nothing, which is the bug you most want to catch. passed lists any place the returned route comes within 5 m of.
The commonest surprise with exclusions is a route that drives straight past a place you closed, and usually the exclusion did exactly what it was told. On Kingsway in Hove, where the two carriageways are about 9 m apart, a point 4.2 m from the eastbound carriageway closed that carriageway only. The eastbound route detoured, from 0.76 km to 1.65 km. The westbound route drove straight past, 4.8 m away, and passed lists it. A heading picks the direction you meant; a radius takes both carriageways.
What happens when the car starts on a closed road?
It drives away from the closure instead of failing. Since 19 November, when a route's origin is on the same stretch as a closed place, the gateway turns the route round if the car's heading points into the closure, or starts it just past the place if the car is standing on it. When no direction is open, for example on a one-way street that runs into the closure, the answer is a 422 route-endpoint-closed with a reason (one_way_into_exclusion, between_exclusions, at_closed_junction or no_path_away) rather than a route through the closure. The same applies to a destination. The extra lookups are not billed.
What it does not promise
passedis a distance check, not proof. A route can come within 5 m of a place on a parallel road it never used, and an empty list does not prove the route avoided a road.- The engine can drop exclusions silently. If its own lookup of the exclusions fails, it routes without any of them and says nothing.
matchedcomes from a separate lookup, so a route that passes every matched exclusion is the sign to look for. - Alternates are not checked. The block describes the main route only.
- Turning round assumes it is allowed. No map data says whether turning in the road is permitted at a given spot; the gateway assumes it is, as the engine already does.
- Long routes are answered as the engine answers them. The closed-road handling looks at the first and last locations only, on a route that is one engine search, so a route split into blocks of more than 20 waypoints, or one asking for live alternates, does not get it.
- Matrices and isochrones are unchanged, at 50 places, and keep the engine's own behaviour at a closed origin.
Try it
Run the keyless request above and read the exclusions block, then move one of the places onto a street the route does not use and watch the distance fall back. The fields, limits and junction rules are in avoiding areas and points, the error codes are in the API reference, and the Mapbox-shaped endpoints are covered in migrating from Mapbox. Routing data © OpenStreetMap contributors.
