oslew docs
Console
Menu

MapsplatformoperationId tiles

GET/v1/tiles/{z}/{x}/{y}

One basemap tile. y may carry an extension: .mvt or .pbf for the vector tile as stored, .png to rasterise it here.

A Mapbox Vector Tile 2.1 body out of a PMTiles archive, or a PNG rendered from it. 204 when the archive has no tile at that address, which is what an empty ocean tile is. Part of the platform product.

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

Explained in Vector tiles and A commute-time map.

Example

One vector tile over the Zócalo.

curl
curl "https://api.oslew.com/v1/tiles/14/3680/7290.mvt" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  -o 7290.mvt
Python
from oslew import Client

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

data = client.tiles(14, 3680, "7290.mvt")
open("7290.mvt", "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.tiles(14, 3680, "7290.mvt");
await writeFile("7290.mvt", data);
Response
HTTP/1.1 200 OK
content-type: application/vnd.mapbox-vector-tile
ratelimit-limit: 100
ratelimit-remaining: 290
ratelimit-reset: 1
cache-control: public, max-age=86400
content-encoding: gzip

(422,836 bytes of application/vnd.mapbox-vector-tile)

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

Path

NameTypeDescription
z
pathrequired
integer
≥ 0, ≤ 24
x
pathrequired
integer
≥ 0
y
pathrequired
string
The row, optionally with .mvt, .pbf or .png.

Responses

200 — The tile.

application/vnd.mapbox-vector-tile

binary

image/png

binary

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

204 — No tile at that address.

No body.

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 address, 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.

More examples

The same tile, rasterised
curl
curl "https://api.oslew.com/v1/tiles/14/3680/7290.png" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  -o 7290.png
Python
from oslew import Client

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

data = client.tiles(14, 3680, "7290.png")
open("7290.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.tiles(14, 3680, "7290.png");
await writeFile("7290.png", data);
HTTP/1.1 200 OK · content-type: image/png · ratelimit-limit: 100 · ratelimit-remaining: 293 · ratelimit-reset: 1 · cache-control: public, max-age=86400
The 512×512 PNG this request returned

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

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