Geofencing API
Real-timeTest in one call which of your zones each point falls inside — polygon or circular fences.
Overview
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
POST
/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?key=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]]}'Other services
Routing APIRoute Optimization APIGeocoding APIPlaces APIMatrix APIIsochrones APIMap Matching APINearest APITrip API (TSP)Location ClusteringDirections APIAlternative Routes APISnap to Road APIAutocomplete APIBatch Geocoding APITimezone APIElevation APIBoundary Lookup APIElevation Profile APISolar APIGeometry Utilities APICoordinate Conversion APICountry Info API