---
title: "Snap points to the road network"
method: POST
path: "/snap"
tags: ["navigation"]
---

# Snap points to the road network

`POST /snap`

## Request

- Base URL: `https://api.mapsource.io`
- URL: `https://api.mapsource.io/snap`
- Auth: HTTP bearer

Returns the nearest road-network position for each coordinate, including way ID, street name, and side of street.

When to use: Associate coordinates with road segments before routing or analysis.

## Request body

- object
  - `locations` unknown[], required: Points to snap.
    - unknown
  - `costing` string: Travel mode.

## Response `200`

Snap points to the road network

- object
  - `schema` string
  - `profile` string: The costing model that produced this result.
  - `units` object
    - `distance` string
    - `duration` string
  - `graph` object
    - `engine` string
    - `tilesetBuiltAt` string, nullable
  - `geometryAvailable` 'inline' | 'handle': Where the geometry is. handle means read geometryRef.
  - `meta` object
    - `requestId` string
    - `computeMs` integer
    - `requestedAt` string, date-time
    - `sources` object[]
      - `dataset` string
      - `observedAt` string, nullable
      - `license` string
    - `freshness` object, nullable
    - `licenses` string[]
    - `attribution` string[]
  - `costing` string
  - `locations` unknown[]: Input coordinate, snapped position, OSM way, side of street, and offsetMeters for each point.
    - unknown

## Other responses

- `400`: Error with a stable machine code.
- `401`: Error with a stable machine code.
- `429`: Error with a stable machine code.
- `500`: Error with a stable machine code.

---

[API](https://skmtc.dev/mapsource/apis/mapsource-overpass-api.md) · [All operations](https://skmtc.dev/mapsource/apis/mapsource-overpass-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mapsource/apis/mapsource-overpass-api/revisions/8af8c2769e7b?raw)
