API Documentation
Base URL: https://api.mapriot.com
All API requests require an API key. Get yours from the dashboard.
Authentication
Append ?apiKey=<your-key> to every request:
https://api.mapriot.com/planet/14/8873/5504?apiKey=<your-key>When using the outdoor style with a map library, the style JSON triggers additional requests for tiles, fonts, and sprites — all of which also need your API key. Each platform handles this differently:
- MapLibre GL JS — use
transformRequest(example) - Leaflet — use
transformRequestvia maplibre-gl-leaflet, or include the key directly in the raster tile URL (example) - Android — use an OkHttp interceptor (example)
- iOS — use a URLProtocol interceptor (example)
- OpenLayers — include the key directly in the raster tile URL (example)
The key goes in the query string for POST requests too (e.g. POST /route?apiKey=<key>), never in the body.
If you use an API key in a browser, restrict it to your site’s origin in the dashboard.
Billing units
Each API request consumes units against your monthly plan limit. Limits are soft on paid plans — requests are never blocked. You receive an email notification when approaching or exceeding your limit. The free plan stops at 200% of its limit (HTTP 429).
| Request type | Units |
|---|---|
| Vector or raster source tile | 1 |
| Composite raster tile | 5 |
| Elevation query (single or batch) | 1 |
| Place search, structured search or reverse geocoding | 1 |
Route (/route) or map matching (/trace_route, /trace_attributes) | 5 |
Optimized route, matrix (/sources_to_targets) or isochrone | 10 |
Locate (/locate) | 1 |
| Static map image | 10 |
| Fonts, sprites, style JSON, TileJSON | 0 |
CORS preflight (OPTIONS) requests | 0 |
What each plan includes
| Feature | Free | Starter | Pro | Enterprise |
|---|---|---|---|---|
| Vector & raster tiles, style JSON, fonts, sprites, TileJSON | ✓ | ✓ | ✓ | ✓ |
Routing (/route, /isochrone, …) | – | ✓ | ✓ | ✓ |
Place search (/search, /reverse, …) | – | ✓ | ✓ | ✓ |
| Elevation | – | ✓ | ✓ | ✓ |
| Static map images | – | ✓ | ✓ | ✓ |
| Offline downloads | – | – | – | ✓ |
A request for a feature your plan doesn’t include returns 403 with a plain-text body and is not billed:
This feature is not available on your plan. See https://mapriot.com/pricing for details or contact us at support@mapriot.com.See Pricing for the plans. Individual features can also be enabled for a single account on request — contact us.
Rate limits
Separate from your monthly units: each API key also has a request rate limit, so one misbehaving script can’t slow the service down for everyone. The limits are generous — normal apps never reach them. If you do, it almost always means a retry loop with no backoff.
Limits are per API key, so separate keys for your app, your staging environment and your batch jobs get separate budgets.
| What you’re calling | Window | Free | Starter | Pro | Enterprise |
|---|---|---|---|---|---|
| Map tiles | per minute | 6,000 | 24,000 | 60,000 | 240,000 |
Elevation, search, reverse geocoding, /locate | per minute | 600 | 3,000 | 12,000 | 48,000 |
| Static map images | per minute | 60 | 300 | 1,200 | 4,800 |
Routing (/route, /trace_route, /trace_attributes) | per minute | 300 | 1,200 | 6,000 | 24,000 |
| Isochrones, matrices, optimized routes | per 10 seconds | 10 | 30 | 100 | 300 |
Fonts, sprites, style JSON, TileJSON, offline downloads and CORS preflights are not rate limited.
When you go over
HTTP/1.1 429 Too Many Requests
Retry-After: 7
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 0
X-RateLimit-Class: routing_heavy
Content-Type: application/json{
"error": "rate_limit_exceeded",
"message": "Too many isochrone, matrix and optimized-route requests for this API key…",
"class": "routing_heavy",
"limit": 10,
"retry_after": 7
}Wait the number of seconds in Retry-After and the request will succeed. Retrying sooner just gets another 429 — it does not extend the wait, but it wastes your own throughput. Exponential backoff on top of Retry-After is the safest client behaviour.
The free plan’s 200% hard cap also returns 429, but as plain text and without a Retry-After header — check Retry-After to tell the two apart.
Request size
POST bodies are capped at 512 KB for routing and 1 MB for batch elevation; anything larger gets a 413. Routing requests also have their own shape limits (locations, matrix size, contours, trace points) — see Routing limits.
Need a higher limit? Email support@mapriot.com with your key name and what you’re building. Raising a limit is a one-line change on our side.
Endpoints
Styles
| URL | Description |
|---|---|
GET /styles/outdoor.json?apiKey=<key> | Outdoor style |
Tile sources
| Source | Type | |
|---|---|---|
planet | Vector — worldwide OSM | → |
contours | Vector — elevation contour lines | → |
hillshading | Raster-DEM — digital elevation model | → |
relief | Raster — shaded relief overlay | → |
APIs
| URL | Description | |
|---|---|---|
/styles/{style}/raster/{z}/{x}/{y}?apiKey=<key> | Composite raster tiles | → |
/elevation/{lat}/{lng}?apiKey=<key> | Elevation at a point | → |
POST /elevation?apiKey=<key> | Elevation for multiple points | → |
/static/center/{lat},{lng},{zoom}/…?apiKey=<key> | Static map image | → |
/static/bounds/{bbox}/…?apiKey=<key> | Static image from bounding box | → |
/static/path/{size}?points=…&apiKey=<key> | Static image auto-fit to path | → |
/search?q=…&apiKey=<key> | Place search / autocomplete | → |
/search/structured?city=…&apiKey=<key> | Address search by fields | → |
/reverse?lat=…&lon=…&apiKey=<key> | Reverse geocoding | → |
POST /route?apiKey=<key> | Hiking, cycling and driving routes | → |
POST /optimized_route?apiKey=<key> | Route through all stops in the best order | → |
POST /sources_to_targets?apiKey=<key> | Travel time/distance matrix | → |
POST /isochrone?apiKey=<key> | Reachable area within a time or distance | → |
POST /trace_route?apiKey=<key> | Map-match a GPS trace to a route | → |
POST /trace_attributes?apiKey=<key> | Map-match a GPS trace, return edge attributes | → |
POST /locate?apiKey=<key> | Nearest roads and paths to a point | → |
Errors
| Status | Meaning |
|---|---|
400 | Invalid parameters. Routing and search return a JSON body describing the problem |
403 | Missing, invalid or inactive API key; the request doesn’t match the key’s restrictions; or the feature isn’t included in your plan (routing, search, elevation and static images all need a paid plan — see the plan table). A 403 is never billed |
404 | Unknown path, or no data at that location (e.g. elevation outside coverage) |
413 | Request body too large: 512 KB for routing, 1 MB for batch elevation |
429 | Rate limit for this API key (JSON body with Retry-After), or the free plan hard cap at 200% of the monthly unit limit (plain text) |
5xx | Temporary server error. Retry with backoff |
CORS
Every endpoint can be called from a browser on any origin. Responses carry Access-Control-Allow-Origin: *.
Requests that trigger a CORS preflight, such as POST with Content-Type: application/json (routing, batch elevation) or a custom header, are handled automatically: the OPTIONS preflight is answered without an API key and is not billed. Only the actual request counts.