---
title: "Snaps each location to the road graph (see module docs)."
method: POST
path: "/locate"
tags: ["routing"]
---

# Snaps each location to the road graph (see module docs).

`POST /locate`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/locate`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `api_key`

## Request body

- object

## Response `200`

One entry per input location: the closest edges (way id, correlated point, side of street, percent along) and, in `verbose` mode, nodes with a dense administrative/access/geometry attribute tree. A location with no nearby graph edges (open sea, an unmapped area) answers an entry with empty `edges`/`nodes` arrays, never an error

- object

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `429`: Quota or rate limit exceeded
- `501`: SN_ROUTING_ENGINE=graphhopper: GraphHopper has no locate service
- `502`: Upstream routing engine failed

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
