Website color palette API documentation

Extract brand color palettes from any public website URL

Give Me Colors analyzes static HTML, CSS, metadata, and optional visual assets to return structured hex colors, RGB values, percentages, confidence scores, and evidence sources.

Overview

Brand color extraction for developer products

Give Me Colors is an API for extracting useful brand and theme color palettes from public website URLs. It fetches static HTML, reads page metadata, analyzes inline styles and linked CSS, optionally samples favicons and OpenGraph images, and returns a structured palette for design tools, AI website builders, lead enrichment systems, brand analysis workflows, internal dashboards, and marketing tools.

Static-first v1 Give Me Colors v1 does not run JavaScript or browser automation. That keeps the API fast, deterministic, and lightweight, but JavaScript-rendered styles may be missing.
Public API access
Subscribe on RapidAPI, then use the endpoint and host shown in your RapidAPI dashboard.
RapidAPI base URL
https://YOUR_RAPIDAPI_HOST
Main endpoint
POST /v1/palette

Quick start

Call POST /v1/palette with a website URL

Subscribe on RapidAPI, copy your key and host value, then send a JSON request to POST /v1/palette.

RapidAPI POST example
curl -X POST "https://YOUR_RAPIDAPI_HOST/v1/palette" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
  -d '{
    "input": "https://example.com",
    "colors": 8,
    "max_assets": 0
  }'
Response preview
{
  "source": {
    "input": "https://example.com",
    "kind": "website",
    "final_url": "https://example.com/",
    "title": "Example Domain",
    "description": null,
    "canonical_url": null,
    "metadata": {
      "theme_color": null,
      "og_image": null,
      "favicon": null
    }
  },
  "palette_block": [
    { "hex": "#EEEEEE", "percentage": 72.7 },
    { "hex": "#334488", "percentage": 27.3 }
  ],
  "palette": [
    {
      "hex": "#EEEEEE",
      "rgb": [238, 238, 238],
      "percentage": 72.7,
      "confidence": 0.42,
      "sources": ["matched_css_selector"]
    }
  ],
  "warnings": [
    {
      "code": "NO_JS_RENDERING",
      "message": "This analysis used static HTML/CSS/assets only. JavaScript-rendered styles may be missing."
    }
  ]
}

Authentication

Use RapidAPI for public access

Use the RapidAPI headers shown in your subscription dashboard. RapidAPI handles API keys, plan quotas, usage tracking, and billing for public access.

RapidAPI consumer headers

  • X-RapidAPI-Key: your RapidAPI key
  • X-RapidAPI-Host: the exact host value shown by RapidAPI
  • Content-Type: application/json

Key handling

For production apps, send Give Me Colors requests from your backend or serverless function. This keeps your RapidAPI key out of public browser bundles and lets you add caching, retries, and per-user controls.

Endpoints

Palette analysis, health, and OpenAPI routes

POST /v1/palette

Primary production endpoint. Accepts a JSON body with URL and analysis options.

GET /v1/palette

Query-parameter variant for quick tests and simple examples.

POST /v1/analyze

Alias for POST /v1/palette. Keep /v1/palette as the main documented endpoint.

GET /openapi.yaml

Returns the OpenAPI 3.1 specification.

GET /healthz

Returns basic service health: {"status":"ok","service":"givemecolors-api"}.

RapidAPI GET query example
curl "https://YOUR_RAPIDAPI_HOST/v1/palette?input=https%3A%2F%2Fexample.com&colors=8&max_assets=0" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST"

Request body

Analysis options for speed, depth, and palette size

POST /v1/palette body
{
  "input": "https://example.com",
  "colors": 8,
  "ignore_neutrals": false,
  "timeout_seconds": 10,
  "max_css_files": 8,
  "max_assets": 5
}
FieldTypeRequiredDefaultMinMaxDescription
inputstringyesnonen/an/aPublic http or https website URL to analyze.
colorsintegerno8132Number of palette colors to return.
ignore_neutralsbooleannofalsen/an/aReduces neutral color influence when scoring the palette.
timeout_secondsintegerno10130Per-request upstream fetch timeout.
max_css_filesintegerno8032Maximum linked CSS files to fetch and analyze.
max_assetsintegerno5032Maximum linked visual assets to fetch and analyze. Use 0 for faster CSS-focused analysis.

