# Color Palette Fashion Finder (`wild_yapok/color-palette-fashion-finder`) Actor

Find clothing items that match your color palette from top fashion retailers. Specify colors by
\+  name or hex codes
\+  , and this Actor will search Zara, H\&M, ASOS, and Shein for matching products using advanced color
\+   similarity algorithms

- **URL**: https://apify.com/wild_yapok/color-palette-fashion-finder.md
- **Developed by:** [Dominik Hajczuk](https://apify.com/wild_yapok) (community)
- **Categories:** Automation, Agents, Other
- **Features:** Full permissions
- **Stats:** 222 total users, 0 monthly users, 86.8% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$12.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## 🎨 Color Palette Fashion Finder

Find clothing items that match your color palette from top fashion retailers. Upload an image or specify colors, and this Actor will search Zara, H\&M, ASOS, and Shein for matching products using advanced color similarity algorithms.

### Features

- **Color Extraction**: Automatically extract dominant colors from images using Vibrant.js
- **Smart Color Matching**: Uses Delta E 2000 algorithm for perceptually accurate color comparison
- **Multi-Retailer Scraping**: Searches Zara, H\&M, ASOS, and Shein simultaneously
- **Flexible Filtering**: Filter by category, price range, and color match threshold
- **Deduplication**: Automatically removes duplicate products
- **Detailed Results**: Returns product name, price, images, URLs, and color match scores

### Use Cases

- **Fashion Discovery**: "I loved this color in a sunset photo, where can I buy clothing in that shade?"
- **Interior Design Match**: Find clothing that matches your room's color scheme
- **Brand Consistency**: Find products matching your brand colors
- **Mood Board to Wardrobe**: Convert Pinterest inspiration to actual shopping
- **Color Trend Analysis**: Research what products are available in trending colors

### Input Parameters

#### Required (one of these):

- **colorPalette** (array of strings): Array of hex color codes (e.g., `["#FF6B6B", "#4ECDC4"]`)
- **imageUrl** (string): URL of an image to extract colors from

#### Optional:

- **targetWebsites** (array): Fashion retailers to scrape. Options: `"zara"`, `"hm"`, `"asos"`, `"shein"`. Default: `["zara", "hm", "asos"]`
- **category** (string): Product category to search. Options: `"all"`, `"tops"`, `"bottoms"`, `"dresses"`, `"outerwear"`, `"accessories"`, `"shoes"`. Default: `"all"`
- **priceRange** (object): Price filter with `min` and `max` in USD. Default: `{"min": 0, "max": 1000}`
- **maxResults** (integer): Maximum number of matching products to return (1-500). Default: `50`
- **colorMatchThreshold** (integer): Minimum color similarity score (0-100). Higher values return only close matches. Default: `70`
- **includeOutOfStock** (boolean): Whether to include out-of-stock items. Default: `false`
- **maxConcurrency** (integer): Number of pages to scrape concurrently (1-20). Default: `5`

#### Input Example

```json
{
  "colorPalette": ["#FF6B6B", "#4ECDC4", "#45B7D1"],
  "targetWebsites": ["zara", "hm", "asos"],
  "category": "dresses",
  "priceRange": {
    "min": 20,
    "max": 100
  },
  "maxResults": 30,
  "colorMatchThreshold": 75
}
```

#### Image Color Extraction Example

```json
{
  "imageUrl": "https://example.com/sunset.jpg",
  "targetWebsites": ["zara", "shein"],
  "category": "all",
  "maxResults": 50
}
```

### Output Schema

Each product in the dataset includes:

```json
{
  "productName": "Floral Summer Dress",
  "price": "$49.99",
  "currency": "USD",
  "imageUrl": "https://...",
  "productUrl": "https://...",
  "availableColors": ["#FF6B6B", "#FFB6B6"],
  "colorMatchScore": 85,
  "matchedColors": [
    {
      "productColor": "#FF6B6B",
      "paletteColor": "#FF6B6B",
      "similarity": 98
    }
  ],
  "sourceSite": "Zara",
  "targetPalette": ["#FF6B6B", "#4ECDC4", "#45B7D1"],
  "scrapedAt": "2025-11-09T19:00:00.000Z"
}
```

#### Output Fields

- **productName**: Name of the product
- **price**: Price as displayed on website (may include currency symbol)
- **currency**: Currency code (default: "USD")
- **imageUrl**: URL of the product's main image
- **productUrl**: Direct link to the product page
- **availableColors**: Array of color hex codes available for this product
- **colorMatchScore**: Overall similarity score (0-100, higher is better)
- **matchedColors**: Details of which product colors matched which palette colors
- **sourceSite**: Name of the retailer (Zara, H\&M, ASOS, or Shein)
- **targetPalette**: The color palette that was searched for
- **scrapedAt**: ISO timestamp of when the product was scraped

### How Color Matching Works

This Actor uses the **Delta E 2000 (CIEDE2000)** algorithm, the industry standard for perceptually accurate color comparison. The process:

1. **Color Space Conversion**: Colors are converted from RGB to LAB color space, which better represents human perception
2. **Similarity Calculation**: Delta E values represent "just noticeable difference" (JND):
   - 0-2: Not perceptible by human eyes
   - 2-10: Perceptible through close observation
   - 10-50: More different but same hue
   - 50+: Different colors
3. **Score Normalization**: Delta E is converted to a 0-100 similarity score (higher = more similar)
4. **Threshold Filtering**: Only products meeting the `colorMatchThreshold` are returned

### Performance & Pricing

- **Runtime**: Typically 2-5 minutes for 50 results across 3 retailers
- **Memory**: 512 MB - 1 GB recommended
- **Compute Units**: ~0.05-0.15 CU per run (depends on maxResults and retailers)

#### Optimization Tips:

- Start with fewer retailers and increase if needed
- Use higher `colorMatchThreshold` (80+) for faster, more precise results
- Reduce `maxResults` if you only need a few options
- Set `category` to narrow the search space

### Limitations

- **Dynamic Websites**: Some retailers use JavaScript-heavy sites that may require PlaywrightCrawler (future update)
- **Color Availability**: Not all retailers expose product colors in their HTML. The Actor extracts what's available.
- **Rate Limiting**: Retailers may block requests if scraping too aggressively. Use `maxConcurrency: 3-5` for stability.
- **Price Accuracy**: Prices may change or be location-specific. Always verify on the retailer's website.
- **Image Color Extraction**: Works best with images that have clear, distinct colors. Very complex images may yield less useful palettes.

### Example Use Cases

#### 1. Match a Photo's Color Palette

```json
{
  "imageUrl": "https://images.unsplash.com/photo-1506905925346-21bda4d32df4",
  "targetWebsites": ["zara", "hm"],
  "maxResults": 20,
  "colorMatchThreshold": 80
}
```

#### 2. Find Specific Colors in Tops

```json
{
  "colorPalette": ["#FF6B6B", "#4ECDC4"],
  "category": "tops",
  "priceRange": {"min": 15, "max": 50},
  "targetWebsites": ["shein", "hm"],
  "maxResults": 40
}
```

#### 3. Budget-Friendly Color Match

```json
{
  "colorPalette": ["#2C3E50", "#E74C3C", "#ECF0F1"],
  "priceRange": {"min": 0, "max": 30},
  "targetWebsites": ["shein"],
  "category": "all",
  "maxResults": 100,
  "colorMatchThreshold": 65
}
```

### API Access

Use this Actor via Apify API:

```bash
curl "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "colorPalette": ["#FF6B6B", "#4ECDC4"],
    "targetWebsites": ["zara", "hm"]
  }'
```

### Integration Ideas

- **Fashion Apps**: Integrate color-based product search into your app
- **Interior Design Tools**: Match decor to available clothing
- **Trend Analysis**: Track which colors are available across retailers
- **Affiliate Marketing**: Build a color-based fashion discovery tool
- **Personal Stylists**: Find items matching client preferences

### Support & Issues

For bugs, feature requests, or questions:

- **GitHub Issues**: [Report an issue](#)
- **Apify Forum**: [Get community help](https://community.apify.com)
- **Email**: support@apify.com

### Technical Details

**Built With:**

- **Apify SDK 3.0**: Actor platform and dataset storage
- **Crawlee 3.0**: Web scraping framework (CheerioCrawler)
- **node-vibrant**: Image color extraction
- **Sharp**: Image processing
- **color-difference**: Delta E 2000 algorithm implementation

**Architecture:**

- Modular scraper design (easy to add new retailers)
- Retailer-specific parsing utilities
- Centralized color matching logic
- Error handling and retry mechanisms
- Deduplication by product name and retailer

### License

Apache 2.0

# Changelog

This Actor's version history is a separate document: https://apify.com/wild_yapok/color-palette-fashion-finder/changelog.md

# Actor input Schema

## `colors` (type: `array`):

Color names (e.g., 'red', 'blue'), hex codes (e.g., '#FF6B6B'), or Pantone codes (e.g., 'pantone-red', 'pantone-viva-magenta'). Supports 100+ colors!

## `imageUrl` (type: `string`):

Upload an image URL and we'll extract colors automatically. Leave empty if using color names above.

## `targetWebsites` (type: `array`):

Select which fashion retailers to search

## `category` (type: `string`):

Filter by clothing category

## `season` (type: `string`):

Filter colors by fashion season trends

## `minPrice` (type: `number`):

Minimum price in US dollars

## `maxPrice` (type: `number`):

Maximum price in US dollars

## `maxResults` (type: `integer`):

Maximum number of products to return

## `colorMatchThreshold` (type: `number`):

How strict the color matching should be. Higher = stricter (70 is recommended)

## `includeOutOfStock` (type: `boolean`):

Show items even if they're currently out of stock

## `maxConcurrency` (type: `integer`):

Maximum number of pages to scrape at once (higher = faster but more resource intensive)

## `includeColorHarmonies` (type: `boolean`):

Generate complementary, analogous, and triadic color suggestions based on your palette

## `sortBy` (type: `string`):

How to sort the product results

## Actor input object example

```json
{
  "colors": [
    "red",
    "blue",
    "coral"
  ],
  "imageUrl": "https://images.unsplash.com/photo-1506905925346-21bda4d32df4",
  "targetWebsites": [
    "zara",
    "hm"
  ],
  "category": "dresses",
  "season": "current",
  "minPrice": 20,
  "maxPrice": 100,
  "maxResults": 20,
  "colorMatchThreshold": 70,
  "includeOutOfStock": false,
  "maxConcurrency": 5,
  "includeColorHarmonies": true,
  "sortBy": "match_score"
}
```

# 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 = {
    "colors": [
        "red",
        "blue"
    ],
    "imageUrl": "",
    "targetWebsites": [
        "zara",
        "hm"
    ],
    "category": "dresses",
    "season": "current",
    "minPrice": 20,
    "maxPrice": 100,
    "maxResults": 20,
    "colorMatchThreshold": 70,
    "includeOutOfStock": false,
    "maxConcurrency": 5,
    "includeColorHarmonies": true,
    "sortBy": "match_score"
};

// Run the Actor and wait for it to finish
const run = await client.actor("wild_yapok/color-palette-fashion-finder").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 = {
    "colors": [
        "red",
        "blue",
    ],
    "imageUrl": "",
    "targetWebsites": [
        "zara",
        "hm",
    ],
    "category": "dresses",
    "season": "current",
    "minPrice": 20,
    "maxPrice": 100,
    "maxResults": 20,
    "colorMatchThreshold": 70,
    "includeOutOfStock": False,
    "maxConcurrency": 5,
    "includeColorHarmonies": True,
    "sortBy": "match_score",
}

# Run the Actor and wait for it to finish
run = client.actor("wild_yapok/color-palette-fashion-finder").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 '{
  "colors": [
    "red",
    "blue"
  ],
  "imageUrl": "",
  "targetWebsites": [
    "zara",
    "hm"
  ],
  "category": "dresses",
  "season": "current",
  "minPrice": 20,
  "maxPrice": 100,
  "maxResults": 20,
  "colorMatchThreshold": 70,
  "includeOutOfStock": false,
  "maxConcurrency": 5,
  "includeColorHarmonies": true,
  "sortBy": "match_score"
}' |
apify call wild_yapok/color-palette-fashion-finder --silent --output-dataset

```

## MCP server setup

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

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/8gta3RR3rCFAbd3vH/builds/a3QiVyugCJwOPpMVN/openapi.json
