Skip to main content

Nearest API

Snaps a single coordinate to the road network and returns the nearest n 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 nearest first — a large distance means the coordinate is far from any road
  • Speed up hot paths: cache the hint and reuse it in subsequent route/table requests