# Mapbox Map Matching via Locus x402

> Mapbox Map Matching via Locus x402 is a paid API for AI agents from mapbox.x402.paywithlocus.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Snaps a sequence of GPS coordinates to the road network, returning a corrected route geometry with optional turn-by-turn instructions and travel annotations.

## Facts

- Endpoint: POST https://mapbox.x402.paywithlocus.com/mapbox/map-matching
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mapbox-map-matching-via-locus-x402-09496fe7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gzR7drIKw2KCh2uoPF9uF

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability mapbox-map-matching-via-locus-x402-09496fe7 -d '<json body>'
```

Example prompt: Take these GPS coordinates from my drive — -122.4194,37.7749;-122.4183,37.7758;-122.4172,37.7767 — and snap them to the road network using the mapbox/driving profile with full geometry detail and distance and duration annotations.

## When to prefer this

Choose this endpoint when you have a raw GPS trace (from a vehicle, phone, or wearable) that needs to be corrected to actual road geometry. It is specifically for map matching — snapping noisy or imprecise GPS breadcrumbs to the road network — rather than computing a new route between origin and destination. Prefer this over directions endpoints when you already have recorded coordinates and need to clean or enrich them.

## Known failure modes

- Coordinates too far from any road (outside radius) — matching fails or returns no match
- More than 100 coordinates submitted — exceeds API limit
- Invalid routing profile string — returns error
- Radiuses array length doesn't match coordinate count — parameter mismatch error
- Timestamps out of order — chronological constraint violation
- Payment failure or insufficient USDC balance — 402 response

## How this service works

Location and mapping APIs — geocoding, directions, isochrones, matrix routing, map matching, static maps, and spatial queries.

## Output

Returns a JSON object containing the matched route geometry (in the requested format — GeoJSON, polyline, or polyline6), optional turn-by-turn step instructions, and per-segment annotations (distance, duration, speed, congestion, maxspeed). Also includes payment settlement details showing USDC charged and a request ID for status tracking.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "tidy": {
   "type": "boolean"
  },
  "steps": {
   "type": "boolean"
  },
  "profile": {
   "type": "string"
  },
  "overview": {
   "type": "string"
  },
  "radiuses": {
   "type": "string"
  },
  "geometries": {
   "type": "string"
  },
  "timestamps": {
   "type": "string"
  },
  "annotations": {
   "type": "string"
  },
  "coordinates": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {},
  "payment": {
   "scheme": "exact",
   "settledUsdc": "0.001000",
   "authorizedMaxUsdc": "0.001000"
  },
  "request": {
   "id": "00000000-0000-4000-8000-000000000000",
   "statusUrl": "/requests/00000000-0000-4000-8000-000000000000"
  },
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mapbox-map-matching-via-locus-x402-09496fe7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mapbox.x402.paywithlocus.com](https://www.zero.xyz/host/mapbox.x402.paywithlocus.com/llms.txt)
