Routing APIs

Blazing fast routing
Global coverage

The Maptoolkit Routing APIs offer robust functionality, including A to B routing, Map Matching, and isochrone calculations for various transportation modes (car, bike, and foot), with customizable weighting options.

Car routing API

Identify the shortest and most efficient paths for cars globally.

Bicylce routing API

Select from profiles for bike infrastructure, shortest, or fastest routes.
Achieve world-class routing results with integrated elevation and route popularity metrics.

Walking and hiking

Discover the most optimal paths favored by locals.

Our Routing APIs are available with request-based pricing on the RapidAPI marketplace and as part of Maptoolkit Enterprise. For more details, see Maptoolkit Pricing.

You might also be interested in:

Example …

Routing with MapLibreGL map

<html>
<head>
  <meta charset="UTF-8" />
  <link rel="stylesheet" href="https://static.maptoolkit.net/css/maplibre-gl.css" />
  <style>
    body { width: 100%; height: 100%; padding: 0; margin: 0; font-family: Arial, sans-serif; }
    #map { width: 100%; height: 100%; }
  </style>
</head>
<body>
  <div id="map"></div>
  <script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/mapbox-polyline/1.1.1/polyline.min.js"></script>
  <script>
    // Initialize MapLibreGL map
    let map = new maplibregl.Map({
      container: "map",
      style: "https://static.maptoolkit.net/styles/toursprung/terrain.json?api_key=your_api_key",
      center: [11.413507, 47.270537],
      zoom: 13,
    });
    map.on("load", () => {
      // Get route from Routing API
      let start = [11.393712, 47.259938],
        end = [11.430896, 47.28187];
      let url = new URL("https://routing.maptoolkit.net/route");
      url.searchParams.append("point", `${start[1]},${start[0]}`);
      url.searchParams.append("point", `${end[1]},${end[0]}`);
      url.searchParams.append("routeType", "car");
      url.searchParams.append("api_key", "your_api_key");
      fetch(url)
        .then((r) => r.json())
        .then((route) => {
          let path = route.paths[0];
          // Add route polyline to map
          let coordinates = polyline.decode(path.points).map(c => c.reverse());
          console.log(coordinates);
          map.addLayer({
            id: "route",
            type: "line",
            source: {
              type: "geojson",
              data: {
                type: "Feature",
                geometry: {
                  type: "LineString",
                  coordinates: coordinates,
                },
              },
            },
            layout: {
              "line-join": "round",
              "line-cap": "round",
            },
            paint: {
              "line-color": "#2a3561",
              "line-width": 5,
            },
          });
          // Add instruction markers with popup to map
          path.instructions.forEach((instruction) => {
            let $img = document.createElement("img");
            $img.src = "https://static.maptoolkit.net/sprites/toursprung/route-via.svg";
            $img.width = 12;
            $img.height = 12;
            $img.style["cursor"] = "pointer";
            new maplibregl.Marker({
              element: $img,
              anchor: "center",
            })
              .setLngLat(instruction.coordinate.reverse())
              .addTo(map)
              .setPopup(new maplibregl.Popup().setHTML(`<p>${instruction.text}</p>`));
          });
          // Add route end marker
          let $img = document.createElement("img");
          $img.src = "https://static.maptoolkit.net/sprites/toursprung/marker.svg";
          $img.width = 29;
          $img.height = 30;
          let marker = new maplibregl.Marker({
            element: $img,
            anchor: "bottom",
          })
            .setLngLat(coordinates[coordinates.length - 1])
            .addTo(map);
        });
    });
  </script>
</body>
</html>

Routing Enhancement API


Want to get a routing result but force the routing onto a predefined route, like a touristic cycleway? The Routing Enhancement API for the rescue. You input the API with a addresses (like you would do with a normal Routing API) plus a specific route (GPX or GeoJSON). The Enhancement API doesn’t necessarily force the result to use the entire route but a smart, short way to and from a segment of it, just as humans would do.

Our Pricing Model

Flexible pricing that scales with you.
Start with our free tier, pay per request on RapidAPI as you grow, or choose an Enterprise license for full access.

FAQ

Yes, the result of the routing (polyline) can be drawn in any map library, such as Leaflet and MapLibre.

Yes, you can.

Yes. You can define custom rules for your routing if needed.

In short: yes.

This is a user interface topic and a combination of the Routing API with the Geocoding API. The Routing API takes coordinates as input and calculates the route between those coordinates to transform your POI data into coordinates, you need the Geocoding API.

Yes. The result of the Routing API also contains turn instructions.

Length of the route, estimated travel time, ascent and descent.

Not directly, but you can pass the polyline to the Elevation API and get an elevation profile.

You can export the route as a GPX, KML, or GeoJSON.

We’re here to help


Mobile +43 664 1308111 [email protected]