Location Clustering
Group large sets of locations into balanced clusters by proximity — perfect for splitting deliveries across drivers or defining service zones.
/api/1/clusterCurrent plan limits
Free includes Routing, Route Optimization, Geocoding (including reverse lookup and autocomplete) and Matrix APIs within plan limits. Map Matching, Isochrone, Truck Routing, Fuel Estimate and other separate APIs require a paid plan, including PAYG. API access follows the account’s effective plan; a positive balance alone does not override Free restrictions. Road Data and AI retain their separate Business requirements.
Replace YOUR_KEY with your own API key. Paid API requests consume credits; copying this example does not send a request.
Current plans and pricingOverview
The Location Clustering API groups large sets of locations into balanced clusters by proximity. Give it hundreds of points and a target number of groups, and it partitions them into compact, well-separated clusters — perfect for splitting deliveries across drivers, defining service territories or pre-grouping stops before optimisation.
API reference
/api/1/cluster| Parameter | Type | Status |
|---|---|---|
| customers | array | Required |
Example request
Credit cost: 3 creditscurl -X POST "https://osrmroute.com/api/1/cluster" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"customers":[[49.85,40.37],[49.86,40.40],[49.83,40.39]],"clusters":2}'