GET /v1/nearest

Snap to Roads API for the nearest drivable road

Send a coordinate, get the nearest point on the drivable road network, the road name when available, and how far the original point was from the road.

Request and response

Copy, paste and run with your test key. The response below is an illustrative example.
curl "https://api.wayline.cloud/v1/nearest?point=37.7694,-122.4862" \
  -H "Authorization: Bearer $WAYLINE_API_KEY"
Response (example)
{
  "request_id": "req_01JD8Q8K5Y2D",
  "waypoints": [
    {
      "location": [
        37.770599999999995,
        -122.4871
      ],
      "name": "",
      "distance_meters": 38
    }
  ],
  "region": "us",
  "map_version": "20261121-2330",
  "units_charged": 1
}

What the Snap to Roads API gives you

  • Up to five candidates

    Use count to return several nearby road points, ranked by distance.

  • Distance to road

    distance_meters tells you how far the input was from the road — a great signal for GPS quality.

  • Road names

    When OpenStreetMap has a name for the segment, it is returned with the snapped point.

  • One unit per request

    Simple, predictable pricing for high-volume cleanup jobs.

Common uses

Validate pickup pins before dispatch, move parcel lockers or delivery points onto the street network, and flag check-ins that were recorded far from any road.

Frequently asked questions

Is the distance a straight line or a real road distance?

Always real road distance. Every result is computed along the OpenStreetMap road network with a driving profile, never as a straight-line (haversine) estimate.

Which areas do you cover?

Coverage is region-based. The Coverage page lists every enabled region with its map data date. Points outside an enabled region return an OUT_OF_COVERAGE error and are never billed.

Does this snap a whole GPS trace?

Not today. The endpoint snaps individual points. Full trace map-matching is on the roadmap.

Start building in minutes

Create an account, grab a test key and make your first request in under five minutes.