Colors API
ToolsMAINTAINED1 token / call

Colors API

Name, convert and check contrast for any color, with 31,919 curated names and WCAG math

Everything a product does with color, in one API. 31,919 human-curated color names (the MIT color-names project, with its quality flag — nearest-name defaults to the 4,962 curated best names so #ff5733 comes back 'Orange Soda', not something unpronounceable) plus all CSS named colors with their spec keywords. Convert anything to everything: feed it hex (#ff5733, short #f53), rgb(255,87,51), bare '255,87,51' or hsl(11,100%,60%) and get hex, RGB, HSL, HSV, CMYK, WCAG relative luminance, a dark/light flag, the nearest curated name AND the nearest CSS keyword (tomato, 23.3 away). Generate named palettes — complementary, analogous, triadic, tetradic, split-complementary, monochromatic, shades, tints — with the base color preserved exactly (no HSL round-trip drift). Check WCAG accessibility: contrast ratio with AA/AAA pass-fail for normal and large text (black on white = 21). Search 32k names ('sunset' → 74 colors), filter to curated or CSS sets, or grab a random one. Design tools, theme builders, accessibility linters, data-viz libraries, e-commerce swatch naming — one token per call.

Every call needs an X-Api-Key header. A free key includes 500 tokens a month, no card required. 1 token per call, so the free plan covers about 500 calls a month.

No credit card requiredAccess to 125+ APIsCancel anytime
response.json
{
  "ok": true,
  "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": 65.88,
    "y": 80,
    "k": 0
  },
  "luminance": 0.283,
  "is_dark": false,
  "name": {
    "hex": "#fa5b3d",
    "name": "Orange Soda",
    "is_bestof": true,
    "is_css": false,
    "distance": 11.87,
    "exact": false
  },
  "nearest_css": {
    "hex": "#ff6347",
    "name": "tomato",
    "distance": 23.32
  }
}
Production Ready
Battle-tested infrastructure with a 99.9% uptime SLA. Rate limits are generous, responses are consistent.
Simple Integration
Standard REST + JSON. Works with any HTTP client. Copy-ready code snippets in 4 languages.
One Key, 125+ APIs
Your DataAndAPIs subscription unlocks every API on the platform — anime, finance, sports, and more.

Use cases for Colors API

  • Label a user-picked color with a human name in a design tool, theme editor or product configurator.

  • Convert between hex, RGB, HSL, HSV and CMYK in one call for export, print and CSS generation.

  • Check text and background pairs against WCAG AA and AAA thresholds in an accessibility linter or design system.

  • Generate complementary, analogous, triadic and tint-shade palettes from a brand color.

Colors API endpoints

Every endpoint with its parameters and a real example response.

GETConvert Color

https://api-colors.dataandapis.com/v1/colors/convert

Query parameters

ParameterExample
value#FF5733Required

Example request

curl "https://api-colors.dataandapis.com/v1/colors/convert?value=%23FF5733" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "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": 65.88,
    "y": 80,
    "k": 0
  },
  "luminance": 0.283,
  "is_dark": false,
  "name": {
    "hex": "#fa5b3d",
…
Show full response
{
  "ok": true,
  "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": 65.88,
    "y": 80,
    "k": 0
  },
  "luminance": 0.283,
  "is_dark": false,
  "name": {
    "hex": "#fa5b3d",
    "name": "Orange Soda",
    "is_bestof": true,
    "is_css": false,
    "distance": 11.87,
    "exact": false
  },
  "nearest_css": {
    "hex": "#ff6347",
    "name": "tomato",
    "distance": 23.32
  }
}

GETData Sources

https://api-colors.dataandapis.com/v1/sources

This endpoint takes no parameters.

Example request

curl "https://api-colors.dataandapis.com/v1/sources" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "sources": [
    {
      "slug": "color-names",
      "name": "meodai color-names",
      "publisher": "meodai and contributors",
      "licence": "MIT",
      "source_url": "https://github.com/meodai/color-names",
      "file_url": "https://raw.githubusercontent.com/meodai/color-names/main/src/colornames.csv",
      "cadence": "community-updated; occasional re-scrape",
      "record_count": 31916,
      "retrieved_at": "2026-09-06"
    },
    {
      "slug": "css-colors",
      "name": "CSS named colors",
      "publisher": "W3C CSS Color Module",
      "licence": "W3C spec constants",
      "source_url": "https://www.w3.org/TR/css-color-4/#named-colors",
      "file_url": null,
      "cadence": "static",
      "record_count": 139,
      "retrieved_at": "2026-09-06"
    }
  ]
}

GETGenerate Palette

https://api-colors.dataandapis.com/v1/colors/palette

Query parameters

ParameterExample
count5Optional
modetriadicOptional
value1e90ffRequired

Example request

curl "https://api-colors.dataandapis.com/v1/colors/palette?count=5&mode=triadic&value=1e90ff" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "base": "#1e90ff",
  "mode": "triadic",
  "palette": [
    {
      "hex": "#1e90ff",
      "hsl": {
        "h": 210,
        "s": 100,
        "l": 55.88
      },
      "name": "Pool Water"
    },
    {
      "hex": "#ff1e8e",
      "hsl": {
        "h": 330,
        "s": 100,
        "l": 55.88
      },
      "name": "Fluorescent Pink"
    },
    {
      "hex": "#8eff1e",
      "hsl": {
        "h": 90,
        "s": 100,
…
Show full response
{
  "ok": true,
  "base": "#1e90ff",
  "mode": "triadic",
  "palette": [
    {
      "hex": "#1e90ff",
      "hsl": {
        "h": 210,
        "s": 100,
        "l": 55.88
      },
      "name": "Pool Water"
    },
    {
      "hex": "#ff1e8e",
      "hsl": {
        "h": 330,
        "s": 100,
        "l": 55.88
      },
      "name": "Fluorescent Pink"
    },
    {
      "hex": "#8eff1e",
      "hsl": {
        "h": 90,
        "s": 100,
        "l": 55.88
      },
      "name": "Loud Lime"
    }
  ]
}

GETName a Color

https://api-colors.dataandapis.com/v1/colors/name

Query parameters

ParameterExample
alltrueOptional
count3Optional
value40e0d0Required

Example request

curl "https://api-colors.dataandapis.com/v1/colors/name?all=true&count=3&value=40e0d0" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "query": "#40e0d0",
  "pool": "all 31,919 names",
  "matches": [
    {
      "hex": "#40e0d0",
      "name": "Fresh Turquoise",
      "is_bestof": false,
      "is_css": true,
      "distance": 0,
      "exact": true
    },
    {
      "hex": "#48d1cc",
      "name": "Medium Turquoise",
      "is_bestof": false,
      "is_css": true,
      "distance": 17.46,
      "exact": false
    },
    {
      "hex": "#45e9c1",
      "name": "Aphrodite Aqua",
      "is_bestof": true,
      "is_css": false,
      "distance": 18.19,
      "exact": false
…
Show full response
{
  "ok": true,
  "query": "#40e0d0",
  "pool": "all 31,919 names",
  "matches": [
    {
      "hex": "#40e0d0",
      "name": "Fresh Turquoise",
      "is_bestof": false,
      "is_css": true,
      "distance": 0,
      "exact": true
    },
    {
      "hex": "#48d1cc",
      "name": "Medium Turquoise",
      "is_bestof": false,
      "is_css": true,
      "distance": 17.46,
      "exact": false
    },
    {
      "hex": "#45e9c1",
      "name": "Aphrodite Aqua",
      "is_bestof": true,
      "is_css": false,
      "distance": 18.19,
      "exact": false
    }
  ]
}

GETRandom Color

https://api-colors.dataandapis.com/v1/colors/random

Query parameters

ParameterExample
bestoftrueOptional

Example request

curl "https://api-colors.dataandapis.com/v1/colors/random?bestof=true" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "color": {
    "hex": "#c27f38",
    "name": "Ginger Beer",
    "is_bestof": true,
    "is_css": false,
    "rgb": {
      "r": 194,
      "g": 127,
      "b": 56
    },
    "hsl": {
      "h": 31,
      "s": 55.2,
      "l": 49.02
    },
    "hsv": {
      "h": 31,
      "s": 71.13,
      "v": 76.08
    },
    "cmyk": {
      "c": 0,
      "m": 34.54,
      "y": 71.13,
      "k": 23.92
    },
…
Show full response
{
  "ok": true,
  "color": {
    "hex": "#c27f38",
    "name": "Ginger Beer",
    "is_bestof": true,
    "is_css": false,
    "rgb": {
      "r": 194,
      "g": 127,
      "b": 56
    },
    "hsl": {
      "h": 31,
      "s": 55.2,
      "l": 49.02
    },
    "hsv": {
      "h": 31,
      "s": 71.13,
      "v": 76.08
    },
    "cmyk": {
      "c": 0,
      "m": 34.54,
      "y": 71.13,
      "k": 23.92
    },
    "luminance": 0.269,
    "is_dark": false
  }
}

GETSearch Colors

https://api-colors.dataandapis.com/v1/colors

Query parameters

ParameterExample
bestoftrueOptional
cssOptional
qsunsetOptional

Example request

curl "https://api-colors.dataandapis.com/v1/colors?bestof=true&q=sunset" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "page": 1,
  "limit": 25,
  "total": 8,
  "total_pages": 1,
  "colors": [
    {
      "hex": "#dd8869",
      "name": "Canyon Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#eb9f9f",
      "name": "Cosy Summer Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#b52604",
      "name": "Crimson Velvet Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#f88517",
      "name": "Glorious Sunset",
…
Show full response
{
  "ok": true,
  "page": 1,
  "limit": 25,
  "total": 8,
  "total_pages": 1,
  "colors": [
    {
      "hex": "#dd8869",
      "name": "Canyon Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#eb9f9f",
      "name": "Cosy Summer Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#b52604",
      "name": "Crimson Velvet Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#f88517",
      "name": "Glorious Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#c38d87",
      "name": "Grand Sunset",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#e95e2a",
      "name": "Sunset Blaze",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#f6c362",
      "name": "Sunset Gold",
      "is_bestof": true,
      "is_css": false
    },
    {
      "hex": "#fd5e53",
      "name": "Sunset Orange",
      "is_bestof": true,
      "is_css": false
    }
  ]
}

GETWCAG Contrast

https://api-colors.dataandapis.com/v1/colors/contrast

Query parameters

ParameterExample
bgffffffRequired
fg000000Required

Example request

curl "https://api-colors.dataandapis.com/v1/colors/contrast?bg=ffffff&fg=000000" \
  -H "X-Api-Key: YOUR_API_KEY"
Example response
{
  "ok": true,
  "fg": "#000000",
  "bg": "#ffffff",
  "contrast_ratio": 21,
  "wcag": {
    "aa_normal_text": true,
    "aa_large_text": true,
    "aaa_normal_text": true,
    "aaa_large_text": true
  }
}

Where the data comes from

Source
The color-names project (MIT, 31,919 names with a curated best-of flag) and the CSS Color specification keywords, with WCAG 2 contrast math.
Freshness
Static reference data computed on every call. The name list is updated with each release.

One install. Every endpoint.

No proprietary SDKs needed. Any HTTP client works. Pick your language and paste.

3languages
7endpoints
RESTarchitecture
1key for all APIs
  • Fully typed responses — auto-completion in your IDE
  • Tracks the API in lockstep — new endpoints land same day
  • One key works across 125+ APIs on the platform
import axios from 'axios';

const { data } = await axios.get(
  'https://api-colors.dataandapis.com/v1/colors/convert',
  { headers: { 'X-Api-Key': process.env.API_KEY } }
);

Colors API · X-Api-Key

Explore the endpoints

Browse request parameters and inspect live example responses.

Available Endpoints

Request Parameters

API URL

Headers

X-Api-Key

Query Parameters

value(Required)
import axios from 'axios';

const url = 'https://api-colors.dataandapis.com/v1/colors/convert';
const { data } = await axios.get(url, {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' }
});

One subscription. Every API.

Tokens unlock this API and 125+ others on DataAndAPIs. Switch APIs any time — we promote.

FREE

$0/mo

500 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Community support
Start free
Most Popular

STARTER

$6.99/mo

25,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Email support
Subscribe

PRO

$24.99/mo

100,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Priority email support
Subscribe

ULTRA

$99.99/mo

1,000,000 tokens / month

  • Access to all APIs
  • Tokens reset monthly
  • Priority support
Subscribe

Need higher volume, dedicated infra, or a custom contract? Talk to sales →

Questions about Colors API

Ship Colors API this afternoon.

500 free tokens. No card. Plus 125+ other APIs on the same key.