OSRMRoute
PROFESSIONAL DEVELOPER PLATFORM

Built by developers, for developers

Add enterprise-grade routing to your apps via a REST API. Get started right away with clear documentation, ready-made code samples and the high-performance OSRM engine.

API Suite: Performance and Scalable Power

Our geospatial engine is optimized to handle high loads and compute the most optimal result in milliseconds.

Routing API

Battle-tested

From point A to point B: industry-grade routing for different transport modes. Turn instructions, elevation profiles and accurate arrival times (ETA) — all within a single API.

Route Optimization API

Premium

Handle complex logistics and turn your fleet's toughest routing tasks into efficient delivery plans. Work with time windows, driver skills and custom vehicle constraints.

Geocoding API

High Accuracy

Connect place with logic: convert addresses to coordinates and coordinates to precise real addresses. High-performance geocoding and reverse geocoding for enterprise-grade applications.

Matrix API

Ultra Fast

Fast distance computation at scale: instantly compute the time and distance matrix between hundreds of points at once. Speed up your optimization algorithms based on real road networks.

Isochrones API

Visual Analytics

Analyze travel time with reachability maps. Generate custom coverage polygons for any point, tailored to transport mode and road preferences.

Map Matching API

GPS Cleanup

Snap noisy GPS signals to the real road network. Turn scattered tracking coordinates into clean, accurate and logical route data.

Places API

New

Find points of interest near any location — cafes, shops, hotels, ATMs, pharmacies and more — filtered by category and radius, sorted by distance.

Nearest API

Snap to Road

Snap any coordinate to the closest point on the real road network. Essential for cleaning GPS input before routing.

Trip API (TSP)

Round Trips

Solve the travelling-salesman problem: order a set of stops into the shortest round trip. Ideal for delivery loops and multi-stop errands.

Location Clustering

Grouping

Group large sets of locations into balanced clusters by proximity — perfect for splitting deliveries across drivers or defining service zones.

Directions API

Navigation

Turn-by-turn navigation with a clean, easy-to-render instruction list for car, bike and foot.

Alternative Routes API

Routing

Get several distinct route options in a single request so users can pick their preferred path.

Snap to Road API

GPS

Snap noisy GPS coordinates onto the nearest point of the real road network.

Autocomplete API

Type-ahead

Fast, typo-tolerant place suggestions as the user types, with optional location bias.

Batch Geocoding API

Bulk

Geocode hundreds of addresses in a single request — ideal for data pipelines and imports.

Timezone API

Global

Get the IANA time zone, current UTC offset, DST status and local time for any coordinate on Earth.

Elevation API

Global

Height above sea level, in metres, for any coordinate — one point or a whole route profile.

Boundary Lookup API

Global

Find which country, state, city and district a coordinate falls in — with the boundary polygon on request.

Geofencing API

Real-time

Test in one call which of your zones each point falls inside — polygon or circular fences.

Elevation Profile API

Global

Elevation at every point of a path plus total ascent, descent and distance — a full route profile.

Solar API

Global

Sunrise, sunset, twilight, solar noon and day length for any coordinate and date.

Geometry Utilities API

Toolkit

Distance, bearing, area, centroid, simplification and polyline encode/decode — spatial math as a service.

Coordinate Conversion API

Global

Convert latitude/longitude to and from UTM and MGRS grid references.

Country Info API

Global

Currency, calling code, languages, capital and flag for any country by ISO code or name.

Official SDKs

Zero dependencies, fully typed, every endpoint covered. Make your first call in under a minute.

Install
npm install osrmroute
import { OSRMRoute } from 'osrmroute';

const maps = new OSRMRoute({ apiKey: process.env.OSRMROUTE_API_KEY });

// Coordinates are [lat, lon] everywhere — no lon/lat mix-ups.
const res = await maps.route([
  [40.4093, 49.8671],
  [40.3777, 49.8920],
]);

const route = res.routes[0];
console.log(`${(route.distance / 1000).toFixed(1)} km`);

// Address search, matrix, isochrones, fleet optimisation…
const hits = await maps.geocode('Nizami küçəsi, Bakı');
const grid = await maps.matrix([[40.40, 49.86], [40.37, 49.89]]);
  • Zero dependencies — nothing to conflict with your existing HTTP stack.
  • Fully typed, with all 23 endpoints covered.
  • Takes [lat, lon] everywhere and flips it internally, so routes never land in the ocean.

Developer Resources and Tools

Get the job done fast with tools that make setup easy.

Technical Docs

Documentation covering every API detail, from getting-started guides to complex routing scenarios.

API Explorer

Send API requests and see the results instantly, both as code and on an interactive map. The fastest testing tool.

SDKs & Libraries

Use our official JavaScript, Python and Java SDK libraries to speed up your integration.

Why OSRMRoute?

Our geospatial routing infrastructure is specifically tuned to solve the toughest logistics and courier problems fast.

Millisecond-Level Latency

Routes are computed instantly via OSRM's internal optimized C++ engine.

99.9% Uptime Guarantee

Our high-availability clusters are ready to answer your requests at any moment.

Regional Coverage Across 26 Countries

All internal roads, speed limits and geographic features across 26 countries in the Caucasus, Central Asia, Türkiye, Iran and the Middle East are updated every day.

routing-request.sh
# 1. Send a route request with your API key
curl -X GET "https://osrmroute.com/api/v1/route/driving/\
49.8671,40.4093;49.8550,40.4150?overview=full&key=YOUR_API_KEY"

# 2. Fast JSON response returned from the server
{
  "code": "Ok",
  "routes": [{
    "geometry": {
      "coordinates": [[49.8671, 40.4093], ...],
      "type": "LineString"
    },
    "distance": 3254.2,
    "duration": 245.8
  }]
}