Tiles API
Tiles API reference
Tiles
List the tiles
Lists the tilesets from the tiles directory. Can be paginated with offset and limit parameters, otherwise first 50 items are returned.
- Type: integeroffset
The starting position of returned list of items.
- Type: integerlimit
Maximum number of items which will be returned.
- application/json
curl http://localhost:3650/api/v1/admin/tiles \
--header 'Authorization: Basic username:password'
{
"items": [
{
"id": "b142543e-ffa2-4994-acbc-825012e75a97",
"name": "maptiler-osm",
"title": "Maptiler OSM Data",
"fileName": "maptiler-osm.mbtiles",
"published": true,
"type": "mbtiles",
"tileType": "vector"
}
]
}OK
Rescan the tiles
Rescans tiles directory. Does NOT remove dead files.
- application/json
curl http://localhost:3650/api/v1/admin/tiles/rescan \
--request POST \
--header 'Authorization: Basic username:password'
{
"items": [
{
"id": "b142543e-ffa2-4994-acbc-825012e75a97",
"name": "maptiler-osm",
"title": "Maptiler OSM Data",
"fileName": "maptiler-osm.mbtiles",
"published": true,
"type": "mbtiles",
"tileType": "vector"
}
]
}OK
Reload the tiles
Rescans the tiles directory and automatically removes dead files. Optionally may remove remote tile records.
- Type: booleanremove
Remote Removes remote tile records. Does not remove files from the remote server.
- application/json
curl http://localhost:3650/api/v1/admin/tiles/reload \
--request POST \
--header 'Authorization: Basic username:password'
{
"removed": [
"maptiler-osm"
]
}OK
Add remote tile
Adds MTPKG remote tile record.
A JSON object containing storage and url for remote tile
- Type: string enumstorage
Storage type of remote server
values- http
- s3
- Type: stringurl
URL of remote file
- application/json
- application/json
- application/json
curl http://localhost:3650/api/v1/admin/tiles/add \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic username:password' \
--data '{
"storage": "http",
"url": "https://data.maptiler.com/downloads/tileset/europe/switzerland/zurich.mtpkg"
}'
{
"id": "b142543e-ffa2-4994-acbc-825012e75a97",
"name": "maptiler-osm",
"title": "Maptiler OSM Data",
"fileName": "maptiler-osm.mbtiles",
"published": true,
"type": "mbtiles",
"tileType": "vector"
}OK
Detail of the tileset
Gets information about the given tileset.
- Type: stringidrequired
Identifier of the tileset
- application/json
- application/json
- application/json
curl http://localhost:3650/api/v1/admin/tiles/b142543e-ffa2-4994-acbc-825012e75a97 \
--header 'Authorization: Basic username:password'
{
"id": "b142543e-ffa2-4994-acbc-825012e75a97",
"name": "maptiler-osm",
"title": "Maptiler OSM Data",
"fileName": "maptiler-osm.mbtiles",
"published": true,
"type": "mbtiles",
"tileType": "vector",
"urls": {
"embeddable": "http://localhost:3650/api/tiles/maptiler-osm",
"ogcTiles": "http://localhost:3650/api/tiles/maptiler-osm/tiles",
"tilejson": "http://localhost:3650/api/tiles/maptiler-osm/tiles.json",
"wmts": "http://localhost:3650/api/tiles/maptiler-osm/WMTSCapabilities.xml",
"xyz": "http://localhost:3650/api/tiles/maptiler-osm/{z}/{x}/{y}"
}
}OK
Change metadata of the given tileset
Changes metadata (name, published) of the given tileset.
- Type: stringidrequired
Identifier of the tileset
A JSON object containing metadata information
- Type: stringname
New name
- Type: booleanpublished
New state of the tile serving
- application/json
- application/json
- application/json
curl http://localhost:3650/api/v1/admin/tiles/b142543e-ffa2-4994-acbc-825012e75a97 \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic username:password' \
--data '{
"name": "maptiler-osm",
"published": true
}'
{
"id": "b142543e-ffa2-4994-acbc-825012e75a97",
"name": "maptiler-osm",
"title": "Maptiler OSM Data",
"fileName": "maptiler-osm.mbtiles",
"published": true,
"type": "mbtiles",
"tileType": "vector",
"urls": {
"embeddable": "http://localhost:3650/api/tiles/maptiler-osm",
"ogcTiles": "http://localhost:3650/api/tiles/maptiler-osm/tiles",
"tilejson": "http://localhost:3650/api/tiles/maptiler-osm/tiles.json",
"wmts": "http://localhost:3650/api/tiles/maptiler-osm/WMTSCapabilities.xml",
"xyz": "http://localhost:3650/api/tiles/maptiler-osm/{z}/{x}/{y}"
}
}OK
Delete the tileset
Deletes the given tileset. Before deleting, it is automatically unpublished and cannot be served anymore.
- Type: stringidrequired
Identifier of the tileset
- application/json
- application/json
- application/json
curl http://localhost:3650/api/v1/admin/tiles/b142543e-ffa2-4994-acbc-825012e75a97 \
--request DELETE \
--header 'Authorization: Basic username:password'
{
"removed": [
"maptiler-osm"
]
}OK
Publish the tileset
Publishes the given tileset. Does nothing, if the tileset is already published.
- Type: stringidrequired
Identifier of the tileset
- application/json
- application/json
- application/json
curl http://localhost:3650/api/v1/admin/tiles/b142543e-ffa2-4994-acbc-825012e75a97/publish \
--request POST \
--header 'Authorization: Basic username:password'
{
"id": "b142543e-ffa2-4994-acbc-825012e75a97",
"name": "maptiler-osm",
"title": "Maptiler OSM Data",
"fileName": "maptiler-osm.mbtiles",
"published": true,
"type": "mbtiles",
"tileType": "vector",
"urls": {
"embeddable": "http://localhost:3650/api/tiles/maptiler-osm",
"ogcTiles": "http://localhost:3650/api/tiles/maptiler-osm/tiles",
"tilejson": "http://localhost:3650/api/tiles/maptiler-osm/tiles.json",
"wmts": "http://localhost:3650/api/tiles/maptiler-osm/WMTSCapabilities.xml",
"xyz": "http://localhost:3650/api/tiles/maptiler-osm/{z}/{x}/{y}"
}
}OK
Unpublish the tileset
Unpublishes the given tileset. Does nothing, if the tileset is already unpublished.
- Type: stringidrequired
Identifier of the tileset
- application/json
- application/json
- application/json
curl http://localhost:3650/api/v1/admin/tiles/b142543e-ffa2-4994-acbc-825012e75a97/unpublish \
--request POST \
--header 'Authorization: Basic username:password'
{
"id": "b142543e-ffa2-4994-acbc-825012e75a97",
"name": "maptiler-osm",
"title": "Maptiler OSM Data",
"fileName": "maptiler-osm.mbtiles",
"published": true,
"type": "mbtiles",
"tileType": "vector",
"urls": {
"embeddable": "http://localhost:3650/api/tiles/maptiler-osm",
"ogcTiles": "http://localhost:3650/api/tiles/maptiler-osm/tiles",
"tilejson": "http://localhost:3650/api/tiles/maptiler-osm/tiles.json",
"wmts": "http://localhost:3650/api/tiles/maptiler-osm/WMTSCapabilities.xml",
"xyz": "http://localhost:3650/api/tiles/maptiler-osm/{z}/{x}/{y}"
}
}OK