Mapbox Tiling Service | API Docs (original) (raw)
Mapbox Tiling Service (MTS) is a tool for creating vector and raster tilesets. With MTS, you use sets of configuration options (tileset recipes) to transform your geospatial data into vector tiles. The resulting tiles are hosted on Mapbox servers for use in your applications.
On this page you'll find the API documentation for interacting with MTS.
Besides accessing MTS using the API endpoints described here, you can also prepare and upload data for MTS using the Tilesets CLI, a command-line Python tool. For more information about the Tilesets CLI, see the Tilesets CLI documentation and the Get started with MTS and the Tilesets CLI tutorial.
Create a tileset source
post
/tilesets/v1/sources/{username}/{id}
Creates a tileset source. A tileset source is raw geographic data formatted as line-delimited GeoJSON, or a supported raster file format and uploaded to Mapbox.com. (Learn more about how line-delimited GeoJSON is used by MTS in the Tileset sources guide.)
Tileset sources are necessary to use MTS to create a new vector or raster tileset, and they are referenced via a tileset source ID. The same tileset source can be used across multiple tilesets.
A tileset source can be composed of up to 10 source files. Each individual source file must not exceed 20 GB. The maximum combined total size of all files that compose a tileset source is 50 GB. If the total size of all the files that compose a tileset source is greater than 50 GB, MTS will return a response that contains an error
property with more details. To add multiple source files to a tileset source, see the Append to an existing tileset source endpoint. To replace a tileset source with new source files, use the Replace a tileset source endpoint.
If you no longer need a tileset source, you should manually delete it after any related tilesets are finished processing using the Delete a tileset source endpoint. The related tilesets will continue working normally.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to create a tileset source. |
id | string | The ID for the tileset source to be created. Limited to 32 characters. The only allowed special characters are - and _. |
The request body must be line-delimited GeoJSON or a supported raster file format. For information about how to convert GeoJSON or other data formats to line-delimited GeoJSON, see the Tileset sources troubleshooting guide.
Example request: Create a tileset source
Response: Create a tileset source
If the request is successful, the response will contain the following properties:
Property | Type | Description |
---|---|---|
file_size | integer | The size in bytes of the individual file you have added to your tileset source. |
files | integer | The total number of files in the tileset source. |
id | string | The unique identifier for the tileset source. |
source_size | integer | The total size in bytes of all the files in the tileset source. |
Example response: Create a tileset source
Append to an existing tileset source
post
/tilesets/v1/sources/{username}/{id}
Appends new source data to a tileset source, or creates a source if it does not exist already. A tileset source is raw geographic data formatted as line-delimited GeoJSON, or a supported raster file format and uploaded to Mapbox.com. (Learn more about how line-delimited GeoJSON is used by MTS in the Tileset sources guide.)
Tileset sources are necessary to use MTS to create a new vector or vector tileset, and they are referenced via a tileset source ID. The same tileset source can be used across multiple tilesets.
A tileset source can be composed of up to 10 source files. Each individual source file must not exceed 20 GB. The maximum combined total size of all files that compose a tileset source is 50 GB. If the total size of all the files that compose a tileset source is greater than 50 GB, MTS will return a response that contains an error
property with more details. To add multiple source files to a tileset source, post to this endpoint multiple times. This will append the uploaded files to the tileset source. To replace a tileset source with new source files, use the Replace a tileset source endpoint.
If you no longer need a tileset source, you should manually delete it after any related tilesets are finished processing using the Delete a tileset source endpoint. The related tilesets will continue working normally.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to create a tileset source. |
id | string | The ID for the tileset source to be append the new source data. |
The request body must be line-delimited GeoJSON or a supported raster file format. For information about how to convert GeoJSON or other data formats to line-delimited GeoJSON, see the Tileset sources troubleshooting guide.
Example request: Append to an existing tileset source
Response: Append to an existing tileset source
If the request is successful, the response will contain the following properties:
Property | Type | Description |
---|---|---|
file_size | integer | The size in bytes of the individual file you have added to your tileset source. |
files | integer | The total number of files in the tileset source. |
id | string | The unique identifier for the tileset source. |
source_size | integer | The total size in bytes of all the files in the tileset source. |
Example response: Append to an existing tileset source
Replace a tileset source
put
/tilesets/v1/sources/{username}/{id}
Replaces a tileset source with new source data, or creates a source if it does not exist already. If the total size of the uploaded file is greater than 20 GB, MTS will return a response that contains an error
property with more details.
If you no longer need a tileset source, you should manually delete it after any related tilesets are finished processing using the Delete a tileset source endpoint. The related tilesets will continue working normally.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to create a tileset source. |
id | string | The ID for the tileset source to be replaced. |
The request body must be line-delimited GeoJSON or a supported raster file format. For information about how to convert GeoJSON or other data formats to line-delimited GeoJSON, see the Tileset sources troubleshooting guide.
Example request: Replace a tileset source
Response: Replace a tileset source
If the request is successful, the response will contain the following properties:
Property | Type | Description |
---|---|---|
file_size | integer | The size in bytes of the individual file you have added to your tileset source. |
files | integer | The total number of files in the tileset source. |
id | string | The unique identifier for the tileset source. |
source_size | integer | The total size in bytes of all the files in the tileset source. |
Example response: Replace a tileset source
Retrieve tileset source information
get
/tilesets/v1/sources/{username}/{id}
Get information for a specific tileset source, including the number and total size of the files in the tileset source.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to retrieve tileset source information. |
id | string | The ID for the tileset source to be retrieved. |
Example request: Retrieve tileset source information
Response: Retrieve tileset source information
If the request is successful, the response will contain the following properties:
Property | Type | Description |
---|---|---|
files | integer | The total number of files in the tileset source. |
id | string | The unique identifier for the tileset source. |
size | integer | The total size in bytes of all files in the tileset source. |
size_nice | string | The total size of all files in the tileset source, in a human-readable format. |
Example response: Retrieve tileset source information
List tileset sources
get
/tilesets/v1/sources/{username}
List all the tileset sources that belong to an account. This endpoint supports pagination.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to retrieve tileset source information. |
You can further refine the results from this endpoint with the following optional parameters:
Optional parameters | Type | Description |
---|---|---|
sortby | string | Sort the listings by their created or modified timestamps. |
limit | integer | The maximum number of tileset sources to return, from 1 to 500. The default is 100. |
start | string | The tileset after which to start the listing. Find the key in the Link header of a response. See the pagination section for details. |
Example request: List tileset sources
Response: List tileset sources
If the request is successful, the response will be a list of the tileset sources that belong to the specified account. Each individual source in the list will contain the following properties:
Property | Type | Description |
---|---|---|
files | integer | The total number of files in the tileset source. |
id | string | The unique identifier for the tileset source. |
size | integer | The total size in bytes of all files in the tileset source. |
If the account has more than 2000 tileset sources, the response list will be capped at 2000.
Example response: List tileset sources
Delete a tileset source
delete
/tilesets/v1/sources/{username}/{id}
Permanently delete a tileset source and all its files. This is not a recoverable action.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to delete a tileset source. |
id | string | The ID for the tileset source to be deleted. |
Example request: Delete a tileset source
Response: Delete a tileset source
If the tileset source is successfully deleted, the response will be HTTP 204 No Content
.
Create a changeset
post
/tilesets/v1/changesets/{username}/{id}
Creates a changeset. A changeset is raw geographic data formatted as line-delimited GeoJSON uploaded to Mapbox.com. Learn more about how line-delimited GeoJSON is used by MTS in the Tileset sources guide.
Changesets are used to incrementally update vector tilesets enabled for incremental updates. They are referenced via a changeset ID. The same changeset can be used across multiple tilesets.
A changeset can be composed of up to 10 source files. Each individual source file must not exceed 20 GB. The maximum combined total size of all files that compose a tileset source is 50 GB. If the total size of all the files that compose a tileset source is greater than 50 GB, MTS will return a response that contains an error
property with more details. To add multiple source files to a changeset, see the Append to an existing changeset endpoint. To replace a changeset with new source files, use the Replace a changeset endpoint.
If you no longer need a changeset, you should manually delete it after any related tilesets are finished processing using the Delete a changeset endpoint. The related tilesets will continue working normally.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to create a changeset. |
id | string | The ID for the changeset to be created. Limited to 32 characters. The only allowed special characters are - and _. |
The request body must be line-delimited GeoJSON. For information about how to convert GeoJSON or other data formats to line-delimited GeoJSON, see the Tileset sources troubleshooting guide.
Example request: Create a changeset
Response: Create a changeset
If the request is successful, the response will contain the following properties:
Property | Type | Description |
---|---|---|
file_size | integer | The size in bytes of the individual file you have added to your changeset. |
files | integer | The total number of files in the changeset. |
id | string | The unique identifier for the changeset. |
source_size | integer | The total size in bytes of all the files in the changeset. |
Example response: Create a changeset
Append to an existing changeset
post
/tilesets/v1/changesets/{username}/{id}
Appends new source data to a changeset, or creates a changeset if it does not exist already. A changeset is raw geographic data formatted as line-delimited GeoJSON uploaded to Mapbox.com. (Learn more about how line-delimited GeoJSON is used by MTS in the Tileset sources guide.)
changesets are necessary to update incrementally updatable MTS to create a new vector or raster tileset, and they are referenced via a changeset ID. The same changeset can be used across multiple tilesets.
A changeset can be composed of up to 10 source files. Each individual source file must not exceed 20 GB. The maximum combined total size of all files that compose a changeset is 50 GB. If the total size of all the files that compose a changeset is greater than 50 GB, MTS will return a response that contains an error
property with more details. To add multiple source files to a changeset, post to this endpoint multiple times. This will append the uploaded files to the changeset. To replace a changeset with new source files, use the Replace a changeset endpoint.
If you no longer need a changeset, you should manually delete it after any related tilesets are finished processing using the Delete a tileset source endpoint. The related tilesets will continue working normally.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to create a changeset. |
id | string | The ID for the changeset to be append the new source data. |
The request body must be line-delimited GeoJSON. For information about how to convert GeoJSON or other data formats to line-delimited GeoJSON, see the Tileset sources troubleshooting guide.
Example request: Append to an existing changeset
Response: Append to an existing changeset
If the request is successful, the response will contain the following properties:
Property | Type | Description |
---|---|---|
file_size | integer | The size in bytes of the individual file you have added to your changeset. |
files | integer | The total number of files in the changeset. |
id | string | The unique identifier for the changeset. |
source_size | integer | The total size in bytes of all the files in the changeset. |
Example response: Append to an existing changeset
Replace a changeset
put
/tilesets/v1/changesets/{username}/{id}
Replaces a changeset with new source data, or creates a source if it does not exist already. If the total size of the uploaded file is greater than 20 GB, MTS will return a response that contains an error
property with more details.
If you no longer need a changeset, you should manually delete it after any related tilesets are finished processing using the Delete a changeset endpoint. The related tilesets will continue working normally.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to create a changeset. |
id | string | The ID for the changeset to be replaced. |
The request body must be line-delimited GeoJSON. For information about how to convert GeoJSON or other data formats to line-delimited GeoJSON, see the Tileset sources troubleshooting guide.
Example request: Replace a changeset
Response: Replace a changeset
If the request is successful, the response will contain the following properties:
Property | Type | Description |
---|---|---|
file_size | integer | The size in bytes of the individual file you have added to your changeset. |
files | integer | The total number of files in the changeset. |
id | string | The unique identifier for the changeset. |
source_size | integer | The total size in bytes of all the files in the changeset. |
Example response: Replace a changeset
List changesets
get
/tilesets/v1/changesets/{username}
List all the changesets that belong to an account. This endpoint supports pagination.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to retrieve changeset information. |
You can further refine the results from this endpoint with the following optional parameters:
Optional parameters | Type | Description |
---|---|---|
sortby | string | Sort the listings by their created or modified timestamps. |
limit | integer | The maximum number of changesets to return, from 1 to 500. The default is 100. |
start | string | The tileset after which to start the listing. Find the key in the Link header of a response. See the pagination section for details. |
Example request: List changesets
Response: List changesets
If the request is successful, the response will be a list of the changesets that belong to the specified account. Each individual source in the list will contain the following properties:
Property | Type | Description |
---|---|---|
files | integer | The total number of files in the changeset. |
id | string | The unique identifier for the changeset. |
size | integer | The total size in bytes of all files in the changeset. |
If the account has more than 2000 changesets, the response list will be capped at 2000.
Example response: List changesets
Delete a changeset
delete
/tilesets/v1/changesets/{username}/{id}
Permanently delete a changeset and all its files. This is not a recoverable action.
Required parameters | Type | Description |
---|---|---|
username | string | The Mapbox username of the account for which to delete a changeset. |
id | string | The ID for the changeset to be deleted. |
Example request: Delete a changeset
Response: Delete a changeset
If the changeset is successfully deleted, the response will be HTTP 204 No Content
.
Create a tileset
post
/tilesets/v1/{tileset_id}
Create a new tileset.
Required parameters | Type | Description |
---|---|---|
tileset_id | string | The ID for the tileset to be created, which is composed of your username followed by a period and the tileset's unique name (username.id). Limited to 32 characters. This character limit does not include your username. The only allowed special characters are - and _. |
The request body must be a JSON object that contains the following properties:
Required request body property | Type | Description |
---|---|---|
recipe | object | A recipe that describes how the GeoJSON data you uploaded should be transformed into tiles. For more information on how to create and format recipes, see the Recipe reference and Recipe examples. |
name | string | The name of the tileset. Limited to 64 characters. |
Additionally, the request body may contain the following optional properties:
Optional request body properties | Type | Description |
---|---|---|
private | boolean | Describes whether the tileset must be used with an access token from your Mapbox account. Default is true. |
description | string | A description of the tileset. Limited to 500 characters. |
attribution | array of objects | An array of attribution objects, each with text and link keys. Limited to three attribution objects, 80 characters maximum combined across all text values, and 1000 characters maximum combined across all link values. |
attribution.text | string | The attribution text for the tileset. |
attribution.link | string | The URL used for the tileset's attribution. |
Example request: Create a tileset
Example request body: Create a tileset
Response: Create a tileset
If a tileset with the specified ID already exists, MTS will return an HTTP 400
status code.
Update a tileset
You can update an existing tileset's source, recipe, metadata, and tiles using MTS:
- Update a tileset's source using the Update a tileset’s recipe endpoint. You can reference a new tileset source in the updated tileset recipe.
- Update a tileset’s recipe using the Update a tileset’s recipe endpoint. The updated recipe can specify a new
minzoom
,maxzoom
, and more following the rules in the MTS recipe specification. - Update a tileset's metadata using the Update tileset information MTS endpoint. You can update a tileset's name, description, private or public state, and attribution information.
- Update a tileset’s tiles using the Publish a tileset MTS endpoint. The steps to do so are outlined in the Update a tileset with MTS guide. This process can be repeated indefinitely for the same tileset when your source data updates or your recipe requires changes.
Publish a tileset
post
/tilesets/v1/{tileset_id}/publish
Once you’ve created a tileset, you can request that the data be published into vector tiles. This action will start an asynchronous process known as a job that retrieves your data and processes it into vector tiles according to the recipe you have defined.
This endpoint can also be used to update an existing tileset or to reset a tileset enabled for incremental updates. Note that due to tile caching, when updating an existing tileset new tiles will only become visible as the cached versions of those tiles expire.
A given tileset can only have one active processing publish job at a time. This ensures the data you have staged is processed before any future data you have staged is processed. If your tileset has an active publish request being processed, all later publish requests will be queued to run in the order they were received. You can only have five jobs in the queue per account.
All jobs are entered into a global Mapbox queue. The larger the queue, the longer it will take your tileset to process. For instructions on how to see the size of the queue, see the View the global queue section.
The size of a single vector tile is limited to 500 KB. If a job drops features due to tile size, this will be noted in the warnings
field of the job object.
Required parameters | Type | Description |
---|---|---|
tileset_id | string | The ID of the tileset to be published, which is composed of your username followed by a period and the tileset's unique name (username.id). |
Processing time
There are many factors that can influence the processing time when you publish a tileset, including:
- The size of the geographical area represented by the data that is being processed. For example, data for a city block will be processed much faster than data for the entire earth.
- The maximum zoom level applied to each layer. The higher the maximum zoom level, the more tiles that need to be created. Each additional zoom level creates four times as many tiles as the previous zoom level did. As an example, a maximum zoom level of
1
produces four tiles, while a maximum zoom level of2
produces 16 tiles. - The complexity of the tileset recipe, in particular filters, attributes, and union configurations will likely add to the processing time.
- The size of the global queue, which you can check with the View the global queue endpoint. MTS global queue indicates the number of tileset jobs waiting to be processed.
Example request: Publish a tileset
Response: Publish a tileset
Response: Publish a tileset using incremental updates
Response: Re-publish (reset) a tileset using incremental updates
If your recipe references a non-existent tileset source, MTS will return an HTTP 400
status code.
Publish changesets
post
/tilesets/v1/{tileset_id}/publish-changesets
Once you have enabled incremental updates on a tileset, you can request that the changeset be published into vector tiles. This action will start an asynchronous process known as a job that retrieves your data and processes it into vector tiles according to the recipe you have defined.
This endpoint is the only way to incrementally update a tileset. The tileset recipe must be unchanged since the initial publish or reset job. Note that due to tile caching, when updating an existing tileset new tiles will only become visible as the cached versions of those tiles expire.
A given tileset can only have one active processing publish job at a time. This ensures the data you have staged is processed before any future data you have staged is processed. If your tileset has an active publish request being processed, all later publish requests will be queued to run in the order they were received. You can only have five jobs in the queue per account.
All jobs are entered into a global Mapbox queue. The larger the queue, the longer it will take your tileset to process. For instructions on how to see the size of the queue, see the View the global queue section.
The size of a single vector tile is limited to 500 KB. If a job drops features due to tile size, this will be noted in the warnings
field of the job object.
Required parameters | Type | Description |
---|---|---|
tileset_id | string | The ID of the tileset to be updated, which is composed of your username followed by a period and the tileset's unique name (username.id). |
Processing time
There are many factors that can influence the processing time when you publish a tileset, including:
- The size of the geographical area represented by the data that is being processed. For example, data for a city block will be processed much faster than data for the entire earth.
- The maximum zoom level applied to each layer. The higher the maximum zoom level, the more tiles that need to be created. Each additional zoom level creates four times as many tiles as the previous zoom level did. As an example, a maximum zoom level of
1
produces four tiles, while a maximum zoom level of2
produces 16 tiles. - The complexity of the tileset recipe, in particular filters, attributes, and union configurations will likely add to the processing time.
- The size of the global queue, which you can check with the View the global queue endpoint. MTS global queue indicates the number of tileset jobs waiting
Request body - incremental-update.json file
The incremental-update.json
file in the request body should contain the tileset layers and corresponding changesets for the incremental update:
Response: Publish a changeset
MTS will return an HTTP 400
status code
- If the tileset doesn't exist
- If your recipe references a non-existent changeset
- If the publish changeset payload doesn't have the
layers
property set or it isn't an object - If the publish changeset payload references a layer which doesn't exist in the tileset to be updated
- If the layer in the publish changeset payload doesn't have the
changeset
property set - If the recipe of the tileset has changed since the most recent incremental initial or reset job
MTS will return an HTTP 404
status code
- If the tileset hasn't been published yet
- If the tileset wasn't published as an incrementally updatable tileset
MTS will return an HTTP 422
status code when all the update layers are empty (0 length).
Update tileset information
patch
/tilesets/v1/{tileset_id}
Update a tileset's information such as name, description, and privacy settings. This is not the endpoint for updating a tileset's recipe, sources, or tiles.
Optional request body properties | Type | Description |
---|---|---|
name | string | The name of the tileset. Limited to 64 characters. |
description | string | A description of the tileset. Limited to 500 characters. |
private | boolean | Describes whether the tileset must be used with an access token from your Mapbox account. |
attribution | array of objects | An array of attribution objects, each with text and link keys. Limited to three attribution objects, 80 characters maximum combined across all text values, and 1000 characters maximum combined across all link values. For more details on how attribution is displayed when multiple tilesets with custom attribution are composited together, see the attribution display section. |
attribution.text | string | The attribution text for the tileset. |
attribution.link | string | The URL used for the tileset's attribution. |
Attribution display with multiple tilesets
Custom map attribution strings are composited in reverse order of the composite request and are separated by a space character. For example, the following request to mapbox.mapbox-streets-v8,example.custom-tileset
(in which the first tileset is a Mapbox tileset and the second tileset is a custom tileset) will show attribution that looks like:
© Example Maps 2020 © Mapbox © OpenStreetMap
Example request: Update a tileset
Response: Update a tileset
Retrieve information about a single tileset job
get
/tilesets/v1/{tileset_id}/jobs/{job_id}
Retrieve information about a single job associated with a tileset, based on its unique job ID.
Required parameters | Type | Description |
---|---|---|
tileset_id | string | The ID for the tileset for which to retrieve information, which is composed of your username followed by a period and the tileset's unique name (username.id). |
job_id | string | The publish job's unique identifier. This identifier is returned in the jobId field of a Publish a tileset response. |
Example request: Retrieve information about a single tileset job
Response: Retrieve information about a single tileset job
A successful request will return a JSON response that contains the following properties:
Property | Type | Description |
---|---|---|
id | string | The publish job's unique identifier. |
stage | string | The status of the job. Possible values are queued, processing, success, failed, or superseded. The superseded stage is reserved for queued jobs that are replaced, for a newer job on that tileset to process without waiting for old queued job to finish. |
created | integer | Timestamp indicating when the job was created. |
created_nice | string | Human-readable timestamp indicating when the job was created. |
published | integer | Timestamp indicating when the job was published. |
tilesetId | string | The specified tileset's unique identifier. |
errors | array | The errors related to the tileset, if relevant. If there are no errors, this will be an empty array. For more information, see our MTS errors documentation. |
warnings | array | Any warnings related to the tileset, if relevant. If there are no warnings, this will be an empty array. For more information about warnings, see our MTS warnings documentation. |
recipe | object | The MTS recipe that was used to publish the job. |
tileset_precisions | object | An object listing the processed area in square kilometers for the precision tier (10m, 1m, 30cm, or 1cm) used by one or more layers in the job's recipe. |
cu | integer | The number of processing compute units (CUs) used by the job. |
filesize | integer | The file size in bytes of the tileset source used to publish the job. |
layer_stats | object | An object that contains statistics about the given layer. |
layer_stats.total_tiles | integer | The total number of tiles in the tileset that contain this layer. |
layer_stats.point_count | integer | The total number of point features for the layer, multiplied by the number of tiles there are in the tileset. |
layer_stats.linestring_count | integer | The total number of linestring features for the layer, multiplied by the number of tiles there are in the tileset. |
layer_stats.polygon_count | integer | The total number of polygon features for the layer, multiplied by the number of tiles there are in the tileset. |
layer_stats.capped | integer | The number of tiles in which features were no longer added to the layer during tiling due to the size of the layer. |
layer_stats.maxzoom | integer | The maximum zoom level of the layer. |
layer_stats.minzoom | integer | The minimum zoom level of the layer. |
layer_stats.checksum | string | A checksum of the geometry and attributes of the features in the layer, including the order of the features but not including their IDs. If two checksums are the same, the tiles from the two tiling jobs are almost certainly identical, but identical recipes and sources are not strictly guaranteed to produce identical checksums. |
layer_stats.zooms | object | An object that contains statistics for each zoom level in the layer: |
layer_stats.zooms.ymin | integer | The minimum y tile coordinate at the zoom level. |
layer_stats.zooms.ymax | integer | The maximum y tile coordinate at the zoom level. |
layer_stats.zooms.xmin | integer | The minimum x tile coordinate at the zoom level. |
layer_stats.zooms.xmax | integer | The maximum x tile coordinate at the zoom level. |
layer_stats.zooms.tiles | integer | The total number of tiles at this zoom level for the layer. |
layer_stats.zooms.capped | integer | The number of tiles in which features were no longer added during tiling due to the size of the layer at this zoom level. |
layer_stats.zooms.capped_list | array of objects | A list of tiles in this zoom level that exceeded the layer_size. The list may be truncated if large numbers of tiles exceeded the limit. Each element in the capped_list is an object containing a tile (referred to by its zoom/x/y coordinates) and the layer_size that would have been required for that tile to have avoided being capped (or "more than maximum" if the required size exceeds system limits). |
layer_stats.zooms.sum_area | number | The total area that tiles cover at this zoom level for the layer. |
layer_stats.zooms.sum_size | integer | The total size in bytes of all tiles for this layer at this zoom level, uncompressed. |
layer_stats.zooms.avg_size | number | The average size of a tile for this layer at this zoom level, uncompressed. |
layer_stats.zooms.max_size | integer | The maximum size of a tile at this zoom level for this layer. |
layer_stats.zooms.size_histogram | array | An array of 20 counts of tiles that shows the distribution of tile layer sizes. The first count is the number of tiles between 1 byte and 25 kilobytes, with each subsequent count representing another 25 kilobyte range, up to 500 kilobytes. Any tile layers larger than 500 kilobytes are also included in the last count. |
Example response: Retrieve information about a single tileset job
List information about all jobs for a tileset
get
/tilesets/v1/{tileset_id}/jobs
List information about all jobs associated with a tileset. You can also use this endpoint to query jobs at a specific processing stage: processing
, queued
, success
, failed
, or superseded
. This endpoint supports pagination.
Required parameter | Type | Description |
---|---|---|
tileset_id | string | The ID for the tileset for which to list all jobs, which is composed of your username followed by a period and the tileset's unique name (username.id). |
You can further refine the results from this endpoint with the following optional parameters:
Optional parameter | Type | Description |
---|---|---|
stage | string | Query for jobs at a specific processing stage: processing, queued, success, failed, or superseded. |
limit | integer | The maximum number of tilesets to return, from 1 to 500. The default is 100. |
start | string | The tileset after which to start the listing. Find the key in the Link header of a response. See the pagination section for details. |
Example request: List information about all jobs for a tileset
Response: List information about all jobs for a tileset
A successful request returns one or more JSON objects that describe a tileset's jobs. Each object will contain the following properties:
Property | Type | Description |
---|---|---|
id | string | The publish job's unique identifier. |
stage | string | The status of the job. Possible values are queued, processing, success, failed, or superseded. |
created | integer | Timestamp indicating when the job was created. |
created_nice | string | Human-readable timestamp indicating when the job was created. |
published | integer | Timestamp indicating when the job was published. |
tilesetId | string | The specified tileset's unique identifier. |
errors | array | The errors related to the tileset, if relevant. If there are no errors, this will be an empty array. For more information, see our MTS errors documentation. |
warnings | array | Any warnings related to the tileset, if relevant. If there are no warnings, this will be an empty array. For more information about warnings, see our MTS warnings documentation. |
recipe | object | The MTS recipe that was used to publish the job. |
tileset_precisions | object | Lists the processed area in square kilometers for the precision tier (10m, 1m, 30cm, or 1cm) used by one or more layers in the job's recipe. |
cu | integer | The number of processing compute units (CUs) used by the job. |
filesize | integer | The file size in bytes of the tileset source used to publish the job. |
Example response: List information about all jobs for a tileset
View the global queue
put
/tilesets/v1/queue
View the number of queued jobs in the global queue, which shows the number of jobs waiting to be processed.
Example request: View the global queue
Response: View the global queue
A request to this endpoint returns the number of jobs waiting to be processed in the global MTS queue.
Property | Type | Description |
---|---|---|
total | integer | The number of queued jobs. |
Example response: View the global queue
Validate a recipe
put
/tilesets/v1/validateRecipe
Validate a recipe document before using it to create a new tileset. The entire request body must be the recipe JSON document, which is the recipe
part of the request body property of a tileset creation request. For guidance on how to format a recipe, see the Recipe reference.
You can control the behavior of this endpoint with the following optional parameter:
Optional parameters | Type | Description |
---|---|---|
accept_invalid_sources | boolean | If true, do not validate the source URL for each layer. This allows you to validate the syntax of a recipe while it is being developed before the sources are uploaded. |
Example request: Validate a recipe
Response: Validate a recipe
The response will be a JSON object that tells you whether the recipe document is valid or not. If the recipe document is not valid, the errors
property will contain an informational message about the issue.
Example response: Validate a recipe
Valid recipe:
Recipe not valid:
Retrieve a tileset's recipe
get
/tilesets/v1/{tileset_id}/recipe
Request the recipe body that you used when you created a specific tileset.
Required parameter | Type | Description |
---|---|---|
tileset_id | string | The ID for the tileset for which to retrieve the recipe, which is composed of your username followed by a period and the tileset's unique name (username.id). |
Example request: Retrieve a tileset's recipe
Response: Retrieve a tileset's recipe
Returns the recipe body you provided when you originally created the specified tileset.
Example response: Retrieve a tileset's recipe
Update a tileset's recipe
patch
/tilesets/v1/{tileset_id}/recipe
Update a tileset’s recipe. This endpoint does a validation step on the new recipe.
Required parameter | Type | Description |
---|---|---|
tileset_id | string | The ID for the tileset for which you are updating the recipe, which is composed of your username followed by a period and the tileset's unique name (username.id). |
The entire request body must be the recipe JSON document, which is the recipe
part of the request body property of a tileset creation request.
Example request: Update a tileset's recipe
Response: Update a tileset's recipe
If the updated recipe is valid, the response will be HTTP 204 No Content
.
If the updated recipe is not valid, the errors
property will contain an informational message about the issue:
List tilesets
get
/tilesets/v1/{username}
List all the tilesets that belong to a specific account. This endpoint supports pagination. It returns a maximum of 100 tilesets by default.
Required parameter | Type | Description |
---|---|---|
username | string | The username of the account for which to list tilesets |
You can further refine the results from this endpoint with the following optional parameters:
Optional parameters | Type | Description |
---|---|---|
type | string | Filter results by tileset type, either raster, rasterarray, or vector. |
visibility | string | Filter results by visibility, either public or private. Private tilesets require an access token that belong to the owner. Public tilesets can be requested with any user's access token. |
sortby | string | Sort the listings by their created or modified timestamps. |
limit | integer | The maximum number of tilesets to return, from 1 to 500. The default is 100. |
start | string | The tileset after which to start the listing. Find the key in the Link header of a response. See the pagination section for details. |
Example request: List tilesets
Response: List tilesets
A request to MTS returns an array of tileset objects. Each tileset object contains the following properties:
Property | Type | Description |
---|---|---|
type | string | The kind of data contained, either raster, rasterarray, or vector. |
center | array | The longitude, latitude, and zoom level for the center of the contained data, given in the format [lon, lat, zoom]. |
created | string | A timestamp indicating when the tileset was created. |
description | string | A human-readable description of the tileset. |
filesize | integer | The storage in bytes consumed by the tileset. |
id | string | The unique identifier for the tileset. |
modified | string | A timestamp indicating when the tileset was last modified. |
name | string | The name of the tileset. |
visibility | string | The access control for the tileset, either public or private. |
status | string | The processing status of the tileset, one of: available, pending, or invalid. For tilesets created with the Mapbox Tiling Service, this is always set to available. To see the stage of a MTS tileset's most recent job, use the tileset jobs listing endpoint with a limit=1 query parameter. |
Example response: List tilesets
Supported libraries: List tilesets
Mapbox wrapper libraries help you integrate Mapbox APIs into your existing application. The following SDK supports this endpoint:
See the SDK documentation for details and examples of how to use the relevant methods to query this endpoint.
Delete tileset
delete
/tilesets/v1/{tileset_id}
Delete a tileset. Note that you can only delete your own tileset.
Required parameter | Type | Description |
---|---|---|
tileset_id | string | The ID of the tileset you want to delete, which is composed of your username followed by a period and the tileset's unique name (username.id). |
Example request: Delete tileset
Response: Delete tileset
get
/v4/{tileset_id}.json
Given a valid Mapbox tileset ID, returns TileJSON metadata for that tileset.
Required parameters | Type | Description |
---|---|---|
tileset_id | string | Unique identifier for the vector tileset in the format username.id. To composite multiple vector tilesets, use a comma-separated list of up to 15 tileset IDs. |
This endpoint can be further customized with the optional secure
parameter:
Optional parameters | Type | Description |
---|---|---|
secure | string | By default, resource URLs in the retrieved TileJSON (such as in the "tiles" array) will use the HTTP scheme. Include secure in your request to receive HTTPS resource URLs instead. |
Example request: Retrieve TileJSON metadata
Response: Retrieve TileJSON metadata
Returns TileJSON metadata for a tileset. The TileJSON object describes a map's resources, like tiles, markers, and UTFGrid, as well as its name, description, and centerpoint.
Example response: Retrieve TileJSON metadata
Retrieve tileset activity
get
/activity/v1/{username}/tilesets
Lists 30-day activity data for all tilesets belonging to a specific account. This endpoint supports pagination, returning 100 activity objects by default and a maximum of 500.
Required parameters | Type | Description |
---|---|---|
username | string | The username of the account for which the resource activities will be retrieved. |
You can further refine the results from this endpoint with the following optional parameters:
Optional parameters | Type | Description |
---|---|---|
sortby | string | Sort the listings by their requests or modified. The default is requests. |
orderby | string | Sort direction, asc or desc. The default is desc. |
limit | integer | The maximum number of activity data to return, from 1 to 500. The default is 100. |
start | string | The activity data after which to start the listing. Find the key in the Link header of a response. See the pagination section for details. |
Example request: Retrieve tileset activity
Response: Retrieve tileset activity
Returns an array of activity objects. Each activity object contains the following properties:
Property | Type | Description |
---|---|---|
id | string | The unique tileset Id. |
request_count | number | The total number of requests in last 30 days |
last_modified | string | A timestamp indicating when the tileset's request count was last modified. |
Example response: Retrieve tileset activity
Mapbox Tiling Service errors
Response body message | HTTP status code | Description |
---|---|---|
Not Authorized - No Token | 401 | No token was used in the query. |
Not Authorized - Invalid Token | 401 | Check the access token you used in the query. |
This endpoint requires a token with {scope} scope | 403 | The access token used in the query needs the specified scope. |
Forbidden | 403 | There may be an issue with your account. Check your Account page for more details.In some cases, using an access tokens with URL restrictions can also result in a 403 error. For more information, see our Token management guide. |
Not Found | 404 | The resource or the account does not exist. |
Cannot find tileset | 404 | Check the tileset ID you used in the query. |
The requested url's querystring \"limit\" property contains in invalid value. | 422 | The limit specified in the query is larger than 500, or contains non-numeric characters. |
Resource is locked and cannot be modified | 409 | A tileset source is "locked" when in use by an active tileset publish job. While locked the resource cannot be deleted or modified. Once a publish job is complete the resource is unlocked. |
Invalid start key | 422 | Check the start key used in the query. |
Classic styles are no longer supported; see https://blog.mapbox.com/deprecating-studio-classic-styles-d8892ac38cb4 for more information | 410 | This is a deprecation notice from API requests for Classic styles, which are no longer supported. |
For help troubleshooting common errors, see our MTS errors documentation.
Mapbox Tiling Service restrictions and limits
- You must make requests over HTTPS. HTTP is not supported.
Mapbox Tiling Service endpoint | Requests per minute | Size limits |
---|---|---|
Create a tileset source | 100 | Tileset sources can be composed of up to 10 source files.Each uploaded file must have a maximum size of 20 GB. The maximum combined total size of all files that compose a tileset source is 50 GB. If the total size of all the files that compose a tileset source is greater than 50 GB, MTS will return a response that contains an error property with more details. |
Retrieve tileset source information | 3,000 | — |
List tileset sources | 3,000 | — |
Delete a tileset source | 100 | — |
Create a tileset | 100 | — |
Publish a tileset | 2 | The size of a single vector tile is limited to 500 KB. If a job drops features due to tile size, this will be noted in the warnings field of the job object. |
Update tileset information | 100 | — |
Retrieve information about a single tileset job | 3,000 | — |
List information about all jobs for a tileset | 3,000 | — |
View the global queue | 3,000 | — |
Validate a recipe | 100 | — |
Retrieve a tileset's recipe | 3,000 | — |
Update a tileset's recipe | 100 | — |
List tilesets | 3,000 | — |
Delete a tileset | 100 | — |
Retrieve TileJSON metadata | 100,000 | — |
Retrieve tileset activity | 500 | — |
If you require a higher rate limit,contact us.
Caching
- TileJSON responses set default Cache-Control headers to
max-age=43200,s-maxage=300
, or a device cache TTL of 12 hours and a CDN cache TTL of 5 minutes. - For general information on caching, see the Maps APIs caching troubleshooting guide.
Mapbox Tiling Service pricing
- Billed by tileset processing and tileset hosting
- See rates and discounts per tileset processing and tileset hosting in the pricing page's Tilesets section
When you use the Mapbox Tiling Service, usage statistics can be reviewed on your statistics dashboard. If an account's tilesets usage exceeds the monthly free tier, you will see line items on the account's invoice for tileset processing and tileset hosting.
To see billing metrics for a specific tileset, go to your tilesets page and click on the tileset's name to visit the Tileset Explorer.
To learn more about how pricing works for this service, see the MTS pricing guide.
Additional Developer Resources