Routing Enhancement API
Use the routing enhancement API to route from a start point to an end point along a defined trail. The route connects to the trail at the nearest point.
Base URL
https://enhance.maptoolkit.net/routingAuthentication
Add your API key as ?api_key=YOUR_API_KEY to every request. See Authentication for details.
Parameters
Routing Data
| Parameter | Type | Required | Description |
|---|---|---|---|
start | lng,lat | Yes | Start coordinates. |
end | lng,lat | Yes | End coordinates. |
Route to Consider when Routing
| Parameter | Type | Required | Description |
|---|---|---|---|
gpx | URL | Yes (or geometry/kml) | URL to the trail GPX file (forward direction). |
gpx_backward | URL | No | URL to the trail GPX file in the reverse direction. |
kml | URL | Yes (or geometry/gpx) | URL to the trail KML file. |
geometry | GeoJSON string | Yes (or gpx/kml) | Trail as a GeoJSON geometry. |
Configuration Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
routeType | string | No | Vehicle type: car, bike, or foot. |
language | string | No | Language for turn instructions. |
cache | 0 or 1 | No | Use cached results. Default: 1. |
Response
Example:
GET https://enhance.maptoolkit.net/routing?start=10.826209,47.834097&end=10.854801,47.746367&gpx=https://static.maptoolkit.net/trail.gpx&api_key=YOUR_API_KEYErrors
Errors return the HTTP status code with a plain-text message in the body.
| Status | Meaning |
|---|---|
403 | The API key is missing (Access denied!) or not recognized (Api-key not found!). See First Steps. |
400 | A parameter is missing, the trail geometry is unsupported, or routing to the trail failed. |
Common 400 messages
| Message | Cause |
|---|---|
no start point defined | start is missing. |
no end point defined | end is missing. |
cannot load forward route | The trail route could not be fetched or processed. |
cannot load backward route | The backward trail route could not be fetched or processed. |
Only LineStrings are allowed for forward/backward route | The trail geometry has multiple segments. MultiLineString is not supported here. |
routing from point to route not possible | Road-network routing from the start or end point to the trail failed. |
start not routeable | The start coordinate could not be connected to the trail. |
routing request failed: {message} | The upstream routing service returned an error. |
param '{name}' seems to be a JSON String, but it cannot be parsed: {message} | A parameter value starts with { but is not valid JSON. |
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.