Documentation menu
Search docs…⌘K

API reference

Static map image with a route and numbered stops

Renders a PNG (or WebP) map up to 1280x1280, at `scale=2` for retina screens and zooming, with base map tiles from OpenStreetMap, your paths and numbered markers, and "© OpenStreetMap contributors" drawn in the bottom-right corner (so the image meets the ODbL attribution requirement on its own). Without `center`/`zoom` the map fits every path vertex and marker inside the image minus `padding`. Paths and markers use Google Static Maps-like syntax: - `path=color:0x2563eb|weight:5|opacity:0.9|enc:<polyline>` (`enc:` must be last; add `precision:6` for `polyline6`), or `path=color:red|lat,lng|lat,lng|…` - `markers=numbered:1|lat,lng|lat,lng|…` labels the points 1, 2, 3 … - `markers=style:start|label:1|lat,lng`, `markers=style:end|label:15|lat,lng`, `markers=color:0x7c3aed|label:A|lat,lng`, `markers=style:dot|lat,lng` Keep GET URLs under 16 KB (use `overview=simplified` on `/v1/route`), or POST a JSON body for long paths. One `static_map` unit per image; images served from the server-side cache are billed the same, and errors are never billed.

Endpoint

GEThttps://api.wayline.cloud/v1/staticmap
Bearer Auth

Requires an API key (authentication). Product overview: Static Maps API. Billing: see units & pricing.

Parameters

NameInTypeDescription
sizequerystringWIDTHxHEIGHT in CSS pixels, each 64 to 1280. Default 600x400.
widthqueryinteger
heightqueryinteger
scalequeryinteger2 doubles the pixel size (1280x800 at scale 2 is 2560x1600 px).One of: 1, 2Default: 1
formatquerystringjpg is ~5x smaller than png; best for app and web previews.One of: png, jpg, webpDefault: png
paddingqueryintegerPixels kept clear around the fitted content.Default: 48
centerqueryPointStringlat,lng; requires zoom.
zoomqueryinteger0 to 18; requires center.
pathquerystring[]Repeatable (up to 10).
markersquerystring[]Repeatable; up to 100 markers in total.

Example

curl "https://api.wayline.cloud/v1/staticmap?size=1280x800&scale=2&path=color%3A0x2563eb%7Cweight%3A5%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376&markers=numbered%3A1%7C23.7925,90.4078%7C23.7937,90.4066%7C23.7639,90.3889%7C23.7465,90.376" \
  -H "Authorization: Bearer $WAYLINE_API_KEY"
Response (example)
HTTP/1.1 200 OK
Content-Type: image/png
X-Map-Zoom: 14
X-Map-Center: 23.752310,90.384120
X-Units-Charged: 1
X-Cache: MISS

<2560 x 1600 PNG: your route and numbered stops, © OpenStreetMap contributors>

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

StatusWhen
400Bad request (invalid coordinates, out of coverage, too many elements, etc.).
401Missing or invalid API key, or expired key.
402Free 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.
403Account disabled, key IP restriction failed, origin not allowed, or scope not permitted.
429Rate limit exceeded or test key daily quota reached.
500Internal server error.
503Upstream routing service temporarily unavailable.

Error bodies contain a code such as OUT_OF_COVERAGE — see the error reference.

Try it

Interactive API Console

GET /v1/staticmap

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.

Was this page helpful?