Recommended demo settings

Use stricter, faster settings for homepage demos and public previews.

Demo options
{
  "colors": 6,
  "ignore_neutrals": false,
  "timeout_seconds": 5,
  "max_css_files": 4,
  "max_assets": 0
}

Balanced production defaults

Use the API defaults for a richer brand palette that can include linked visual assets.

  • colors: 8
  • timeout_seconds: 10
  • max_css_files: 8
  • max_assets: 5

Response schema

Hex colors, RGB values, percentages, confidence, and evidence

Successful response
{
  "source": {
    "input": "https://example.com",
    "kind": "website",
    "final_url": "https://example.com/",
    "title": "Example Domain",
    "description": null,
    "canonical_url": null,
    "metadata": {
      "theme_color": null,
      "og_image": null,
      "favicon": null
    }
  },
  "palette_block": [
    { "hex": "#EEEEEE", "percentage": 72.7 },
    { "hex": "#334488", "percentage": 27.3 }
  ],
  "palette": [
    {
      "hex": "#EEEEEE",
      "rgb": [238, 238, 238],
      "percentage": 72.7,
      "confidence": 0.42,
      "sources": ["matched_css_selector"]
    }
  ],
  "warnings": [
    {
      "code": "NO_JS_RENDERING",
      "message": "This analysis used static HTML/CSS/assets only. JavaScript-rendered styles may be missing."
    }
  ]
}
FieldTypeDescription
sourceobjectInformation about the analyzed URL and page metadata.
palette_blockarrayCompact hex colors and percentages for visual rendering.
palettearrayDetailed colors with hex, RGB, percentage, confidence, and evidence.
warningsarrayNon-fatal analysis notes, such as missing JavaScript-rendered styles.

Source fields

FieldTypeDescription
source.inputstringOriginal requested URL.
source.kindstringwebsite or image. Public API input is URL-based.
source.final_urlstring or nullFinal URL after validated redirects.
source.titlestring or nullHTML document title when available.
source.descriptionstring or nullPage description metadata when available.
source.canonical_urlstring or nullCanonical URL metadata when available.
source.metadata.theme_colorstring or nullMeta theme-color value when found.
source.metadata.og_imagestring or nullOpenGraph image URL when found.
source.metadata.faviconstring or nullFavicon URL when found.

Palette fields

FieldTypeDescription
hexstringUppercase six-digit hex color, such as #2563EB.
rgbarrayThree integers from 0 to 255. Included in detailed palette items.
percentagenumberEstimated usage or importance percentage.
confidencenumberRelative confidence score based on evidence strength.
sourcesarrayDescriptive evidence labels explaining where the color was found.

Possible sources values can include CSS variables, matched CSS selectors, inline styles, metadata, SVG colors, raster image evidence, favicon evidence, logo image evidence, or OpenGraph image evidence. Treat sources as descriptive labels, not a fixed enum.

Errors and rate limits

Handle expected failures as product states

All error responses use {"error":{"code":"ERROR_CODE","message":"Human-readable message"}}.

StatusCodeMeaning
400INVALID_INPUTURL or input is invalid, unsupported, blocked, or unsafe.
400INVALID_OPTIONSRequest options are outside allowed ranges.
401UNAUTHORIZEDRapidAPI credentials are missing or invalid.
422NO_COLORSThe URL was valid, but no useful colors were found.
422IMAGE_DECODE_FAILEDA direct image URL or asset could not be decoded.
429RATE_LIMITEDToo many requests from the same client. Respect Retry-After.
502FETCH_FAILEDThe upstream website could not be fetched or returned a network error.
Rate limit behavior Rate-limited responses include Retry-After. Your effective quota depends on the RapidAPI plan attached to your subscription.

Security and public API limits

Hardened for public website analysis

