Skip to content
Routing Enhancement API

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/routing

Authentication

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

Parameters

Routing Data

ParameterTypeRequiredDescription
startlng,latYesStart coordinates.
endlng,latYesEnd coordinates.

Route to Consider when Routing

ParameterTypeRequiredDescription
gpxURLYes (or geometry/kml)URL to the trail GPX file (forward direction).
gpx_backwardURLNoURL to the trail GPX file in the reverse direction.
kmlURLYes (or geometry/gpx)URL to the trail KML file.
geometryGeoJSON stringYes (or gpx/kml)Trail as a GeoJSON geometry.

Configuration Parameters

ParameterTypeRequiredDescription
routeTypestringNoVehicle type: car, bike, or foot.
languagestringNoLanguage for turn instructions.
cache0 or 1NoUse 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_KEY

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.
400A parameter is missing, the trail geometry is unsupported, or routing to the trail failed.

Common 400 messages

MessageCause
no start point definedstart is missing.
no end point definedend is missing.
cannot load forward routeThe trail route could not be fetched or processed.
cannot load backward routeThe backward trail route could not be fetched or processed.
Only LineStrings are allowed for forward/backward routeThe trail geometry has multiple segments. MultiLineString is not supported here.
routing from point to route not possibleRoad-network routing from the start or end point to the trail failed.
start not routeableThe 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.