Color Palette Generator API

Extract dominant colors from any image. Build themes, design tools, and product displays.

<500ms
Response
K-Means
Algorithm
1-10
Colors

How It Works

Step 1
Upload Image
Send any JPEG, PNG, or GIF image
Step 2
We Analyze
K-means clustering extracts dominant colors
Step 3
Get Palette
Receive hex colors sorted by dominance

Playground

๐Ÿ“ Drop image or click to upload

3 free requests/day without API key

Upload an image and click Extract Palette

API Documentation

Base URL
https://color-palette-opal.vercel.app
Authentication
X-API-Key: your_key (header) or ?key=your_key (query)Get your free key below
POST/api/palette

Extract dominant colors from an uploaded image using k-means clustering.

Request (multipart/form-data)

ParameterTypeRequiredDescription
imagefileyesImage file (JPEG, PNG, GIF). Max 5MB
countnumbernoNumber of colors to extract (1-10). Default: 5

Response

{
  "dominant": "#2C3E50",
  "palette": ["#2C3E50", "#E74C3C", "#ECF0F1", "#3498DB", "#2ECC71"],
  "count": 5
}

Error Responses

// 400 โ€” Bad Request
{ "error": "Missing 'image' field (multipart file upload)" }
{ "error": "Invalid image format. Supported: JPEG, PNG, GIF" }

// 401 โ€” Unauthorized
{ "error": "Invalid API key" }

// 429 โ€” Rate Limited
{ "error": "Daily limit reached. Upgrade your plan." }

Get API Key

Get a free API key for 6 requests/day. No credit card required.

Usage

  • Add header: X-API-Key: your_key
  • Or query param: ?key=your_key

Limits

  • Playground (no key): 3 req/day
  • Free tier (with key): 6 req/day
  • Paid plans: see pricing below

Pricing

Start free. Pay only when you need more.

Free
$0
  • 6 requests/day
  • Up to 5 colors
  • 5MB max
Starter
๐Ÿš€ Launch Price
$12$5/mo
  • 300 requests/day
  • Up to 10 colors
  • Priority
Business
๐Ÿš€ Launch Price
$59$29/mo
  • 5,000 requests/day
  • Up to 10 colors
  • Priority support