POST
/v4/snap.jsonSnap to Roads API
Snap GPS coordinates to the nearest road. Useful for cleaning noisy GPS traces from vehicles and creating smooth route paths.
Try in Playground →Authentication
Include your API token in the request header:
X-Authorization-Token: your_token_here
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| coordinates | array | Required | Array of [longitude, latitude] pairs |
Code Examples
curl -X POST "https://apihub.latlong.ai/v4/snap.json" \
-H "X-Authorization-Token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"coordinates": [
[
77.59,
12.97
],
[
77.6,
12.98
]
]
}'Response
JSON200 OK
{
"status": "success",
"code": 1001,
"data": {
"snapped_coordinates": [
[77.5902, 12.9701],
[77.6001, 12.9798],
[77.6103, 12.9902]
]
}
}Ready to try it?
Test this API interactively in the playground.

