# Raster Tiles API

The **Digime Raster Tiles API** serves raster tiles generated from satellite imagery and raster data.

Tiles served from the Raster Tiles API can be consumed in any spatial application that supports image-based tilesets, including frontend mapping libraries like Mapbox GL JS, Leaflet, OpenLayers, as well as GIS software like QGIS.

## Retrieve raster tiles

**GET** : `https://dplace-api.themap.world/basemap/raster-tiles/{map_type}/{zoom}/{x}/{y}{@2x}.png?apikey={YOUR_API_KEY}`

| Required parameters | Type | Description |
|  --- | --- | --- |
| `map_type` | `string` | Specifies the map type. For example, `roadmap`. |
| `zoom` | `integer` | Specifies the tile's zoom level (supported from 0 to 20), as described in the [Slippy Map Tilenames](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) specification. |
| `{x}/{y}` | `integer` | Specifies the tile's column `{x}` and row `{y}`, as described in the [Slippy Map Tilenames](http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) specification. |
| `apikey` | `string` | A valid Digime API key passed as a query parameter. |


| Optional parameters | Type | Description |
|  --- | --- | --- |
| `@2x` | `string` | Request a higher DPI version of the image for high-density displays. |


### Example request: Retrieve raster tiles

```bash
# Retrieve a standard tile
$ curl "https://dplace-api.themap.world/basemap/raster-tiles/roadmap/9/407/240.png?apikey=YOUR_API_KEY"

# Retrieve a 2x tile; this tile is appropriate for high-density displays
$ curl "https://dplace-api.themap.world/basemap/raster-tiles/roadmap/9/407/240@2x.png?apikey=YOUR_API_KEY"
```

### Response: Retrieve raster tiles

The response is a raster image tile in `.png` format. For performance, image tiles are delivered with caching headers set to optimize subsequent requests.

## Raster Tiles API errors

table
thead
tr
th
Response body 
code
message
th
HTTP status code
th
Description
tbody
tr
td
code
Not Authorized - No Token
td
code
401
td
No API key was used in the query.
tr
td
code
Not Authorized - Invalid Token
td
code
401
td
Check the API key you used in the query.
tr
td
code
Forbidden
td
code
403
td
There may be an issue with your account, or the API key has restrictions.
tr
td
code
Tile not found
td
code
404
td
Check the column and row of the tile requested in the query.
tr
td
code
Zoom level must be between 0-20.
td
code
422
td
The zoom level specified in the query is larger than 20 or contains non-numeric characters.
## Raster Tiles API restrictions and limits

- The default rate limit for the Digime Raster Tiles API endpoint depends on your current pricing plan. If you require a higher rate limit, please contact our sales team.
- If you exceed the rate limit, you will receive an `HTTP 429 Too Many Requests` response.
- Responses from the Raster Tiles API set default Cache-Control headers to ensure fast delivery across edge networks.
- For general information on caching and tile performance, refer to our advanced integration guides.


## Raster Tiles API pricing

- Billed by **requests**
- See rates and discounts per tile requests in our pricing page's **Maps** section.


Usage of the Raster Tiles API is measured in **tile requests**. Details about the number of tile requests included in the free tier and the cost per request beyond what is included in the free tier are available on the pricing page.