Colors

Color object

All color endpoints return objects with this shape:

FieldTypeDescription
hexstring6-character lowercase hex code, no # prefix. e.g. "1e3a5f"
namestringNearest named color. e.g. "Midnight Explorer"
familystringHue family. One of: Red, Orange, Yellow, Green, Blue, Purple, Pink, Gray
contentobjectAI-generated descriptions. Fields may be null if not yet enriched.
content.introstring | null150-220 word introduction with character and design context.
content.use_casestring | nullWhere this color works best (industries, UI contexts). Not yet available for all colors.
conversionsobjectAlways present. Computed from the hex value.
conversions.rgbobject{ r, g, b } each 0-255.
conversions.hslobject{ h, s, l } where h is 0-360, s and l are 0-100.
conversions.oklchobject{ l, c, h } perceptual lightness, chroma, hue.
linksobjectAlways present.
links.pagestringURL to the color's info page on instantgradient.com.

GET /v1/color/:hex

Look up a single color by hex code (no # prefix). 1 credit.

Returns 404 if the hex is not in the database (4,900+ named colors are indexed).

Example

curl "https://instantgradient.com/api/v1/color/1e3a5f" \
  -H "Authorization: Bearer ig_your_key"

Response

{
  "data": {
    "hex": "1e3a5f",
    "name": "Midnight Explorer",
    "family": "Blue",
    "content": {
      "intro": "Midnight Explorer sits at the deep end of the blue family...",
      "use_case": null
    },
    "conversions": {
      "rgb": {
        "r": 30,
        "g": 58,
        "b": 95
      },
      "hsl": {
        "h": 214,
        "s": 52,
        "l": 25
      },
      "oklch": {
        "l": 0.32,
        "c": 0.08,
        "h": 255
      }
    },
    "links": {
      "page": "https://instantgradient.com/colors/1e3a5f"
    }
  },
  "meta": {
    "request_id": "req_abc123def456",
    "api_version": "v1",
    "credits_used": 1,
    "credits_remaining": 494,
    "daily_limit": 500
  }
}

GET /v1/colors

Search and browse the color database. 1 credit per item returned.

Supports filtering by name (case-insensitive substring match) and/or hue family. If you request more items than you have credits remaining, the response is truncated. See Rate Limits.

Parameters

ParamTypeDefaultDescription
qstring-Search by name (case-insensitive substring match)
familiesstring-Comma-separated families (OR logic). Values: Red, Orange, Yellow, Green, Blue, Purple, Pink, Gray
limitint10Results per page (1-50)
offsetint0Pagination offset

Example

curl "https://instantgradient.com/api/v1/colors?families=Blue,Purple&limit=5" \
  -H "Authorization: Bearer ig_your_key"

Response

Same color object shape as above, in an array with pagination. See the Palettes page for the pagination object fields (they are identical).