POST

Compute a route between two coordinates with distance, duration, and geometry (driving, cycling, or walking). Powered by OSRM

/v1/maps/route

Powered by OpenStreetMap

Request → Response

Examples from schemas.json.

Requestapplication/json
POST /v1/maps/route
Content-Type: application/json

{
  "from": {
    "lat": 0,
    "lon": 0
  },
  "to": {
    "lat": 0,
    "lon": 0
  },
  "profile": "driving",
  "overview": "simplified"
}
Responseapplication/json
HTTP/1.1 200 OK
Content-Type: application/json

// Endpoint-specific body after 402 settlement

Overview

Compute a route between two coordinates with distance, duration, and geometry (driving, cycling, or walking). Powered by OSRM.

Collaborative open geographic database powering Nominatim geocoding.

Request schema

Body: JSON · application/json

FieldTypeDescription
fromobjectrequired
toobjectrequired
profilestringrequiredenum: driving, cycling, walking
overviewstringrequiredenum: full, simplified, false
IMPLEMENTATION
curl -X POST https://api.tools402.dev/v1/maps/route \
  -H "Content-Type: application/json" \
  -d '{
  "from": {
    "lat": 0,
    "lon": 0
  },
  "to": {
    "lat": 0,
    "lon": 0
  },
  "profile": "driving",
  "overview": "simplified"
}'

402 payment flow omitted — see Integrations for settlement.