Geometry Utilities API
Distance, bearing, area, centroid, simplification and polyline encode/decode — spatial math as a service.
/api/1/geometryCurrent 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 Geometry Utilities API is spatial math as a service: distance and bearing between points, a destination from a bearing and distance, midpoints, path length, polygon area, centroids, Douglas–Peucker simplification and Google polyline encode/decode. One endpoint, pick the operation with the op field. Pure computation, works worldwide.
API reference
/api/1/geometry| Parameter | Type | Status |
|---|---|---|
| op | string | Required |
| from | array | Optional |
| to | array | Optional |
| path | array | Optional |
| polygon | array | Optional |
Example request
Credit cost: 1 creditcurl -X POST "https://osrmroute.com/api/1/geometry" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"op":"distance","from":[40.37,49.85],"to":[40.40,49.86]}'