Stackwick Maps API
Base URL: https://maps.stackwick.com. All endpoints are JSON over HTTPS unless noted. The machine-readable
contract is the OpenAPI 3.1 document.
Authentication
Every /v1 request needs an API key. Send it in one of three ways:
X-Api-Key: swk_… header (preferred)
Authorization: Bearer swk_…
?key=swk_… query parameter, for map libraries that load tiles, glyphs and styles by URL
Each key has scopes: geocode, places, tiles, routing,
matrix, optimize, traffic. Calling an endpoint outside your scopes returns
403 SCOPE_DENIED. Never embed an unrestricted key in a public web page: give browser keys an
origin or referrer allowlist.
Errors
Every error has the same body, and every response carries an X-Request-Id header (quote it in support requests):
{"error": {"code": "INVALID_REQUEST", "message": "lat must be between -90 and 90, got 123", "request_id": "6f1c2d0e…"}}
| Status | Code | Meaning |
| 400 | INVALID_REQUEST | Bad parameters or body. The message says what to fix. |
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 401 | KEY_REVOKED, KEY_EXPIRED | The key no longer works. |
| 403 | SCOPE_DENIED | The key lacks the endpoint's scope. |
| 403 | ORIGIN_NOT_ALLOWED, REFERRER_NOT_ALLOWED, IP_NOT_ALLOWED | The key's restrictions reject this caller. |
| 404 | NOT_FOUND, NO_ROUTE | Unknown endpoint or resource, or no route exists. |
| 429 | RATE_LIMITED | Slow down; retry after Retry-After seconds. |
| 429 | QUOTA_EXCEEDED | Daily or monthly quota used up; Retry-After points at the reset. |
| 502 / 504 | UPSTREAM_UNAVAILABLE | The maps engine is unavailable or timed out. Retry with backoff. |
| 500 | INTERNAL | Our fault. Retry, and contact us with the request id if it persists. |
Rate limits & quotas
Keys have a token-bucket rate limit (requests per second plus a burst). Some keys also have a per-client-IP
limit. Keyed responses include X-RateLimit-Limit (bucket size) and X-RateLimit-Remaining.
Optional daily and monthly quotas count requests per UTC day and calendar month. See your usage with
GET /v1/usage or in the console.
Request bodies are limited to 2 MB (8 MB for matrix, optimization and probe uploads). A matrix may have at
most your key's max_matrix_elements cells (2,500 by default).
Key restrictions
- Origins: exact (
https://app.example.com) or wildcard subdomains (https://*.example.com). Allowed origins get CORS headers.
- Referrers: URL globs such as
https://*.example.com/*.
- IPs: CIDR ranges, for server-side keys.
- require_origin: when off (the default), requests without
Origin/Referer, such as mobile apps and servers, are allowed. When those headers are present they must match.
Endpoint index
Geocoding
| Method | Path | Scope | Description |
| GET | /v1/geocode | geocode | Forward geocode an address or place (free text or structured) |
| GET | /v1/reverse | geocode | Reverse geocode a coordinate |
| GET | /v1/autocomplete | geocode | Type-ahead suggestions |
| GET | /v1/search | geocode | Legacy prefix search over street names and named POIs |
Places
| Method | Path | Scope | Description |
| GET | /v1/places/search | places | Search places by text and/or category |
| GET | /v1/places/nearby | places | Places near a point |
| GET | /v1/places/categories | places | Category taxonomy |
| GET | /v1/places/{id} | places | Place details |
Tiles
| Method | Path | Scope | Description |
| GET | /v1/tiles/{z}/{x}/{y}.mvt | tiles | Mapbox Vector Tile |
| GET | /v1/tiles/tilejson.json | tiles | TileJSON 3.0 for the vector tileset |
| GET | /v1/tiles/style.json | tiles | MapLibre GL style (v8) |
| GET | /v1/tiles/fonts/{fontstack}/{range}.pbf | tiles | Glyph ranges (SDF PBF) for map labels |
Routing
| Method | Path | Scope | Description |
| POST | /v1/route | routing | Route between points (turn-by-turn, traffic-aware) |
| POST | /v1/reroute | routing | Multi-level live rerouting from the current position |
| POST | /v1/nearest | routing | Snap a coordinate to the road network |
| POST | /v1/isochrone | routing | Reachability polygons |
| POST | /v1/match | routing | HMM map matching of a GPS trace |
| POST | /v1/eta | routing | Progress and per-stop ETA prediction along a planned route |
| GET | /v1/profiles | routing | Routing profiles and default vehicle dimensions |
| GET | /v1/eta/model | routing | ETA model metadata and evaluation |
| GET | /v1/timezone | routing | IANA time zone and UTC offset at a point |
| POST | /v1/timezone | routing | Time zones for many points |
| POST | /v1/sessions | routing | Start a server-side route monitoring session |
| POST | /v1/sessions/{id}/position | routing | Report a position; reroutes automatically when off route |
| DELETE | /v1/sessions/{id} | routing | End a session |
Matrix
| Method | Path | Scope | Description |
| POST | /v1/matrix | matrix | Duration/distance matrix |
Optimization
| Method | Path | Scope | Description |
| POST | /v1/optimize | optimize | Vehicle routing problem (jobs, shipments, time windows, capacities, skills) |
| POST | /v1/optimize/insert | optimize | Insert new jobs into running routes |
| POST | /v1/optimize/reoptimize-route | optimize | Re-sequence one route's unlocked stops |
| POST | /v1/optimize/school-bus | optimize | School-bus stop building and routing |
Traffic
| Method | Path | Scope | Description |
| GET | /v1/traffic/flow | traffic | Live congestion polylines in a bounding box |
| GET | /v1/traffic/incidents | traffic | Active incidents and closures |
| POST | /v1/traffic/probes | traffic | Contribute vehicle GPS probes |
Account
| Method | Path | Scope | Description |
| GET | /v1/usage | – | Usage of the calling key |
Admin
| Method | Path | Scope | Description |
| POST | /admin/v1/keys | – | Create a key (the plaintext key is returned once) |
| GET | /admin/v1/keys | – | List keys (never returns hashes) |
| GET | /admin/v1/keys/{id} | – | Get a key |
| PATCH | /admin/v1/keys/{id} | – | Update scopes, limits, quotas, restrictions, name or expiry |
| POST | /admin/v1/keys/{id}/rotate | – | Issue a new secret (same public id); the old secret works for grace_seconds |
| POST | /admin/v1/keys/{id}/revoke | – | Revoke a key (soft; keys are never deleted) |
| GET | /admin/v1/keys/{id}/usage | – | Daily per-endpoint usage and totals |
| GET | /admin/v1/keys/{id}/audit | – | Admin audit log entries for a key (newest first) |
Operations
| Method | Path | Scope | Description |
| GET | /healthz | – | Liveness |
| GET | /readyz | – | Readiness (database and geo-engine reachable) |
| GET | /openapi.yaml | – | This document |
Examples
Geocode an address
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/geocode?q=1901+S+4th+St,+Ames,+IA&limit=3"
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/geocode?housenumber=1901&street=S+4th+St&locality=Ames®ion=IA"
Reverse geocode and autocomplete
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/reverse?lat=42.0213&lng=-93.6505"
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/autocomplete?q=lincoln+wa&lat=42.03&lng=-93.62"
Places
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/places/nearby?lat=42.0267&lng=-93.6465&category=food.cafe&open_now=true"
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/places/search?q=library&lat=42.03&lng=-93.62&radius=5000"
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/places/osm:n1978931292"
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/places/categories"
Route
curl -H "X-Api-Key: $KEY" -H "Content-Type: application/json" "https://maps.stackwick.com/v1/route" \
-d '{"origin":{"lat":42.02,"lng":-93.63},"destination":{"lat":42.04,"lng":-93.61},"profile":"car","steps":true}'
Matrix
curl -H "X-Api-Key: $KEY" -H "Content-Type: application/json" "https://maps.stackwick.com/v1/matrix" \
-d '{"sources":[{"lat":42.02,"lng":-93.63}],"targets":[{"lat":42.04,"lng":-93.61},{"lat":42.03,"lng":-93.65}],"profile":"car"}'
Optimize
curl -H "X-Api-Key: $KEY" -H "Content-Type: application/json" "https://maps.stackwick.com/v1/optimize" \
-d '{"vehicles":[{"id":"van-1","profile":"van","start":{"lat":42.02,"lng":-93.63},"capacity":[100]}],
"jobs":[{"id":"j1","type":"delivery","location":{"lat":42.04,"lng":-93.61},"amount":[1],"service_s":120}]}'
Traffic
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/traffic/flow?bbox=-93.70,41.98,-93.55,42.07&zoom=14"
Your usage
curl -H "X-Api-Key: $KEY" "https://maps.stackwick.com/v1/usage?from=2026-09-01&to=2026-09-30"
Maps in the browser
Point any MapLibre GL client at the style. The key you pass in the style URL is copied into the tile and glyph
URLs, so use a key restricted to your site's origins with only the tiles scope:
const map = new maplibregl.Map({
container: "map",
style: "https://maps.stackwick.com/v1/tiles/style.json?key=YOUR_BROWSER_KEY",
center: [-93.62, 42.03],
zoom: 13,
});
Tiles are application/vnd.mapbox-vector-tile, sometimes gzip-encoded. An empty tile returns 204.
Tile and glyph responses are cacheable for a day.
Attribution
Maps and data you show to users must credit “© OpenStreetMap contributors”, plus the source named in each
result's attribution or source field. TileJSON carries the attribution string for map views.