ColorIndicator Developer API

Image color analysis for your application

Upload a JPEG, PNG, or WebP image and receive dominant colors, HEX, RGB, HSL, and palette proportions as JSON.

Input

JPEG, PNG, WebP

Free beta

100 analyses / month

Endpoint

POST /api/v1/analyze

Authentication

Bearer API key

Quickstart

Your first analysis

Keep API keys on your server. Do not embed a key in browser JavaScript, mobile binaries, or public repositories.

curl -X POST "https://colorindicator.com/api/v1/analyze?palette_size=5" \
  -H "Authorization: Bearer $COLORINDICATOR_API_KEY" \
  -F "image=@photo.jpg"

JavaScript

import { readFile } from "node:fs/promises";

const bytes = await readFile("./photo.jpg");
const form = new FormData();
form.append("image", new Blob([bytes], { type: "image/jpeg" }), "photo.jpg");

const response = await fetch("https://colorindicator.com/api/v1/analyze?palette_size=5", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.COLORINDICATOR_API_KEY}` },
  body: form,
});

console.log(await response.json());

Python

import os
import requests

with open("photo.jpg", "rb") as image:
    response = requests.post(
        "https://colorindicator.com/api/v1/analyze",
        params={"palette_size": 5},
        headers={"Authorization": f"Bearer {os.environ['COLORINDICATOR_API_KEY']}"},
        files={"image": ("photo.jpg", image, "image/jpeg")},
        timeout=15,
    )

response.raise_for_status()
print(response.json())

Response

The first palette entry is also returned as dominant. Proportions range from 0 to 1. HSL values use degrees and percentages.

{
  "data": {
    "palette": [
      {
        "hex": "#4E47DA",
        "rgb": [78, 71, 218],
        "hsl": { "h": 243, "s": 67, "l": 57 },
        "proportion": 0.5057
      }
    ],
    "dominant": {
      "hex": "#4E47DA",
      "rgb": [78, 71, 218],
      "hsl": { "h": 243, "s": 67, "l": 57 },
      "proportion": 0.5057
    }
  },
  "request_id": "req_…"
}

Try the API

Use a beta key to run a real request against the versioned endpoint.

The key stays in this page session and is not saved by the playground.

Choose an image and enter a beta API key.

Limits and errors

  • Images may be up to 5MB and 20 megapixels.
  • palette_size accepts values from 1 to 10.
  • Free beta keys include 100 successful analyses each calendar month.
  • A short burst limit protects service availability.
  • 401: missing or invalid API key.
  • 413: image exceeds the upload limit.
  • 415: unsupported image type.
  • 429: minute or monthly quota reached.

Image color analysis powered by ColorIndicator