- Home
- Docs
- API reference
- Static map image (JSON body, for long paths)
API reference
Static map image (JSON body, for long paths)
Same image as `GET /v1/staticmap`, with a JSON body (up to 2 MB). Pass `routes[0].geometry` from `/v1/route` unchanged as `paths[].polyline`.
Endpoint
POST
Bearer Authhttps://api.wayline.cloud/v1/staticmapRequires an API key (authentication). Product overview: Static Maps API (JSON body). Billing: see units & pricing.
Request body
JSON object (StaticMapRequest). Points accept "lat,lng" strings, {lat, lng} objects or [lat, lng] arrays.
| Field | Type | Description |
|---|---|---|
width | integer | Default: 600 |
height | integer | Default: 400 |
scale | integer | One of: 1, 2Default: 1 |
format | string | One of: png, jpg, webpDefault: png |
padding | integer | Default: 48 |
center | Point | Flexible coordinate input accepted as string, object, or array. |
zoom | integer | |
paths | object[] | |
markers | object[] |
Response
200 — PNG or WebP image.
Response headers
X-Request-Id— Unique identifier for tracking and debugging this request.X-Units-Charged— Units billed (1).X-Map-Zoom— Zoom used (fitted or given).X-Map-Center— Center used, `lat,lng`.X-Cache— `HIT` when served from the server-side image cache (billed the same).
Errors
| Status | When |
|---|---|
400 | Bad request (invalid coordinates, out of coverage, too many elements, etc.). |
401 | Missing or invalid API key, or expired key. |
402 | Free quota exhausted, no payment method, account suspended, or the monthly spend limit you set was reached. Never billed. Raise or remove the limit in the dashboard (Billing) and retry; nothing else changes. |
403 | Account disabled, key IP restriction failed, origin not allowed, or scope not permitted. |
429 | Rate limit exceeded or test key daily quota reached. |
500 | Internal server error. |
503 | Upstream routing service temporarily unavailable. |
Error bodies contain a code such as OUT_OF_COVERAGE — see the error reference.
Try it
Interactive API Console
Sends a real request from your browser using a test key (free, never billed). The key stays in this browser tab only.
No key yet? Create a free test key.