Routing API

Routes from A to B.

Find the way between two or more places on foot, by bike or by car. Each route comes with its distance, travel time, climbs and turn-by-turn directions, ready to show on your map.

Salzburg main stationHellbrunn Palace1 h 24 min30 min9 min30 min8.1 km, 86 m up
What a route includes

More than a line on the map.

The API works out the way along real streets, paths and trails, and returns everything a traveller needs to know about it:

Turn right onto Richard-Mayr-GasseTurn left onto DreifaltigkeitsgasseKeep left onto Steingasse

Directions and street names

Every turn as a short instruction with the street name, in the language of your choice.

4 stops, 55.8 km, 54 min

Several stops on the way

Add as many stops as you need. The route visits them in the order you give, here four lakeside towns in one drive.

358 m up, 63 m down, 6.6 km

Climbs along the way

Each route says how many metres go up and down, so a bike ride up to Igls shows its 358 m of climbing before you set off.

Live demo

On foot, by bike or by car.

The route from the top of the page, live. Drag A or B, or switch how you travel, and the route follows the right network.

Walking: streets, footpaths and mountain trails

Cycling: follows cycle routes by default

Driving: cars and vans on the road network

For developers

Send the stops, get the route.

Send the stops and the way of travel. You get back the line, distance, time, climbs and directions. The Map Matching API answers in the same format.

The bike route at the top of the page
const url = new URL("https://routing.maptoolkit.net/route");
url.searchParams.append("point", "47.8128,13.0456");
url.searchParams.append("point", "47.7626,13.0607");
url.searchParams.append("routeType", "bike");
url.searchParams.append("api_key", "YOUR_API_KEY");
const route = (await (await fetch(url)).json()).paths[0];

The result is the dark blue route in the hero: 8.1 km, 30 min.

Two or more stops

Add the stops in the order they should be visited (point).

Many stops via POST

Long lists of stops go in the request body instead of the web address.

JSON, GPX or KML

Get the route as JSON for your map, or as a GPX or KML file to download (format).

Directions in your language

Choose the language of the directions and add voice text if you need it (language, voice_instructions).

Any map library

Draw the line with MapLibre, Leaflet or any other library. The docs have working examples.

API key in the web address

Add your key to every request (api_key).

Questions and answers

Questions about routing.

Short answers on route formats, bike routes and billing.

Can I get the route as GeoJSON?

Yes. By default the route comes back as an encoded line, which keeps the response small. Add points_encoded=false and you get a GeoJSON line instead, which MapLibre and Leaflet can draw directly. Keep in mind that GeoJSON lists longitude first, while the points you send to the API are latitude first.

Can cyclists choose between the fastest, the shortest and the most bike-friendly route?

Yes. By default, bike routes follow recommended cycle routes. You can switch to the fastest or the shortest route instead, depending on what your users care about. Every route reports how many meters go up and down, so you can also compare the options by effort.

How are routing requests counted and billed?

Every route counts as one request toward the monthly quota of your plan; there is no per-second limit. On the free Basic plan, requests stop once the quota is used up. On Pro and Ultra, requests beyond the allowance are billed. Enterprise plans have no request limit.

See your use case on a Maptoolkit map.

In the demo, one of our engineers walks you through the platform, your data and the move from your current provider.