OSRM Nearest API
Snap to RoadHosted OSRM (Open Source Routing Machine) · Nearest Service — production-ready API, no self-hosting.
Snap any coordinate to the closest point on the real road network. Essential for cleaning GPS input before routing.
Overview
The Nearest API snaps any coordinate to the closest point on the real road network and returns the matched location. It is the building block for cleaning user input before routing, validating pickup/drop-off points, and finding which road a coordinate belongs to. Fast and precise, it underpins reliable routing pipelines.
API reference
GET
/api/v1/osrm/nearest/v1/{profile}/{coordinates}| Parameter | Type | Status |
|---|---|---|
| profile | string | Required |
| coordinates | string | Required |
| number | integer | Optional |
Example request
Credit cost: 1 creditcurl "https://osrmroute.com/api/v1/osrm/nearest/v1/driving/49.8516,40.3777?number=3&key=YOUR_KEY"
Other services
Routing APIRoute Optimization APIGeocoding APIPlaces APIMatrix APIIsochrones APIMap Matching APITrip API (TSP)Location ClusteringDirections APIAlternative Routes APISnap to Road APIAutocomplete APIBatch Geocoding APITimezone APIElevation APIBoundary Lookup APIGeofencing APIElevation Profile APISolar APIGeometry Utilities APICoordinate Conversion APICountry Info API