OSRM Routing API
router.project-osrm.org · Location
Open Source Routing Machine — fast routing over OpenStreetMap data. Supports car, bike, and foot profiles. Free, no API key, no rate limits on the demo server.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Get route
Get driving route between two NYC points.
https://router.project-osrm.org/route/v1/driving/-73.989,40.733;-73.962,40.756?steps=true&overview=full&geometries=geojson
Hover any highlighted part to learn what it does
curl -X GET "https://router.project-osrm.org/route/v1/driving/-73.989,40.733;-73.962,40.756?steps=true&overview=full&geometries=geojson"
import requests
params = {
"steps": "true",
"overview": "full",
"geometries": "geojson"
}
response = requests.get(
"https://router.project-osrm.org/route/v1/driving/-73.989,40.733;-73.962,40.756",
params=params,
)
print(response.json())const url = new URL('https://router.project-osrm.org/route/v1/driving/-73.989,40.733;-73.962,40.756');
url.searchParams.set('steps', 'true');
url.searchParams.set('overview', 'full');
url.searchParams.set('geometries', 'geojson');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://router.project-osrm.org/route/v1/driving/-73.989,40.733;-73.962,40.756")
q := baseURL.Query()
q.Set("steps", "true")
q.Set("overview", "full")
q.Set("geometries", "geojson")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://router.project-osrm.org/route/v1/driving/-73.989,40.733;-73.962,40.756")
uri.query = URI.encode_www_form({
"steps" => "true",
"overview" => "full",
"geometries" => "geojson"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://router.project-osrm.org/route/v1/driving/-73.989,40.733;-73.962,40.756?" . http_build_query([
"steps" => "true",
"overview" => "full",
"geometries" => "geojson"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed for demo server
- GET /route/v1/{profile}/{lon1,lat1};{lon2,lat2}
- Profiles: driving, cycling, foot
- Try: /route/v1/cycling/-0.127,51.507;-0.075,51.508?steps=true&geometries=geojson
- Self-host for production to avoid demo server limits
What can you build with OSRM Routing API?
OSRM Routing API is a Location API. Developers commonly use location APIs for:
- tracking assets and vehicles in real time
- building delivery and logistics apps
- finding nearby businesses or services
- geo-fencing and location-based notifications
- address validation and autocomplete
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. OSRM Routing API is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide