Reference
HTTP API reference
Public map-service endpoints, authentication requirements, request parameters and response contracts.
On this page
Request conventions #
Prerequisites: the maps origin and a key with the scopes listed below. All URLs are relative to that maps root, not the portal. Send JSON for pack POST requests and X-API-Key where possible. Coordinates use lng,lat; bounding boxes use [W,S,E,N]. Service responses are JSON/GeoJSON. Maps CORS permits GET, HEAD, POST and OPTIONS, including Range and X-API-Key headers.
curl --fail-with-body -H "X-API-Key: YOUR_API_KEY" "https://maps.example/depth?at=126.8,10"The v1 release/pack manifests carry schemaVersion:1. Existing search/route/depth responses do not all carry schemaVersion; do not require a field the service does not emit. Within the v1 client contract, additions should remain compatible and clients should ignore unknown fields.
Search, routing and depth endpoints #
| Method / path | Scope and input | Success response |
|---|---|---|
| GET /search | search; q required (1–200 chars), limit 1–20 default 10, near=lng,lat optional, lang optional | FeatureCollection {query:string, features:[place]} |
| GET /search/reverse | search; at=lng,lat required, limit 1–10 default 1, lang optional | FeatureCollection {query:[lng,lat], features:[place with distance_m]} |
| GET /search/status | search; no parameters | {ok,engine:"photon",...engine status} |
| GET /route | route; from,to required; via up to 5 semicolon-separated points; mode car|foot|bike; alternates 0–2; depart local YYYY-MM-DDTHH:MM | FeatureCollection of route LineStrings |
| GET /route/isochrone | route; at required; mode car|foot|bike; minutes=10,20,30 default, 1–4 integers each 1–120 | FeatureCollection {query,features:[Polygon/MultiPolygon with mode,minutes]} |
| GET /route/status | route; no parameters | {ok,engine:"valhalla",version,tileset_last_modified} |
| GET /depth | depth; at=lng,lat required | {at,elevation_m,depth_m,source,method,measured,cell_m,not_for_navigation:true} |
| GET /healthz | Public; no parameters | Gateway health text; not proof every engine is ready |
Place properties: name, label, kind, category, address, osm; optional GeoJSON bbox. Address fields are optional. Route properties: mode, distance_m, duration_s, depart_at, arrive_at, legs[]. Each leg has distance_m, duration_s and steps[{instruction,distance_m,duration_s,streets,location}]. Search/route features can be empty; handle that before indexing features[0]. See service chapters for complete JavaScript and curl examples.
Release and static resource endpoints #
| Method / path | Scope | Response / options |
|---|---|---|
| GET /maps/v1/releases/current | maps | Current release document (release.json) |
| GET /maps/v1/releases/<mapdata-YYYYMMDD>/manifest.json | maps | That retained release document, also release.json; this is not the build provenance manifest.json |
| GET/HEAD /maps/v1/releases/<id>/files/<path> | maps | Release file, Range supported. Includes tiles/, fonts/, sprites/, bathymetry/, packs/ and provenance/checksum files if present |
| GET /maps/styles/<light|dark>.json | maps | Resolved current style; optional key, base, raw=1 |
| GET /maps/v1/releases/<id>/files/styles/<name>.json | maps | Resolved pinned style; same options |
| GET/HEAD /maps/<path> | maps | Current release resources, including tiles, fonts, sprites and bathymetry |
| GET / | Public | Reference viewer |
| GET /sw-*.js, /vendor/<path> | Public | Client modules and pinned vendor assets |
| GET /npm/index.json, /npm/<tarball> | Public | Published package index and tarballs |
Style raw=1 leaves __MAP_BASE__ intact. base overrides the data-resource root; key is propagated into generated URLs. Styles and dated file URLs are discussed in Styles and overlays. The internal /_auth nginx subrequest is not an application endpoint. Photon and Valhalla are not public APIs.
Pack endpoints #
| Method / path | Scope | Behavior |
|---|---|---|
| POST /maps/v1/packs | packs | Build, reuse or estimate a pack; JSON body below |
| GET /maps/v1/packs/<packId> | maps | Cached manifest with maps-root-relative file URLs |
| GET/HEAD /maps/v1/packs/<packId>/manifest.json | maps | Cached manifest file; may have only file paths |
| GET/HEAD /maps/v1/packs/<packId>/<path> | maps | Pack file, Range/resume supported |
| GET/HEAD /maps/v1/releases/<id>/files/packs/<packId>/<path> | maps | Prebuilt pack resources, resolve relative paths against their manifest URL |
{
"release": "current",
"bbox": [123.6, 10.1, 124.1, 10.6],
"shore": [[123.88, 10.28, 123.95, 10.35]],
"layers": ["base", "gmrt", "contours"],
"styles": ["dark", "light"],
"dryRun": true
}Required: bbox. Defaults: release current, no shore boxes, layers base/gmrt/contours, styles dark/light, dryRun false. Discover optional layers first. POST returns 201 for a new build or 200 for a cached build/dry run. Dry-run fields include schemaVersion,dryRun,packId,release,cached,bbox,shore,layers,styles,files,totalBytes,limits. It has no downloadable pack until a build completes. Limits and the full download recipe are in Download offline maps.
Errors, HTTP caching and Range #
| Status / code | Meaning |
|---|---|
| 400 | Invalid parameters or JSON; pack errors include bad-request |
| 401 no-key | No application key |
| 403 bad-key / key-expired / scope | Credential invalid, retired, suspended, expired or not scoped for this operation |
| 404 | No route, missing file/style, unknown-release or unknown-pack |
| 405 | Unsupported operation on a pack endpoint |
| 413 | Pack request body too large; service limit 16 KiB |
| 422 | Outside coverage or pack constraint; see pack refusal codes |
| 429 rate-limited | New pack build budget exhausted |
| 500 internal | Unexpected pack-building error |
| 502 / 504 | Upstream engine unavailable/error or timed out |
| 503 | Engine not ready, missing depth grid or authorization backend unavailable |
Errors generally include error; pack and authentication errors also include code. Gateway static-file errors may be text/HTML: do not assume every error body is JSON. Current release metadata should be refreshed; named release files are immutable under the client contract. Retained releases and pack caches can disappear, returning 404. Check response cache headers instead of inventing a permanent retention guarantee.
Resume with Range: bytes=<offset>-. A 206 response must match Content-Range; a 200 response means restart the file. Preserve ETag, Content-Length, Content-Range and Accept-Ranges through gateways and CORS. Do not gzip PMTiles or cache partial HTTP responses as whole files. OPTIONS preflights are answered without a key.