These limits reduce abuse risk, prevent SSRF, avoid port probing, and control bandwidth and cost.

  • Only http and https URLs are accepted.
  • Only standard public ports are accepted: 80 for HTTP and 443 for HTTPS.
  • Localhost, .localhost, private IPs, loopback, link-local, multicast, documentation, carrier-grade NAT, benchmarking, and reserved ranges are blocked.
  • DNS is resolved before each upstream fetch, and redirects are manually revalidated.
  • Linked CSS files and visual assets use the same public URL checks.
  • Response size caps are enforced: HTML 2 MB, CSS 1 MB, and images/assets 5 MB.
  • Public options are bounded: colors 1-32, timeout_seconds 1-30, max_css_files 0-32, max_assets 0-32.

Best practices for API consumers

  • Use POST /v1/palette for production integrations.
  • Send requests through your backend when you need to protect your RapidAPI key.
  • Use max_assets: 0 when speed matters more than visual asset analysis.
  • Use max_assets: 5 or higher when logos, favicons, and OpenGraph images matter.
  • Cache repeated URL analysis and normalize URLs before sending requests.
  • Use warnings to communicate confidence caveats to users.
  • Treat confidence as a relative score, not a guarantee.
  • Handle 422 NO_COLORS as a valid nothing-useful-found result.
  • Respect Retry-After on 429 responses.

Integration pattern

Call RapidAPI from your backend for production apps

RapidAPI examples are easy to try with curl, but production web apps should usually make the request from server-side code. That protects your RapidAPI key and gives you a place to normalize URLs, cache repeated analysis, and enforce your own product limits.

Recommended flow
Your app frontend
  -> Your backend or serverless function
  -> RapidAPI Give Me Colors endpoint
  -> Public target website
Example request options
const paletteRequest = {
  input,
  colors: 6,
  ignore_neutrals: false,
  timeout_seconds: 5,
  max_css_files: 4,
  max_assets: 0
};
  • Accept a URL from your application UI.
  • Validate or normalize the URL before calling the API.
  • Choose faster options for previews and richer options for saved analysis.
  • Send X-RapidAPI-Key and X-RapidAPI-Host from server-side code.
  • Cache normalized URL results when repeated analysis is likely.

Example use cases

Where a website theme color API fits

Generate brand palettes for website builders.Enrich company profiles with brand colors.Build lead lists with visual identity metadata.Match landing page colors in AI-generated designs.Create dashboards that automatically theme around customer websites.Extract CSS color signals for competitive research.Generate color swatches from a domain during onboarding.Analyze logos, favicons, and OpenGraph assets for brand identity.

Limitations

Fast static analysis, not browser rendering

Give Me Colors v1 is optimized for fast, static brand color extraction from public URLs. It works best on websites that expose meaningful colors through HTML, metadata, CSS, favicons, logos, or OpenGraph images. It does not execute JavaScript, so results from heavily client-rendered websites may be partial.

  • No browser screenshots, Playwright, or Chromium rendering.
  • CSS parsing is lightweight and deterministic, not a full browser cascade engine.
  • AVIF URLs may be detected as image inputs, but AVIF decoding is not enabled yet.

FAQ

Common integration questions

What does the Give Me Colors API do?

Give Me Colors extracts a structured color palette from a public website URL. It analyzes static HTML, metadata, CSS, and optional visual assets to identify useful brand and theme colors.

Does the API execute JavaScript?

No. Give Me Colors v1 is a static analyzer. It does not run JavaScript or render pages in a browser, so heavily client-rendered websites may return partial results.

Can I use it to analyze logos or images?

The API can analyze direct image URLs and linked website assets when they are publicly accessible and within configured limits. Website analysis can include favicons, logos, and OpenGraph images when max_assets is greater than 0.

What is palette_block for?

palette_block is a compact list of hex colors and percentages intended for quick UI rendering, previews, and swatch blocks.

What is confidence?

confidence is a relative score based on evidence strength. Colors found in stronger brand-like signals generally receive higher confidence.

Can I call the API from a browser app?

For production apps, call RapidAPI from your backend or serverless function so your RapidAPI key is not shipped in public client code.

Back to demo