# Website Color Palette: Hex Colors from a URL (`ucchiii/website-color-palette`) Actor

Extract the color palette of any website from its URL: most used hex colors with counts and where they are used (background, text, border), theme color, favicon and og:image dominant colors and a primary brand color guess. HTTP only, no browser. Empty input = free demo.

- **URL**: https://apify.com/ucchiii/website-color-palette.md
- **Developed by:** [Actor Factory](https://apify.com/ucchiii) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $18.90 / 1,000 page with colors

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**Website color palette: extract the hex colors of any website from its URL — the most used colors with how often and where they are used, the theme color, the favicon and share-image colors, and a guess at the primary brand color.**

| url | themeColor | primaryGuess | palette (top 3) |
|---|---|---|---|
| https://demo.example/ | #0B5FFF | #0B5FFF | #0B5FFF (score 11), #FAFAFA (6), #FFFFFF (5) |

*(output of the free demo on the bundled sample page; each row also has the full `palette` and `dominantImageColors`)*

**For designers, marketers and developers who need a website's colors but have no time to open dev tools:** match a client's
brand colors in a pitch or mockup, build a competitor color comparison, theme an app or newsletter to a partner's site, enrich a
list of company sites with their brand color, or check that a site really uses the colors its brand guide says.

**Try it:** press **Start** with the prefilled example (2 sites). You get one row per site in a few seconds. Clear the list and
press Start for a free demo on a bundled sample page (the row carries `_demo: true`, not charged, no network).

### What you get

- **Palette**: the most used colors (default 10, up to 50) as `hex` and `rgb`, with `count` (how many times it appears), a weighted
  `score` and `sources` (where it is used: `background`, `text`, `border`, `svg`, `shadow`, `variable`, `theme-color`).
  Colors are read from hex (`#0b5fff`, `#fff`), `rgb()` / `rgba()`, `hsl()` / `hsla()`, named colors (`tomato`) and CSS custom
  properties (`--brand: #0b5fff`), including gradients. Fully transparent colors are ignored.
- **Weighted by use**: a color in a background counts 3, in text 2, SVG fill/stroke 1.5, border 1, custom property 1, shadow 0.5; the
  theme color counts 5. Colors from third-party CDN stylesheets (Bootstrap and similar) count a quarter, so the site's own colors win.
- **Theme color**: `<meta name="theme-color">` (or `msapplication-TileColor`) as hex.
- **Image colors** (`dominantImageColors`): the dominant colors of the favicon (apple-touch-icon preferred, else the icon, else
  `/favicon.ico`) and the `og:image`, found with Pillow quantize, with each color's share of the image. SVG icons are skipped.
- **Primary color guess** (`primaryGuess` and `primaryGuessReason`): the theme color if it is colorful, else the most used colorful
  CSS color, else a colorful image color. Only a guess: check it against the palette.
- Options: **Max colors**, **CSS colors** / **image colors** on or off, **leave out white, black and grays**, **respect robots.txt**.
- Accepts **domains or URLs** (`apify.com`, `https://www.python.org/about/`); without a scheme, https:// is used. Up to 500 per run.

### How to use

1. **Websites**: one URL or domain per line (up to 500; duplicates are removed).
2. Optional: **Max colors**, the CSS / image switches, **Leave out white, black and grays**.
3. Press **Start**. Export the table as CSV, JSON or Excel, or read it with the API.

```json
{ "urls": ["https://apify.com", "https://www.python.org"], "maxColors": 10 }
```

### Output

```json
{
  "url": "https://demo.example/", "finalUrl": "https://demo.example/", "status": "ok",
  "themeColor": "#0B5FFF", "primaryGuess": "#0B5FFF", "primaryGuessReason": "theme-color",
  "palette": [
    {"hex": "#0B5FFF", "rgb": [11, 95, 255], "count": 4, "score": 11.0, "sources": ["background", "text", "theme-color", "variable"]},
    {"hex": "#FAFAFA", "rgb": [250, 250, 250], "count": 2, "score": 6.0, "sources": ["background"]}
  ],
  "dominantImageColors": [
    {"hex": "#0B5FFF", "rgb": [11, 95, 255], "share": 0.625, "source": "favicon"}
  ],
  "stylesheetsAnalyzed": 1, "imagesAnalyzed": 1, "error": null
}
```

*(row from the bundled demo)*

- `status` — `ok` (at least one color found; charged), `no_colors`, `blocked_by_robots`, `not_html`, `error` (the page could not be
  fetched) or `invalid_input`. Only `ok` is charged.
- `palette[]` — sorted by `score`, then `count`. `count` is the number of times the color appears; `score` is the weighted value.
- `error` — e.g. `invalid_url`, `blocked_private_address`, `disallowed_by_robots_txt`, `dns_failure`, `timeout`, `http_404`, `not_html: ...`, `no_colors_found`.
- **SUMMARY** record: URLs analyzed, ok, no colors, blocked by robots.txt, not HTML, errors, invalid input and charged pages.

### Notes and limits

- **Plain HTTP, no browser.** Colors that JavaScript adds after the page loads, or CSS injected by scripts (CSS-in-JS), are not seen;
  a page that renders entirely in JavaScript may return few colors or `no_colors`. Sites that block automated requests may return an error.
- **What is read**: the page, up to 8 stylesheets linked from it (from the same site and common CDNs such as jsDelivr, cdnjs, unpkg;
  Google Fonts CSS is skipped), up to 2 image files (favicon, og:image), plus `robots.txt`. No crawling. Limits: HTML 1.5 MB, each
  stylesheet 500 KB (2 MB in total), each image 3 MB.
- **Counts are of the code, not of what is visible**: a color that appears in a stylesheet for a part of the site you did not
  open is counted too. `@import`ed stylesheets are not fetched; dark-mode and print rules inside the files read are counted like any other rule.
- **Polite by design**: robots.txt is respected by default (disallowed pages are free with status `blocked_by_robots`; Crawl-delay is
  honored up to 10 s), one request at a time per host with at least 0.25 s between requests, generic User-Agent that names this
  Actor, up to 2 retries on timeouts, 429 and 5xx errors. Turn robots.txt off only for sites you may fetch anyway.
- **Safe by design**: addresses that resolve to internal networks (localhost, private ranges, link-local such as 169.254.169.254,
  IPv6 loopback/unique-local) are never contacted, including redirect targets and stylesheet or image URLs.
- Brand colors and logos belong to their owners. This Actor reports which colors a page's code uses; check that your use is allowed.

### Pricing

| Event | Free plan | Paid plans (Store discount tiers Bronze / Silver / Gold) |
|---|---|---|
| Page with colors (at least one color found) | $27 per 1,000 | $24.30 / $21.60 / $18.90 per 1,000 |

The price on this page ("from $0.0189") is the Gold tier price. You pay only for pages where at least one color was found. Errors,
non-HTML files, pages without colors, pages blocked by robots.txt, invalid input and the free demo are **not charged**.
On the Apify Free plan, the $5 of monthly platform credit covers about **185 pages** a month.

### FAQ

**Why do white and black appear in my palette?** Most sites use them a lot. Switch on **Leave out white, black and grays** to keep
only the colorful ones; `primaryGuess` already prefers a colorful color.

**Is `primaryGuess` always the logo color?** No. It is the theme color if the site sets a colorful one, otherwise the most used
colorful color in the CSS. Look at `palette` and `dominantImageColors` to confirm.

**Why is a color I see on the page missing?** It may be drawn by an image, a canvas or a script, or come from a stylesheet on a
host this Actor does not read (only the same site and common CDNs). Colors inside images are covered only for the favicon and the og:image.

**Does it respect robots.txt?** Yes by default: pages, stylesheets and images that robots.txt disallows are not fetched.

If this Actor saved you time, a rating on the Store helps others find it.

### More tools from the same developer

- [Favicon Extractor](https://apify.com/ucchiii/favicon-extractor) — favicons, Apple touch icons and manifest icons of many websites, with the best icon per site
- [Website Technology Detector](https://apify.com/ucchiii/website-technology-detector) — tech stack of websites in bulk: CMS, frameworks, analytics and tag IDs, CDN, consent tools
- [Website Screenshot](https://apify.com/ucchiii/website-screenshot) — screenshots and PDFs of web pages: full page, mobile, element, no cookie banners
- [Website Image Extractor](https://apify.com/ucchiii/website-image-extractor) — every image on your pages with alt text, srcset, size and type (HEAD only), flagging missing alt and oversized images

# Actor input Schema

## `urls` (type: `array`):

Pages to analyze, like 'https://www.python.org' or 'apify.com' (https:// is added when missing). Only these pages (plus their stylesheets and icons) are requested, no crawling. Up to 500 per run (extra ones are skipped); duplicates are removed. Leave empty for a free demo (not charged).

## `maxColors` (type: `integer`):

How many colors to return in the palette, most used first. Allowed range 1 to 50 (default 10).

## `includeCssColors` (type: `boolean`):

Read the colors used in the page's CSS (stylesheets, style tags, style attributes) and count them by where they are used: background counts 3, text 2, border 1. The theme-color meta tag is always included. If this and image colors are both off, CSS colors are used.

## `includeImageColors` (type: `boolean`):

Also find the dominant colors of the favicon (apple-touch-icon preferred) and the og:image, in dominantImageColors. SVG images are skipped. Off = fewer requests and a faster run.

## `ignoreNeutrals` (type: `boolean`):

Remove near-white, near-black and gray colors from the palette so the brand colors stand out. The primary color guess ignores them either way when a colored option exists.

## `respectRobotsTxt` (type: `boolean`):

Skip pages (and their stylesheets and images) that the site's robots.txt disallows for this Actor, and honor Crawl-delay up to 10 seconds. Such pages get status blocked_by_robots and are free. Only turn off for sites you are allowed to fetch.

## `timeoutSecs` (type: `integer`):

Timeout for each request, in seconds. Allowed range 1 to 60 (default 20). Temporary failures are retried up to 2 times.

## `concurrency` (type: `integer`):

How many pages are analyzed in parallel. Allowed range 1 to 10 (default 3). Requests to the same host are made one at a time, at least 0.25 s apart.

## `userAgent` (type: `string`):

Optional custom User-Agent header. Default identifies this Actor.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.python.org"
  ],
  "maxColors": 10,
  "includeCssColors": true,
  "includeImageColors": true,
  "ignoreNeutrals": false,
  "respectRobotsTxt": true,
  "timeoutSecs": 20,
  "concurrency": 3
}
```

# Actor output Schema

## `results` (type: `string`):

One row per URL: status, themeColor, primaryGuess, palette (hex, rgb, count, score, sources), dominantImageColors (hex, rgb, share, source), stylesheetsAnalyzed, imagesAnalyzed, finalUrl, error.

## `summary` (type: `string`):

Record SUMMARY: URLs analyzed, ok, no colors, blocked by robots.txt, not HTML, errors, invalid input and charged pages.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://apify.com",
        "https://www.python.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/website-color-palette").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": [
        "https://apify.com",
        "https://www.python.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/website-color-palette").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://apify.com",
    "https://www.python.org"
  ]
}' |
apify call ucchiii/website-color-palette --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ucchiii/website-color-palette"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5vmD4rpLNGMEmFf93/builds/u32qbM9PdObijaWAg/openapi.json
