A route between multiple locations in Belgium

Routing API

The Routing API calculates a route between two or more waypoints for cars, trucks, bicycles, walking, and transit. The Route object is returned with the route geometry in GeoJSON format. You also get Route Directions (or turn-by-turn instructions) and time/distance values for each route step.

The API can help you plan trips for vehicles and people, whether driving routes, traveling green electric vehicle routes, hiking on hiking trails, or finding the best way to deliver packages.

Live demo

Click on the map to set a starting point and destination points, choose the transportation mode - car, truck, bicycle, pedestrian, or transit:

Try out different options and travel modes with the Routing API Playground and get an API key and start using it now! We have a Freemium pricing model. Start now for Free and extend when you need it!

Features and options

Build routes according to your needs and preferences

Set route barriers

Skip gates, roads, and countries

The Routing API lets to set barriers that do not allow building a route through them. It can be specific locations (tunnels and bridges), roads, and whole countries.

Avoid tolls, ferries, highways

Avoid unwanted parts

Avoiding unwanted route parts such as toll roads, ferries, and highways is easy. The Routing algorithms will offer alternative routes when it's possible.

Road restrictions

Choose suitable roads

You can specify vehicle parameters to choose suitable roads. For example, provide the required height to avoid too low tunnels or passes.

Directions and stap-by-step instructions

Directions and instructions

The navigation instructions are provided within every route result. For example, “Drive west on Freisinger Straße/DAH 9” or “Enter the roundabout and take the 2nd exit”. The API supports instructions in English, German, Italian, Spanish, French, and other languages.

Route elevation profile

Elevation profile

Get a route elevation profile to determine how much elevation you'll gain on your route. This is great for bike and hiking routes.

In conjunction with route details that tell you the road class, a route's elevation helps determine its difficulty.

Works on every platform and with any programming language

Easy-to-use and permissive

The Routing API is accessible via HTTP GET requests and easy to integrate with any programming language. Moreover, it returns a GeoJSON object as a result.

Our Routing API is open-data-based. Therefore, you can store and redistribute the results!

Supported travel modes

ModeDescription
DriveA passenger car of a maximum weight of 3,5 tonnes and a maximum height of 1,6 metres
Light TruckA big passenger car, small delivery truck, camping car, or van maxing 3.5 tonnes and standing under 3.2 meters in height
Medium truckA medium-sized truck with a maximum weight of 7.5 tonnes and with a maximum height of 4 metres.
TruckA truck with a maximum weight of 22 tonnes and a maximum height of 4 metres
Heavy truckAn up to 40 tons weighed truck
Truck carrying dangerous goodsA truck carrying dangerous goods with a maximum weight of 22 tonnes and a maximum height of 4 metres
Long truckA long truck, with a length of up to 34 meters
BusThe vehicles that are permitted to drive on lanes and roads with Bus only access
ScooterMotor scooters, moped
MotorcycleA motorcycle. Middle-class and upper-class roads are preferred
BicycleA city bicycle, built for city riding on roads and paths with good surfaces
Mountain bicycleA mountain bike, built for off-road use but slower on roads
Road bicycleA road bike is a bicycle with narrow tires and lightweight construction
WalkA pedestrian mode with a pedestrian speed of 5 km/hour
HikeIn addition to the pedestrian mode, a hiking mode uses hiking trails and higher-difficulty trails
TransitRoutes for transit or public transport

Didn't find the more for your business task? Contact us and we offer a solution for you!

Find optimal routes

Need to find an optimal route between multiple locations?

Then the Route Planner API is what you are looking for! The API returns optimal routes between up to 1000 waypoints for multiple vehicles or agents.

You can combine the Route Planner API with the Routing API to find the best routes between locations. The Route Planner API solves a vehicle routing problem (VRP) and provides the optimal route for your stops, and the Routing API returns routes between waypoints in a pre-defined order.

Routing API pricing

How much does the Routing API cost?

