Docs
Two small, static APIs. No keys, no sign-up. Responses are cached at the edge and change only when a palette does.
Palette API
Base URL https://palette.geocolor.app
| Request | Returns |
|---|---|
GET /v1/palettes | All palettes with id, name, type and number of classes. |
GET /v1/palettes/{id} | One palette with its colors as hex strings. |
GET /v1/palettes/{id}.css | CSS custom properties, --gc-{id}-1 to --gc-{id}-n. |
GET /v1/palettes/{id}.svg | A swatch strip for docs and legends. |
curl https://palette.geocolor.app/v1/palettes/deep-water
{
"id": "deep-water",
"name": "Deep Water",
"type": "sequential",
"classes": 5,
"colors": ["#f7fbff", "#c6dbef", "#6baed6", "#2171b5", "#08306b"]
}
In JavaScript
const res = await fetch("https://palette.geocolor.app/v1/palettes/ember");
const { colors } = await res.json();
map.setPaintProperty("counties", "fill-color",
["step", ["get", "density"], colors[0], 10, colors[1], 50, colors[2], 200, colors[3], 1000, colors[4]]);
Preview tiles
Base URL https://tiles.geocolor.app. Raster PNG, 256 px, XYZ scheme, zoom 0 to 4.
| Style | Land ramp | TileJSON |
|---|---|---|
terrain | Meadow to Clay | /terrain.json |
alpine | Alpine | /alpine.json |
dusk | Aurora | /dusk.json |
L.tileLayer("https://tiles.geocolor.app/terrain/{z}/{x}/{y}.png", {
maxZoom: 4,
attribution: "© GeoColor"
}).addTo(map);
Limits
Both APIs are free under fair use. If you expect more than a few thousand requests a day, cache responses or copy the palettes into your project, they are just hex codes. Questions: hello@geocolor.app.