openrouteservice.org API

⭐ Beginner's Pick Geocoding / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

openrouteservice is a free, open-source routing API powered by OpenStreetMap data that provides directions, travel time, and distance for multiple transport modes including car, bike, and walking. It also offers isochrones (reachability areas), geocoding, elevation data, and points of interest search. It is a powerful all-in-one geographic services API for apps that need routing without expensive licensing.

💡

Beginner Tip

Get your free API key at https://openrouteservice.org/dev/#/signup — the free tier allows 500 daily requests per service. Start with the /directions endpoint for routing and always specify coordinates as [longitude, latitude] order (not lat, lon).

Available Data

IP address details
latitude and longitude
city and country
timezone
ISP information

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from openrouteservice.org",
    "description": "Directions, POIs, isochrones, geocoding (+reverse), elevation, and more",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

routes Array of route objects; typically contains one best route
routes[].summary.distance Total route distance in meters
routes[].summary.duration Estimated travel time in seconds
routes[].segments Array of route segments with turn-by-turn step instructions
routes[].geometry Encoded polyline string representing the route path on a map
metadata.attribution Required attribution text to display when showing routes in your app

Implementation Example

const url = "https://openrouteservice.org/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

403 Forbidden API key is missing or invalid
Pass your API key in the Authorization header (not as a query param); get a free key at openrouteservice.org/dev
Could not find point within threshold One of your coordinates is not near a routable road
Ensure coordinates are on or very near a road; avoid placing points in the middle of buildings or bodies of water
Coordinates in wrong order openrouteservice uses [longitude, latitude] not the usual lat/lon order
Swap your coordinates: the format is [lon, lat], e.g., [8.6814, 49.4146] for Heidelberg, Germany

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Geocoding
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →