API Documentation

Free color API. No authentication required. JSON responses.

Free No Auth Required JSON

Base URL

https://colorfyi.com/api/
GET

Color Info

Get complete color information including RGB, HSL, HSV, CMYK, OKLCH, harmonies, and Tailwind shades.

/api/color/{hex}/

Parameters

hex 6-digit hex color code (without #)

Example

curl https://colorfyi.com/api/color/FF5733/
{
  "hex": "FF5733",
  "rgb": {"r": 255, "g": 87, "b": 51},
  "hsl": {"h": 11, "s": 100, "l": 60},
  "hsv": {"h": 11, "s": 80, "v": 100},
  "cmyk": {"c": 0, "m": 66, "y": 80, "k": 0},
  "oklch": {"l": 0.67, "c": 0.21, "h": 35},
  "is_light": true,
  "is_warm": true,
  "text_color": "#FFFFFF",
  "harmonies": {
    "complementary": ["33D7FF"],
    "analogous": ["FF3357", "FF8C33"],
    "triadic": ["33FF57", "5733FF"],
    ...
  },
  "shades": [
    {"level": "50", "hex": "FFF0ED"},
    {"level": "100", "hex": "FFD6CC"},
    ...
  ]
}
GET

Contrast Ratio

Calculate WCAG contrast ratio between two colors.

/api/contrast/?fg={hex}&bg={hex}

Parameters

fg Foreground color (6-digit hex)
bg Background color (6-digit hex)

Example

curl "https://colorfyi.com/api/contrast/?fg=000000&bg=FFFFFF"
{
  "fg": "000000",
  "bg": "FFFFFF",
  "ratio": 21.0,
  "aa_normal": true,
  "aa_large": true,
  "aaa_normal": true,
  "aaa_large": true
}
GET

搜索

Search named colors and brands by name or hex value.

/api/search/?q={query}

Parameters

q Search query (min 2 characters)

Example

curl "https://colorfyi.com/api/search/?q=coral"
{
  "results": [
    {"name": "Coral", "hex": "FF7F50", "type": "color", "url": "/color/coral/"},
    {"name": "Light Coral", "hex": "F08080", "type": "color", "url": "/color/light-coral/"}
  ]
}

Usage Notes

  • Free to use for any purpose
  • No API key or authentication required
  • CORS enabled for browser requests
  • Please be reasonable with request rates