OSRM Geofencing API
Test in one call which of your zones each point falls inside — polygon or circular fences.
/api/1/geofenceCurrent 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 Geofencing API checks, in a single request, which of your zones each point is inside. Define fences as polygons or as a center + radius, then send a batch of points; the response lists the matching fence ids per point. Pure geometry, computed in-house with no rate-dependent upstreams — ideal for delivery zones, alerts and access control.
API reference
/api/1/geofence| Parameter | Type | Status |
|---|---|---|
| fences | array | Required |
| points | array | Required |
Example request
Credit cost: 1 credit / 100 pointscurl -X POST "https://osrmroute.com/api/1/geofence" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"fences":[{"id":"zone1","polygon":[[40.40,49.85],[40.43,49.85],[40.43,49.90],[40.40,49.90]]}],"points":[[40.41,49.87],[40.50,50.10]]}'