Skip to content
Documentation menu
docs / api / get-styles-spec
Tiles, styles and map assets

GET/styles/{spec}

Access and price

AuthNo key. Not metered.
PriceNot metered: no quota, no credit.

What it does

spec is <id>@<version>.json for an immutable version (cached forever) or <id>.json for the latest (60 s TTL).

With ?api_key=snk_…, the house basemap source is served as this gateway's keyed TileJSON instead of the keyless tiles CDN, which refuses browser pages outside mapmap.ai and localhost. The key is stamped the same way the /tiles documents stamp it, so a website that loads a hosted style with its key renders the basemap. Without a key in the query the body is exactly as before.

Call it

bash
curl -fsS -X GET "https://api.mapmap.ai/styles/{spec}"

Parameters

NameInTypeRequiredDescription
specpathstringyes<id>@<version>.json (immutable) or <id>.json (latest)
api_keyquerystringnoOptional. When given, the basemap source points at this gateway's keyed tiles (/tiles/{territory}/tiles.json?api_key=…) so the style renders on any website. The style itself stays public.
renderquerystringnostatic: the variant the static-map renderer loads, with every customer source (a theme's sources) and the layers drawing from them removed, so a server-side render never requests a customer host. The removed ids are in the X-MapMap-Customer-Sources-Skipped header and metadata["mapmap:customer_sources_skipped"]. Omitted, the style is served as published.

Responses

200The compiled MapLibre style (spec v8)
FieldTypeRequiredDescription
glyphsstringnoGlyph URL template.
layersobject[]noLayers in draw order.
metadataobjectnoStyle metadata, e.g. mapmap:customer_sources_skipped on render=static.
namestringnoStyle name.
sourcesobjectnoData sources by id; the basemap is territory.
spritestringnoSprite sheet URL.
versionintegernoStyle spec version, always 8.

Example: Recorded from the hosted gateway on 2026-11-05: GET /styles/mapmap-light-76ef8d@2.json, keyless; lists trimmed to their first items

json
{
  "glyphs": "https://fonts.mapmap.ai/{fontstack}/{range}.pbf",
  "layers": [
    {
      "id": "background",
      "paint": {
        "background-color": "#f4f2ee"
      },
      "type": "background"
    },
    {
      "id": "landcover",
      "paint": {
        "fill-color": [
          "match",
          [
            "get",
            "class"
          ],
          [
            "wood",
            "forest"
          ],
          "#cfe4c7",
          [
            "grass"
          ],
          "#d7e5d0",
          [
            "wetland"
          ],
          "#dbe6d4",
          [
            "farmland"
          ],
          "#e7e8df",
          [
            "sand"
          ],
          "#e2dfd1",
          [
            "rock"
          ],
          "#c5c9c1",
          [
            "ice"
          ],
          "#d9e3ec",
          "#e3e8dd"
        ],
        "fill-opacity": 0.6
      },
      "source": "territory",
      "source-layer": "landcover",
      "type": "fill"
    }
  ],
  "name": "MapMap MapMap Light",
  "sources": {
    "territory": {
      "attribution": "© OpenStreetMap contributors © OpenMapTiles",
      "type": "vector",
      "url": "pmtiles://https://tiles.mapmap.ai/planet.pmtiles"
    }
  },
  "version": 8
}
304Not modified (If-None-Match matched the ETag)
404Hosted styles not configured, unknown style or version

application/problem+json · Problem

504The request did not finish within the gateway's request deadline (request-timeout)

application/problem+json · Problem

Error bodies follow the shared problem model documented on API conventions.

Also under Tiles, styles and map assets

Generated from https://api.mapmap.ai/openapi.json on 2026-11-12 · operationId get_style_json