Miscellaneous API Documentation

This section covers miscellaneous utility APIs that don't fit into other categories.

Authentication: All API endpoints require an API key to be passed in the X-API-Key header.

Get Color Palettes

Endpoint
GET /api/misc/colors/
Description

Get available color palettes for data visualization.

Headers
Name Required Description
X-API-Key Yes Your API key in UUID format
Query Parameters
Parameter Type Required Description
category string No Filter by category (sequential, diverging, qualitative). If not provided, returns all categories.
samples boolean No Include sample color values (true/false). Default: false
Response

Returns a list of available color palettes grouped by category.

Example Response (200 OK)
{
  "categories": [
    {
      "name": "sequential",
      "description": "Color palettes that progress from low to high using a single hue or multiple hues",
      "palettes": [
        {
          "name": "viridis",
          "description": "Perceptually uniform colormap from matplotlib",
          "type": "sequential",
          "samples": ["#440154", "#482878", "#3e4989", "#31688e", "#26828e", "#1f9e89", "#35b779", "#6ece58", "#b5de2b", "#fde725"]
        },
        {
          "name": "plasma",
          "description": "Perceptually uniform colormap from matplotlib",
          "type": "sequential",
          "samples": ["#0d0887", "#41049d", "#6a00a8", "#8f0da4", "#b12a90", "#cc4778", "#e16462", "#f2844b", "#fca636", "#fcce25", "#f0f921"]
        },
        {
          "name": "inferno",
          "description": "Perceptually uniform colormap from matplotlib",
          "type": "sequential",
          "samples": ["#000004", "#160b39", "#420a68", "#6a176e", "#932667", "#bc3754", "#dd513a", "#f37819", "#fca50a", "#f6d746", "#fcffa4"]
        }
      ]
    },
    {
      "name": "diverging",
      "description": "Color palettes that have a defined midpoint and progress to two different colors on either end",
      "palettes": [
        {
          "name": "RdBu",
          "description": "Red to Blue diverging colormap",
          "type": "diverging",
          "samples": ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"]
        },
        {
          "name": "BrBG",
          "description": "Brown to Blue-Green diverging colormap",
          "type": "diverging",
          "samples": ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e", "#003c30"]
        }
      ]
    },
    {
      "name": "qualitative",
      "description": "Color palettes that use distinct colors to represent categorical data",
      "palettes": [
        {
          "name": "Set1",
          "description": "Set1 qualitative colormap",
          "type": "qualitative",
          "samples": ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628", "#f781bf", "#999999"]
        },
        {
          "name": "Set2",
          "description": "Set2 qualitative colormap",
          "type": "qualitative",
          "samples": ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f", "#e5c494", "#b3b3b3"]
        }
      ]
    }
  ]
}
Error Responses
Status Code Description
400 Bad Request - Invalid parameters
401 Unauthorized - Missing API key
403 Forbidden - Invalid API key
500 Internal Server Error

Using Color Palettes

Color palettes can be used with various visualization endpoints:

Example Usage with DEM API
GET /api/dem/?geometry_id=123e4567-e89b-12d3-a456-426614174000&format=png&colormap=viridis
Example Usage with Sentinel-2 API
GET /api/s2/image/123e4567-e89b-12d3-a456-426614174000/?item_id=S2A_MSIL2A_20230105T123456_N0509_R123_T18TXM_20230105T150000&image_type=png&index=ndvi
Color Palette Categories
Category Description Best Used For
Sequential Progress from low to high using a single hue or multiple hues Continuous data that has a natural ordering (e.g., elevation, temperature)
Diverging Have a defined midpoint and progress to two different colors on either end Data with a meaningful midpoint (e.g., temperature anomalies, NDVI)
Qualitative Use distinct colors to represent categorical data Categorical data without inherent ordering (e.g., land cover types)