Api

API Endpoints

REST API reference for Tileserver RS

API Endpoints

Tileserver RS provides a REST API for accessing tiles and metadata.

Health Check

GET /health

Returns OK if the server is running.

Response: 200 OK

List All Sources

GET /data.json

Returns a list of all available tile sources with their TileJSON metadata.

Response:

[
  {
    "tilejson": "3.0.0",
    "name": "OpenMapTiles",
    "tiles": ["http://localhost:8080/data/openmaptiles/{z}/{x}/{y}.pbf"],
    "minzoom": 0,
    "maxzoom": 14,
    "bounds": [-180, -85.0511, 180, 85.0511],
    "center": [0, 0, 2]
  }
]

Get Source TileJSON

GET /data/{source}.json

Returns TileJSON metadata for a specific source.

Parameters:

NameTypeDescription
sourcestringSource ID

Response:

{
  "tilejson": "3.0.0",
  "name": "OpenMapTiles",
  "tiles": ["http://localhost:8080/data/openmaptiles/{z}/{x}/{y}.pbf"],
  "vector_layers": [...],
  "minzoom": 0,
  "maxzoom": 14,
  "bounds": [-180, -85.0511, 180, 85.0511],
  "center": [0, 0, 2]
}

Get Tile

GET /data/{source}/{z}/{x}/{y}.{format}

Returns a single tile from a source.

Parameters:

NameTypeDescription
sourcestringSource ID
zintegerZoom level (0-22)
xintegerTile X coordinate
yintegerTile Y coordinate
formatstringTile format (pbf, png, jpg, webp)

Response Headers:

HeaderDescription
Content-TypeMIME type based on format
Content-Encodinggzip if tile is compressed
Cache-ControlCaching headers

Response Codes:

CodeDescription
200Tile found and returned
204Tile not found (empty response)
400Invalid coordinates
404Source not found

List Styles (Planned)

GET /styles.json

Returns a list of all available map styles.

Get Style JSON (Planned)

GET /styles/{style}/style.json

Returns the MapLibre/Mapbox GL style JSON for a specific style.