Get driving, walking, or cycling directions between two coordinates using OSRM. Returns distance, duration, turn-by-turn steps, and GeoJSON geometry.
Calculate routes and directions between two geographic coordinates using OSRM (Open Source Routing Machine), one of the fastest open-source routing engines. Supports driving, walking, and cycling modes. Returns distance in km, duration in minutes, turn-by-turn step instructions, and full GeoJSON geometry for map rendering.
| Param | Type | Required | Description |
|---|---|---|---|
from_lat | number | required | Origin latitude |
from_lng | number | required | Origin longitude |
to_lat | number | required | Destination latitude |
to_lng | number | required | Destination longitude |
mode | string | optional | driving (default), walking, or cycling |
$0.002 per request via x402 micropayment on Base (USDC). No subscription. No minimum.