Our platform is based on open data. As a result, we offer Affordable Prices for businesses of all sizes.

We use a system of credits to determine the price. For example, the Free plan includes up to 3000 credits/day. Therefore, each API call costs a certain number of credits:

  • Each pair of waypoints costs at 1 credit.
  • Additional credit is given for every 500 kilometers of result route length if the route length is more than 500 kilometers.

You can use the Pricing Calculator to estimate how many credits you need. For example, the route on the picture costs 4 units of credit.

Getting started

Works via HTTP and returns a GeoJSON object

Step 1. Register and get an API Key

You will require an API Key to use the API. Register on Geoapify MyProjects and get an API key.

Step 2. Generate and call HTTP Get request

Generate an HTTP Get request with input data and make the call. Use our Playground and Documentation to learn about Routing API request/response structure.

Here's an example of a Routing API URL that calculates a route between 5 waypoints for bicycle:

https://api.geoapify.com/v1/routing?waypoints=47.569664,10.7021002|47.575734,10.720492|47.567089,10.733584|47.557827,10.749579|47.544780,10.722865&mode=bicycle&apiKey=YOUR_API_KEY

Here is the response object returned by the API call:

    • [] 1 item
      • {} 3 keys
        • "Feature"
        • {} 5 keys
          • {} 2 keys
        • {} 2 keys
          • "bicycle"
          • [] 5 items
          • "FeatureCollection"

        The response has one feature of MultiLineString. The feature properties contain waypoints and route legs. Each route leg includes time/distance information and Directions instructions.

        The code samples below show you how to make an API call with different programming languages:

        
        fetch('https://api.geoapify.com/v1/routing?waypoints=48.184731,11.547931|48.168254,11.581501|48.179391,11.612174&mode=drive&apiKey=YOUR_API_KEY')
        .then(resp => resp.json())
        .then((calculatedRouteGeoJSON) => {
        	console.log(calculatedRouteGeoJSON);
        });
        

        Routing API tutorials

        Check out our code samples to make the integration simple

        Visualize a route on a MapLibre GL (Mapbox GL) map

        How to draw routes on a Maplibre GL (Mapbox GL) map

        The Tutorial shows how to draw routes created by the Routing API on a MapLibre GL (Mapbox GL) map. Check our Live-Demo on JSFiddle.
        Grand Loop Road, Yellowstone National Park elevation profile

        Drawing Route Elevation Profile with Chart.js

        Route Elevation Profile tutorial shows how to draw road elevations on a chart with Chart.js library. JSFiddle code sample will help you start quickly.
        Build routes and directions with WordPress website

        How To Add Driving Directions to a Wordpress Website

        This tutorial shows how to integrate Route Directions (driving, walking, biking) into a WordPress or other CMS-based website.

        Still not sure how to start? If you’re facing any problems or have questions, we’re here to help! Contact us and we will be happy to assist.

        FAQ

        How do you bill Routing API Requests?

        A route between every pair of waypoints is counted as a credit. Learn more about the API pricing on the API Documentation page.

        How is a 'Truck' mode is different from a 'Drive' mode?

        The 'Truck' mode takes into account road restrictions for trucks, avoids thin roads and residential areas, prefers routes with fewer maneuvers.

        I need to build routes for heavy transport. Can your API do that?

        The Geoapify Routing API have a very flexible and powerful engine under the hood. Contact us and we will create a model that solves your business case.

        How good is coverage for public transport?

        We use official GTFS feeds when they are available and approximated model for other places. This let us to provide worldwide coverage for public transport. Contact us!

        Can we use custom GTFS feeds with your Routing API?

        Sure! We can setup a dedicated server for you that builds routes with your GTFS feeds.

        Can you provide custom conditions for high volumes?

        Yes! Contact us and we will find conditions beneficial for both sides!

        World map

        Need to calculate routes?

        Get an API key and start using Geoapify Routing API!