Skip to content
Routing API

Routing API

The Routing API calculates routes between two or more points. It supports car, bike, foot, and public transit, and returns turn-by-turn directions in JSON, GPX, or KML format.

Base URL

https://routing.maptoolkit.net/route

Authentication

Add your API key as ?api_key=YOUR_API_KEY to every request. See Authentication for details.

Parameters

ParameterTypeRequiredDescription
pointlat,lngYes (min. 2)A waypoint. Add this parameter multiple times to define the route. Order matters.
routeTypestringYesVehicle type: car, bike, foot, or transit. Transit is currently available only in NRW, Germany.
languagestringNoLanguage for turn instructions, as an ISO 639-1 code (e.g., en, de).
weightingstringNoBike only. Route optimization: networks (default), shortest, or fastest.
voice_instructions0 or 1NoAdds voice instruction text to each turn. Default: 0.
finish_instruction0 or 1NoAdds a finish instruction at the end of the route. Default: 0.
formatstringNoResponse format: json (default), gpx, or kml.
departuredate stringNoDeparture time for transit routing.
callbackstringNoWraps the response in a JSONP callback function.

Response

GET https://routing.maptoolkit.net/route?point=48.202596,16.369801&point=48.208373,16.370401&routeType=car&language=en&api_key=YOUR_API_KEY

This is a response to the HTTP GET request shown above:

{
  "info": {
    "copyrights": [
      "GraphHopper",
      "OpenStreetMap contributors"
    ],
    "took": 1,
    "road_data_timestamp": "2025-11-17T01:00:01Z"
  },
  "paths": [
    {
      "distance": 769.952,
      "weight": 168.289829,
      "time": 98995,
      "points_encoded": true,
      "bbox": [
        16.36885,
        48.202589,
        16.37053,
        48.20802
      ],
      "points": "eqeeHmf|bByD_BMCIVg@pDO`@Oj@INQ?a@OKMGIIMwAkAOC{@u@UYi@}@QU[SWIIASAG@GBIJQl@IH]nAIZy@m@uAw@k@YgBu@",
      "instructions": [
        {
          "distance": 117.483,
          "sign": 0,
          "interval": [
            0,
            2
          ],
          "text": "Continue onto Kärntner Straße",
          "time": 15105,
          "name": "Kärntner Straße",
          "distance_feet": 385,
          "distance_miles": 0.073000529193,
          "coordinate": [
            48.202589,
            16.369828
          ],
          "pushbike": false,
          "tags": {
            "highway": "street",
            "surface": "asphalt"
          },
          "speed": 27.999920556107252,
          "annotations": []
        },
        ...
      ],
      "ascend": 15.5657958984375,
      "descend": 6.759765625,
      "snapped_waypoints": "mf|bBeqeeHkC}`@",
      "ascend_feet": 51,
      "descend_feet": 22,
      "distance_feet": 2526,
      "distance_miles": 0.47842584419199996
    }
  ]
}

Response Fields

FieldDescription
paths[0].distanceTotal route distance in meters
paths[0].timeTotal route time in milliseconds
paths[0].pointsEncoded polyline of the full route
paths[0].bboxBounding box: [minLon, minLat, maxLon, maxLat]
paths[0].instructions[].textTurn instruction text
paths[0].instructions[].distanceDistance for this step in meters
paths[0].instructions[].timeDuration for this step in milliseconds
paths[0].instructions[].signTurn direction code (see table below)
paths[0].tags.highwayRoad type for this step
paths[0].tags.surfaceSurface type for this step

Turn direction codes (sign)

ValueMeaning
-3Sharp left
-2Left
-1Slight left
0Continue straight
1Slight right
2Right
3Sharp right
4Finish
5Via point reached
6Roundabout

Highway types

motorway, primary, road, street, pedestrian, cycleway, path, hiking, mountain_hiking, other

Surface types

asphalt, paved, unpaved, natural, alpine, other

Examples

Working examples for this API, each with copyable source:

Errors

Errors return the HTTP status code with a plain-text message in the body.

StatusMeaning
403The API key is missing (Access denied!) or not recognized (Api-key not found!). See First Steps.
400The request is malformed, or the routing engine rejected it.

Common 400 messages

MessageCause
There is exactly on start and one endpoint allowed!Transit routing requires exactly two waypoints.
Cannot parse departure time!departure is not a valid date string.
Cannot handle request: {message}The transit routing engine returned an error.
cannot parse custom_model: {message}custom_model is not valid JSON.

Errors from the upstream routing engine are forwarded as-is, so you may see messages that are not in this table.

Rate limits

Limits are monthly request quotas tied to your plan rather than a per-second rate: the service returns no RateLimit-* or Retry-After headers. Current allowances are on the pricing page.

The free Basic plan has a hard limit, so requests are refused once it is reached. On Pro and Ultra, requests past the allowance are billed rather than refused. Enterprise plans use a flexible limit.

Calls to this API count toward your plan’s API request allowance, which is the smaller of the two allowances.

Pricing

Self-service plans (Basic, Pro, and Ultra) are billed through RapidAPI; see RapidAPI for how to subscribe and authenticate. Plan limits and prices are listed on the Maptoolkit pricing page. Enterprise customers call the native hosts directly with a Maptoolkit API key.