# Favicon Extractor (`datascraperes/favicon-extractor`) Actor

Extract website favicons in bulk from URLs or domains. Fast, lightweight, no proxies, no browser. Returns favicon URL, stored image link, content type, and size. Ideal for directories, CRMs, link previews, and domain enrichment.

- **URL**: https://apify.com/datascraperes/favicon-extractor.md
- **Developed by:** [DataScraperES](https://apify.com/datascraperes) (community)
- **Categories:** Developer tools, Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 favicon extracteds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Favicon Extractor

Get website favicons in bulk from URLs or domains. This Actor returns one clean dataset item per successfully retrieved favicon, with the favicon URL, normalized domain, image metadata, and an optional public image URL stored in Apify Key-Value Store.

### What This Actor Does

Favicon Extractor takes a list of websites and retrieves their favicons using a lightweight favicon lookup flow.

For each input URL or domain, the Actor:

1. Normalizes the input to a clean domain.
2. Looks up the favicon for the normalized domain.
3. Optionally stores the downloaded image in Apify Key-Value Store.
4. Saves the result metadata to the Apify Dataset.

It is built for fast, simple favicon enrichment. It does not crawl full websites, render pages, parse HTML, or use proxies.

### Pricing

This Actor uses pay-per-result pricing.

| Event | Price | What is charged |
|---|---:|---|
| `favicon` | `$0.50 / 1,000 results` | Each favicon successfully retrieved and pushed to the dataset |

Equivalent event price:

```text
$0.0005 per favicon result
````

You are charged only for successful favicon results. Invalid inputs, failed requests, and skipped domains are not pushed to the dataset and are not charged as `favicon` results.

Platform usage is included in the result price. You do not need to configure or pay for proxies for this Actor.

### Use Cases

- Add icons to link previews.
- Enrich domain lists with visual brand identifiers.
- Build directories, marketplaces, CRMs, or lead databases.
- Display favicons next to company websites.
- Create browser-style bookmark or tab interfaces.
- Add lightweight brand context to competitor dashboards.

### Input

| Field | Type | Required | Default | Description |
|---|---|---:|---:|---|
| `urls` | `string[]` | Yes | - | URLs or bare domains to process. |
| `size` | `string` | No | `"64"` | Requested favicon size in pixels. Select one of: `"16"`, `"32"`, `"64"`, `"128"`, `"256"`. |
| `storeImage` | `boolean` | No | `true` | If enabled, stores the favicon image in Key-Value Store and returns `image_url`. |
| `concurrency` | `integer` | No | `10` | Number of favicons to fetch in parallel. Allowed range: `1` to `50`. |

### Example Input

```json
{
    "urls": [
        "apify.com",
        "https://www.stripe.com",
        "github.com",
        "https://stripe.com/pricing"
    ],
    "size": "128",
    "storeImage": true,
    "concurrency": 10
}
```

### Input Normalization

The Actor accepts both complete URLs and bare domains.

Examples:

| Input | Domain used |
|---|---|
| `https://www.apify.com/store` | `apify.com` |
| `github.com/openai/codex` | `github.com` |
| `https://stripe.com/pricing?plan=pro` | `stripe.com` |
| `www.shopify.com` | `shopify.com` |

Paths, query parameters, ports, protocols, and leading `www.` are removed before favicon lookup.

Duplicate domains are processed independently if they appear multiple times in the input.

### Output

Each successful favicon produces one dataset item.

| Field | Type | Description |
|---|---|---|
| `input_url` | `string` | Original URL or domain from the input. |
| `domain` | `string` | Normalized domain used for favicon lookup. |
| `favicon_url` | `string` | Resolved URL that can be used to fetch the favicon directly. |
| `image_url` | `string` or `null` | Public URL to the stored favicon image when `storeImage=true`; otherwise `null`. |
| `content_type` | `string` | MIME type returned for the favicon, such as `image/png` or `image/x-icon`. |
| `size_bytes` | `integer` | Downloaded favicon size in bytes. |

### Example Output

```json
{
    "input_url": "apify.com",
    "domain": "apify.com",
    "favicon_url": "https://example.com/favicon.png",
    "image_url": "https://api.apify.com/v2/key-value-stores/abc123/records/favicon_apify_com.png",
    "content_type": "image/png",
    "size_bytes": 1029
}
```

### Stored Images

When `storeImage` is enabled, the Actor stores each downloaded favicon in the run's default Key-Value Store.

The dataset item includes `image_url`, which can be used directly in applications, dashboards, CSV exports, or API integrations.

When `storeImage` is disabled, the Actor still returns `favicon_url`, `content_type`, and `size_bytes`, but `image_url` is `null`.

### Run Summary

At the end of each run, the Actor stores a `SUMMARY` record in the default Key-Value Store. This record is not a Dataset result and is not charged as a `favicon` result.

Example summary:

```json
{
    "total_inputs": 1000,
    "processed": 1000,
    "succeeded": 942,
    "failed": 58,
    "stored_images": 942,
    "requested_size": 64,
    "store_image": true,
    "concurrency": 50,
    "spending_limit_reached": false,
    "charged_event_name": "favicon"
}
```

Use this summary to quickly check how many inputs were processed, how many produced favicon results, how many failed, and whether the run stopped because of the spending limit.

### Favicon Size

The `size` input requests a preferred icon size. The Actor returns the best available favicon image up to that size.

For example:

- requesting `256` does not guarantee a 256 px image;
- if only a 32 px favicon is available, the Actor may return that smaller icon;
- `64` is a good default for most dashboards and tables;
- `128` or `256` is better when the icon will be displayed larger.

### Error Handling

Failed inputs are skipped and logged.

Common reasons for skipped inputs:

- empty or invalid input value;
- no favicon response available for the domain;
- non-image response;
- timeout or network error.

Skipped inputs do not appear in the dataset and are not charged as `favicon` results.

### Important Notes

- This Actor does not use proxies.
- This Actor does not open websites in a browser.
- This Actor does not parse website HTML.
- A generic default icon may be returned when no specific favicon is available for a domain.
- The returned favicon depends on the icon data available for each domain.
- Results are available in Apify Dataset exports such as JSON, CSV, Excel, XML, RSS, and via API.

### Recommended Settings

For small batches:

```json
{
    "urls": ["apify.com", "github.com", "stripe.com"],
    "size": "64",
    "storeImage": true,
    "concurrency": 10
}
```

For larger batches:

```json
{
    "urls": ["..."],
    "size": "64",
    "storeImage": true,
    "concurrency": 50
}
```

For metadata-only use:

```json
{
    "urls": ["apify.com", "github.com"],
    "size": "64",
    "storeImage": false
}
```

# Actor input Schema

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

One or more URLs or bare domains. Paths, protocols, and leading 'www.' are stripped automatically; only the normalized domain is used for favicon lookup.

## `size` (type: `string`):

Requested favicon size in pixels. The Actor returns the best available icon up to this size.

## `storeImage` (type: `boolean`):

If enabled, the favicon bytes are stored in the Key-Value Store and a public image URL is returned with each item. If disabled, only the resolved favicon URL and metadata are returned.

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

Number of favicons to fetch in parallel.

## Actor input object example

```json
{
  "urls": [
    "apify.com",
    "stripe.com",
    "github.com"
  ],
  "size": "64",
  "storeImage": true,
  "concurrency": 10
}
```

# Actor output Schema

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

Successful favicon results. Each item contains the normalized domain, favicon URL, optional stored image URL, content type, and image size.

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

JSON summary with processed, succeeded, failed, stored image, and billing event counters.

# 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": [
        "apify.com",
        "stripe.com",
        "github.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascraperes/favicon-extractor").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": [
        "apify.com",
        "stripe.com",
        "github.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("datascraperes/favicon-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "apify.com",
    "stripe.com",
    "github.com"
  ]
}' |
apify call datascraperes/favicon-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datascraperes/favicon-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Favicon Extractor",
        "description": "Extract website favicons in bulk from URLs or domains. Fast, lightweight, no proxies, no browser. Returns favicon URL, stored image link, content type, and size. Ideal for directories, CRMs, link previews, and domain enrichment.",
        "version": "1.0",
        "x-build-id": "WX0OI7bC4nvYALSJo"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datascraperes~favicon-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datascraperes-favicon-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datascraperes~favicon-extractor/runs": {
            "post": {
                "operationId": "runs-sync-datascraperes-favicon-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datascraperes~favicon-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-datascraperes-favicon-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "URLs or domains",
                        "minItems": 1,
                        "type": "array",
                        "description": "One or more URLs or bare domains. Paths, protocols, and leading 'www.' are stripped automatically; only the normalized domain is used for favicon lookup.",
                        "items": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    "size": {
                        "title": "Favicon size (px)",
                        "enum": [
                            "16",
                            "32",
                            "64",
                            "128",
                            "256"
                        ],
                        "type": "string",
                        "description": "Requested favicon size in pixels. The Actor returns the best available icon up to this size.",
                        "default": "64"
                    },
                    "storeImage": {
                        "title": "Store image binary",
                        "type": "boolean",
                        "description": "If enabled, the favicon bytes are stored in the Key-Value Store and a public image URL is returned with each item. If disabled, only the resolved favicon URL and metadata are returned.",
                        "default": true
                    },
                    "concurrency": {
                        "title": "Concurrency",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Number of favicons to fetch in parallel.",
                        "default": 10
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
