# Styles API

The **Digime Styles API** serves map style documents used to render vector tiles in libraries like Mapbox GL JS and MapLibre GL JS.

A style is a JSON document that defines the visual appearance of a map: which sources to draw from, the layers to render, and how those layers are painted (colors, fonts, icons, and so on).

## Retrieve a style

**GET** : `https://dplace-api.themap.world/basemap/styles/{style_name}.json?apikey={YOUR_API_KEY}`

| Required parameters | Type | Description |
|  --- | --- | --- |
| `style_name` | `string` | Specifies the name of the style. See [Available styles](#available-styles) below. |
| `apikey` | `string` | A valid Digime API key passed as a query parameter. |


### Available styles

| Style name | Description |
|  --- | --- |
| `dgm_light` | DGM Light — the default light-themed basemap style. |


More styles will be added in the future.

### Example request: Retrieve a style

```bash
$ curl "https://dplace-api.themap.world/basemap/styles/dgm_light.json?apikey=YOUR_API_KEY"
```

### Response: Retrieve a style

The response is a JSON document, following the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), that can be passed directly to a compatible map rendering library, for example:

```js
map = new maplibregl.Map({
  container: "map",
  style: "https://dplace-api.themap.world/basemap/styles/dgm_light.json?apikey=YOUR_API_KEY",
  center: [106.700981, 10.775848],
  zoom: 12,
});
```

## Styles 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
Style {style_name} does not exist
td
code
404
td
Check the name of the style you used in the query.
## Styles API restrictions and limits

- The default rate limit for the Digime Styles 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 Styles API set default Cache-Control headers to ensure fast delivery across edge networks.


## Styles API pricing

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


Usage of the Styles API is measured in **style requests**. Details about the number of style 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.