Openrouteservice: Free Open Source Geo-services API

Openrouteservice: Free Open Source Geo-services API

When building applications that involve maps, geolocation, or routing, developers often rely on commercial APIs like Google Maps or Mapbox. However, these services usually come with rate limits and pricing plans that can scale quickly. If you're looking for a powerful and free open-source alternative, look no further than Openrouteservice.

Powered by OpenStreetMap data and developed by Heidelberg University's GIScience Research Group, Openrouteservice (ORS) offers a full suite of APIs to handle routing, geocoding, isochrones, elevation data, and more. It’s designed for both researchers and developers, with an emphasis on flexibility and open data.

Let’s explore what it offers and how you can use it in your web projects.

Watch our platform overview on our YouTube channel

Direction Route

At the core of Openrouteservice is its routing engine, which supports multiple transport profiles like car, bike, pedestrian, wheelchair, and heavy vehicles.

To get a route between two locations, you simply send a request to the /v2/directions/{profile} endpoint with coordinates. You can define:

  • The transport mode (e.g., driving-car, cycling-regular)
  • The route preference (e.g., fastest, shortest)
  • Optional waypoints, round trips, or custom avoid polygons (e.g., block highways)

The response includes:

  • Geometry (polyline or GeoJSON)
  • Distance & duration
  • Step-by-step turn instructions

Leaflet Map Integration

ORS works seamlessly with Leaflet, the popular open-source mapping library.

To display a route:

  1. Use Leaflet to create your map.
  2. Send a routing request to ORS.
  3. Parse the GeoJSON or encoded polyline.
  4. Display it as a L.polyline on the map.

There are also third-party plugins and examples provided by the community that can speed up your integration process, such as lrm-openrouteservice.

With Leaflet and ORS, you can build fully custom route planners with minimal effort and no vendor lock-in.


Search Places and Autocomplete

Openrouteservice provides geocoding and autocomplete powered by Pelias, an open-source geocoder.

Endpoints:

  • /geocode/search – Full-text search for places
  • /geocode/autocomplete – Predictive typing results

You can search by:

  • City name
  • Address
  • Points of interest
  • Admin boundaries

These endpoints are particularly useful for forms, map click-to-search features, and user-friendly interfaces.


Route Planner Parameters

The routing API is highly configurable. You can control:

  • Avoid features: Highways, toll roads, ferries
  • Traffic considerations: Real-time or historical (in commercial or hybrid versions)
  • Custom weightings: Prioritize smoother paths, limit elevation gain
  • Vehicle types: Define dimensions, weight, hazardous goods for truck routes

This level of customization is extremely helpful for apps targeting logistics, accessibility, or specific transport scenarios.


Swagger Doc

Openrouteservice provides an interactive Swagger UI for testing and documentation.

You can explore all endpoints, send live requests, and see detailed parameter explanations. This is invaluable for developers getting started or debugging API calls.


Isochrone, Elevation

Two standout features of ORS are:

  • Isochrones: Generate areas reachable within a time or distance from a point. Useful for delivery zones, urban planning, and accessibility analysis.
    • Endpoint: /v2/isochrones/{profile}
  • Elevation: Query the elevation for any point or along a path.
    • Endpoints:
      • /elevation/point
      • /elevation/line

These services make ORS more than just a routing engine—it becomes a powerful geospatial toolkit.


Optimization Service

ORS includes a vehicle routing optimization (VROOM) service.

It solves the Traveling Salesman Problem (TSP) and Vehicle Routing Problem (VRP) using the /optimization endpoint. It supports:

  • Multiple vehicles
  • Delivery/pickup constraints
  • Time windows
  • Job priorities

Great for delivery companies, dispatch systems, or logistics apps that need to optimize route efficiency and reduce costs.


Conclusion

Openrouteservice is a full-featured, open-source alternative to commercial geoservices. Whether you're building a delivery app, a hiking trail planner, or a smart city dashboard, ORS provides powerful tools without licensing headaches.

🌍 Based on open data
🔧 Easy to integrate
🛠️ Actively maintained
💸 Free to self-host or use the public instance (with fair usage limits)

Give a try to Openrouteservice and start building location-aware apps with freedom and flexibility.