Stackwick Maps

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…"}}
StatusCodeMeaning
400INVALID_REQUESTBad parameters or body. The message says what to fix.
401UNAUTHENTICATEDMissing or invalid key.
401KEY_REVOKED, KEY_EXPIREDThe key no longer works.
403SCOPE_DENIEDThe key lacks the endpoint's scope.
403ORIGIN_NOT_ALLOWED, REFERRER_NOT_ALLOWED, IP_NOT_ALLOWEDThe key's restrictions reject this caller.
404NOT_FOUND, NO_ROUTEUnknown endpoint or resource, or no route exists.
429RATE_LIMITEDSlow down; retry after Retry-After seconds.
429QUOTA_EXCEEDEDDaily or monthly quota used up; Retry-After points at the reset.
502 / 504UPSTREAM_UNAVAILABLEThe maps engine is unavailable or timed out. Retry with backoff.
500INTERNALOur 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

MethodPathScopeDescription
GET/v1/geocodegeocodeForward geocode an address or place (free text or structured)
GET/v1/reversegeocodeReverse geocode a coordinate
GET/v1/autocompletegeocodeType-ahead suggestions
GET/v1/searchgeocodeLegacy prefix search over street names and named POIs

Places

MethodPathScopeDescription
GET/v1/places/searchplacesSearch places by text and/or category
GET/v1/places/nearbyplacesPlaces near a point
GET/v1/places/categoriesplacesCategory taxonomy
GET/v1/places/{id}placesPlace details

Tiles

MethodPathScopeDescription
GET/v1/tiles/{z}/{x}/{y}.mvttilesMapbox Vector Tile
GET/v1/tiles/tilejson.jsontilesTileJSON 3.0 for the vector tileset
GET/v1/tiles/style.jsontilesMapLibre GL style (v8)
GET/v1/tiles/fonts/{fontstack}/{range}.pbftilesGlyph ranges (SDF PBF) for map labels

Routing

MethodPathScopeDescription
POST/v1/routeroutingRoute between points (turn-by-turn, traffic-aware)
POST/v1/rerouteroutingMulti-level live rerouting from the current position
POST/v1/nearestroutingSnap a coordinate to the road network
POST/v1/isochroneroutingReachability polygons
POST/v1/matchroutingHMM map matching of a GPS trace
POST/v1/etaroutingProgress and per-stop ETA prediction along a planned route
GET/v1/profilesroutingRouting profiles and default vehicle dimensions
GET/v1/eta/modelroutingETA model metadata and evaluation
GET/v1/timezoneroutingIANA time zone and UTC offset at a point
POST/v1/timezoneroutingTime zones for many points
POST/v1/sessionsroutingStart a server-side route monitoring session
POST/v1/sessions/{id}/positionroutingReport a position; reroutes automatically when off route
DELETE/v1/sessions/{id}routingEnd a session

Matrix

MethodPathScopeDescription
POST/v1/matrixmatrixDuration/distance matrix

Optimization

MethodPathScopeDescription
POST/v1/optimizeoptimizeVehicle routing problem (jobs, shipments, time windows, capacities, skills)
POST/v1/optimize/insertoptimizeInsert new jobs into running routes
POST/v1/optimize/reoptimize-routeoptimizeRe-sequence one route's unlocked stops
POST/v1/optimize/school-busoptimizeSchool-bus stop building and routing

Traffic

MethodPathScopeDescription
GET/v1/traffic/flowtrafficLive congestion polylines in a bounding box
GET/v1/traffic/incidentstrafficActive incidents and closures
POST/v1/traffic/probestrafficContribute vehicle GPS probes

Account

MethodPathScopeDescription
GET/v1/usage–Usage of the calling key

Admin

MethodPathScopeDescription
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

MethodPathScopeDescription
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&region=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.