Palettes

Palette object

All palette endpoints return objects with this shape:

FieldTypeDescription
colorsstring[]Array of hex color codes, lowercase, no # prefix. e.g. ["1e3a5f", "4a7fa7"]
infoobject | nullEnrichment data. Null if the palette is not published (e.g. freshly generated with no DB match).
info.namestringHuman-readable palette name. e.g. "Harbor Dusk"
info.taglinestringOne-sentence description. e.g. "A coastal evening palette with steel blues fading into warm sand."
info.slugstringURL-safe identifier. Used in /palette/:slug lookups and page URLs.
info.tagsstring[]Descriptive tags. e.g. ["warm", "coastal", "blue"]
statsobjectAlways present.
stats.save_countnumberNumber of users who saved this palette. 0 if not in the database.
linksobjectAlways present.
links.pagestring | nullURL to the palette's public page on instantgradient.com. Null if not published.
links.generatorstringURL that opens the generator pre-loaded with these colors.

GET /v1/palette/generate

Generate a harmonious palette using the same algorithm as the editor. 1 credit.

If the generated colors match a published palette in the database (same color hash), the response includes full enrichment data in info. Otherwise info is null.

Parameters

ParamTypeDefaultDescription
sizeint5Number of colors (2-8). Must be an integer.

Example

curl "https://instantgradient.com/api/v1/palette/generate?size=5" \
  -H "Authorization: Bearer ig_your_key"

Response

{
  "data": {
    "colors": [
      "1e3a5f",
      "4a7fa7",
      "aecbd6",
      "f4d7b5",
      "e8926b"
    ],
    "info": {
      "name": "Harbor Dusk",
      "tagline": "A coastal evening palette with steel blues fading into warm sand.",
      "slug": "harbor-dusk",
      "tags": [
        "warm",
        "coastal",
        "blue"
      ]
    },
    "stats": {
      "save_count": 42
    },
    "links": {
      "page": "https://instantgradient.com/palette/harbor-dusk",
      "generator": "https://instantgradient.com/app/1e3a5f-4a7fa7-aecbd6-f4d7b5-e8926b"
    }
  },
  "meta": {
    "request_id": "req_abc123def456",
    "api_version": "v1",
    "credits_used": 1,
    "credits_remaining": 494,
    "daily_limit": 500
  }
}

GET /v1/palette/:slug

Look up a single published palette by its slug. 1 credit.

Returns 404 if the slug does not exist or the palette is not published. The response is the same palette object shape as above, always fully populated.

Example

curl "https://instantgradient.com/api/v1/palette/harbor-dusk" \
  -H "Authorization: Bearer ig_your_key"

GET /v1/palettes

Browse published community palettes. 1 credit per item returned.

If you request more items than you have credits remaining, the response is truncated and pagination.truncated is set to true. See Rate Limits.

Parameters

ParamTypeDefaultDescription
sortstringpopularpopular (by save count) or recent (by publish date)
tagsstring-Comma-separated tag filter (OR logic). e.g. tags=warm,pastel
limitint10Results per page (1-50)
offsetint0Pagination offset

Pagination

FieldTypeDescription
totalnumberTotal matching palettes across all pages.
limitnumberThe limit you requested.
offsetnumberCurrent offset.
returnednumberActual number of items in this response (may be less than limit).
truncatedbooleanTrue if the response was truncated due to insufficient credits.
truncated_reasonstringPresent when truncated. Value: "credit_limit".

Example

curl "https://instantgradient.com/api/v1/palettes?tags=warm,pastel&sort=popular&limit=5" \
  -H "Authorization: Bearer ig_your_key"