Skip to content

Martin Endpoints

OpenAPI Documentation

If you want to explore the API endpoints programmatically or generate client code, you can use our OpenAPI Documentation.

Martin data is available via these HTTP GET endpoints:

URL Description
/ Web UI
/catalog List of all sources
/{sourceID} Source TileJSON
/{sourceID}/{z}/{x}/{y} Map Tiles
/{source1},…,{sourceN} Composite Source TileJSON
/{source1},…,{sourceN}/{z}/{x}/{y} Composite Source Tiles
/sprite/{spriteID}[@2x].{json,png} Sprite sources
/sdf_sprite/{spriteID}[@2x].{json,png} SDF Sprite sources
/font/{font}/{start}-{end} Font source
/font/{font1},…,{fontN}/{start}-{end} Composite Font source
/style/{style} Style source
/health Martin server health check: returns 200 OK
/_/metrics Martin server Prometheus metrics

Postprocessing

Martin can postprocess tiles before serving - for example, converting between MVT and MLT format in either direction. Postprocessing is configured via the convert_to_mlt and convert_to_mvt keys in the configuration file, not through the HTTP API. Clients receive the postprocessed tiles transparently.

Duplicate Source ID

In case there is more than one source that has the same name, e.g. a PG function is available in two schemas/connections, or a table has more than one geometry columns, sources will be assigned unique IDs such as /points, /points.1, etc.

Reserved Source IDs

Some source IDs are reserved for internal use. If you try to use them, they will be automatically renamed to a unique ID the same way as duplicate source IDs are handled, e.g. a catalog source will become catalog.1.

Here are the reserved source IDs: _, catalog, config, font, health, help, index, manifest, metrics, refresh, reload, sprite, status.

Source TileJSON

All tile sources have a TileJSON endpoint available at the /{SourceID}.

For example, a points function or a table will be available as /points. Composite source combining points and lines sources will be available at /points,lines endpoint.

curl localhost:3000/points | jq
curl localhost:3000/points,lines | jq

Catalog

A list of all available sources is available via catalogue endpoint

curl localhost:3000/catalog | jq
Example
{
  "tiles" {
    "function_zxy_query": {
      "name": "public.function_zxy_query",
      "content_type": "application/x-protobuf"
    },
    "points1": {
      "name": "public.points1.geom",
      "content_type": "image/webp"
    },
    ...
  },
  "sprites": {
    "cool_icons": {
      "images": [
        "bicycle",
        "bear",
      ]
    },
    ...
  },
  "fonts": {
    "Noto Mono Regular": {
      "family": "Noto Mono",
      "style": "Regular",
      "glyphs": 875,
      "start": 0,
      "end": 65533
    },
    ...
  },
  "styles": {
    "maplibre_demo": {
      "path": "path/to/maplibre_demo.json",
    },
  },
}