Tileserver RS provides a REST API for accessing tiles and metadata.
GET /health
Returns OK if the server is running.
Response: 200 OK
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 /data/{source}.json
Returns TileJSON metadata for a specific source.
Parameters:
| Name | Type | Description |
|---|---|---|
source | string | Source 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 /data/{source}/{z}/{x}/{y}.{format}
Returns a single tile from a source.
Parameters:
| Name | Type | Description |
|---|---|---|
source | string | Source ID |
z | integer | Zoom level (0-22) |
x | integer | Tile X coordinate |
y | integer | Tile Y coordinate |
format | string | Tile format (pbf, png, jpg, webp) |
Response Headers:
| Header | Description |
|---|---|
Content-Type | MIME type based on format |
Content-Encoding | gzip if tile is compressed |
Cache-Control | Caching headers |
Response Codes:
| Code | Description |
|---|---|
200 | Tile found and returned |
204 | Tile not found (empty response) |
400 | Invalid coordinates |
404 | Source not found |
GET /styles.json
Returns a list of all available map styles.
GET /styles/{style}/style.json
Returns the MapLibre/Mapbox GL style JSON for a specific style.