StyleJSON Endpoint
Use the Mappinest StyleJSON endpoint to load available vector and raster map styles in MapLibre GL JS, Mapbox GL JS, or OpenLayers.
What StyleJSON is
StyleJSON is the style document used by map clients such as MapLibre GL JS, Mapbox GL JS, and OpenLayers. It defines sources, layers, colors, labels, sprites, and glyph handling through one URL.
In Mappinest, StyleJSON is exposed from a style ID such as light or streets. That gives you a stable style URL you can pass directly into supported web map clients.
Use StyleJSON for available map styles. For uploaded tilesets, use TileJSON instead.
StyleJSON endpoint
Replace styleId with one of the supported style IDs from Mappinest map styles. The same endpoint pattern works for streets, light, dark, and satellite.
curl "https://api.mappinest.com/v1/styles/light/style.json?key=YOUR_MAPPINEST_KEY"What metadata it returns
How map clients use StyleJSON
Many vector map clients can load StyleJSON directly through the map style option. The map client reads the document first and then resolves the referenced sources, sprites, glyphs, and layer rules automatically.
const apiKey = 'YOUR_MAPPINEST_KEY';
const map = new maplibregl.Map({
container: 'map',
style: `https://api.mappinest.com/v1/styles/light/style.json?key=${apiKey}`,
center: [15, 45],
zoom: 5
});Sample StyleJSON
The following example shows a shortened excerpt from the light style document. It uses the same structure as the StyleJSON endpoint, but keeps only representative fields from the full document.
const apiKey = 'YOUR_MAPPINEST_KEY';
const lightStyle = {
"version": 8,
"name": "Mappinest Light (OMT 3.15)",
"sources": {
"planet": {
"type": "vector",
"url": `https://api.mappinest.com/v1/tiles/planet_20250911.json?key=${apiKey}`,
"attribution": "© <a href='https://www.mappinest.com/legal/terms' target='_blank'>Mappinest</a>, © <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a>"
}
},
"sprite": "https://api.mappinest.com/v1/sprites/mappinest-light",
"glyphs": "https://api.mappinest.com/v1/fonts/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
"type": "background",
"paint": {
"background-color": [
"interpolate",
["linear"],
["zoom"],
9,"hsl(220, 3%, 99%)",
11,"hsl(220, 1%, 97%)"
]
}
},
{
"id": "park",
"type": "fill",
"source": "planet",
"source-layer": "park",
"filter": [
"==",
"$type",
"Polygon"
],
"layout": {
"visibility": "visible"
},
"paint": {
"fill-color": "#ededed",
"fill-opacity": [
"interpolate",
["linear"],
["zoom"],
5, 0,
6,0.6,
12,0.2
]
}
},
...
]
};The source-layer names used inside these styles broadly follow the OpenMapTiles schema. That helps when you inspect layer names or compare Mappinest style behavior with other OpenMapTiles-based styles.
What to read next
Last updated: July 3, 2026