Nearest API
Snaps a single coordinate to the road network and returns the nearestn segments. Useful for validating whether a coordinate is routable, getting the exact snapped position, and obtaining hint values that speed up subsequent requests.
Powered by the OSRM Nearest service.
Endpoint
Request Parameters
Quickstart
Response
response-example.json
Response fields
Typical uses
- Coordinate cleanup: validate with
nearestfirst — a largedistancemeans the coordinate is far from any road - Speed up hot paths: cache the
hintand reuse it in subsequentroute/tablerequests
