oslew docs
Console
Menu

MapsplatformoperationId static

GET/v1/static

A PNG of the basemap around a point: the tiles it needs, rasterised and stitched here.

For a report, an email or anywhere a map cannot run. Part of the platform product.

Send Authorization: Bearer sk_live_…. The key's plan must include theplatform product; which plans do.

Explained in Static maps.

Example

A 600 × 400 map of the Zócalo.

curl
curl "https://api.oslew.com/v1/static?at=19.4326%2C-99.1332&zoom=15&width=600&height=400" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  -o map.png
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

data = client.static("19.4326,-99.1332", zoom=15, width=600, height=400)
open("map.png", "wb").write(data)
TypeScript
import { writeFile } from "node:fs/promises";
import { Client } from "@oslew/client";

// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });

const data = await client.static_("19.4326,-99.1332", { zoom: 15, width: 600, height: 400 });
await writeFile("map.png", data);
HTTP/1.1 200 OK · content-type: image/png · ratelimit-limit: 100 · ratelimit-remaining: 297 · ratelimit-reset: 1 · cache-control: public, max-age=3600
The 600×400 PNG this request returned

A real response, captured from the service at commit b8f4bde-dirty.

Query

NameTypeDescription
at
queryrequired
string
lat,lon of the centre.
zoom
query
number
default 13
width
query
integer
≤ 2048
default 800
height
query
integer
≤ 2048
default 600

Responses

200 — A PNG.

image/png

binary

With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.

Refusals

Every refusal is a JSON object with an error string, except where noted.

400Bad centre, or no tile archive loaded.
401No key, or one that is unknown, revoked or suspended.
403The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does.
429This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After.
503The pod cannot reach the control plane and its entitlements are too old to trust. Retry.

A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.

Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.