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

Extract favicon, apple-touch-icon and mask-icon URLs from websites.

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

## Pricing

from $1.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/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 - Website Icon and App Icon Scraper

Extract favicons and app icons from public websites in a structured dataset. The actor scans each page for icon link tags, resolves relative URLs, returns icon relation types, sizes, MIME types, colors, and uses `/favicon.ico` as a fallback when no explicit icon tags are found. Export to JSON/CSV/Excel, run on a schedule, call via API, or connect to Make, Zapier or n8n.

### What is the Favicon Extractor?

The Favicon Extractor is a small but useful website intelligence utility for lead enrichment, brand monitoring, SEO QA, catalog building, and internal tooling. Favicons are often needed when building dashboards, company databases, bookmark tools, CRM enrichments, competitor trackers, marketplace listings, and SaaS product directories. Instead of manually inspecting each site or guessing `/favicon.ico`, this actor collects all icon declarations in one run.

It detects common favicon patterns such as `icon`, `shortcut icon`, `apple-touch-icon`, `mask-icon`, and any relation containing `icon`. It also records icon size and type attributes when the website provides them. The direct HTTP engine is fast, cheap, and reliable for scheduled runs.

The actor is especially useful when a list of websites needs small visual identifiers. Favicons are not a replacement for official logos, but they are often good enough for internal dashboards, lead lists, enrichment previews, monitoring tools, and compact UI elements where a full brand asset pipeline would be too heavy.

#### What data does it extract?

- Input URL and final redirected URL
- Domain and HTTP status code
- Count of detected favicons
- Primary favicon URL
- Full list of icon candidates
- Icon relation value
- Absolute icon URL
- Sizes attribute
- MIME type attribute
- Mask icon color when present

### Input

| Field | Type | Description |
| --- | --- | --- |
| `urls` | array | Websites to scan for favicon and app icon URLs. |

#### Example input

```json
{
  "urls": [
    "https://apify.com",
    "https://example.com"
  ]
}
````

### Output

```json
{
  "input": "https://apify.com",
  "url": "https://apify.com",
  "final_url": "https://apify.com/",
  "domain": "apify.com",
  "status_code": 200,
  "favicon_count": 9,
  "primary_favicon": "https://apify.com/favicon.ico",
  "favicons": [
    {
      "rel": "icon",
      "href": "https://apify.com/favicon.ico",
      "sizes": "32x32",
      "type": "image/x-icon",
      "color": null
    }
  ]
}
```

### Use cases

- CRM enrichment: add brand icons to company and prospect records.
- Directory building: populate logos or icon thumbnails for website lists.
- SEO and QA: verify that pages expose expected favicon and mobile app icon tags.
- Monitoring: detect when brand icons or favicon URLs change across important sites.

### Practical tips

Use the `primary_favicon` field when you only need one icon URL. Use the full `favicons` array when you want to choose the best size, find Apple touch icons, or preserve all candidates for a downstream brand asset pipeline. Some sites expose many generated favicon variants; keeping all of them lets you select the right one later.

For lead enrichment, run this actor after you have normalized company domains. For QA, run it against production, staging, or localized domains to verify that every property exposes the expected icon metadata. If a site has no icon tags, the actor checks the conventional `/favicon.ico` location as a fallback.

For directories and dashboards, store the extracted URL rather than copying image files immediately. That keeps your database lightweight and lets you refresh icons later. If you need permanent assets, run a separate downloader after this actor and cache only the selected `primary_favicon` or preferred icon size.

### Reliability and performance

The actor uses direct HTTP requests and does not render pages in a browser. It follows redirects, parses link tags from the HTML, resolves relative URLs, and continues with the next URL if one site fails. That makes it suitable for recurring checks across large website lists.

### FAQ

**Does it download the image files?** No. It extracts and resolves icon URLs. You can download them downstream if needed.

**Does it use `/favicon.ico`?** Yes, as a fallback when no icon tags are found in the HTML.

**Does it support apple touch icons?** Yes. `apple-touch-icon` links are included in the `favicons` array.

**Does it use a browser?** No. It uses direct HTTP requests for stable, low-cost runs.

**Can I scan many websites?** Yes. Paste a list of websites or call the actor through the API.

**Can I export to CSV or Excel?** Yes. Apify datasets can be exported to JSON, CSV, Excel, XML, and RSS.

**Is it legal?** The actor reads public page metadata and icon URLs. You must respect website terms and applicable rules.

**How is billing calculated?** Pay-per-event billing charges per URL result pushed to the dataset.

**What if a site blocks HEAD requests?** The actor still extracts explicit icon tags from the page HTML; the HEAD fallback is only used when needed.

**Does it verify image dimensions?** It records the declared `sizes` attribute but does not download each image to inspect pixels.

**Can I use it for brand monitoring?** Yes. Schedule repeated runs and compare `primary_favicon` or the full icon list over time.

**Does it extract full logos?** No. It extracts favicon and app icon metadata. Use a logo-specific enrichment actor for full brand logos.

### You might also like

- Meta Tags Extractor
- Website Status Checker
- HTTP Headers Checker
- Robots Sitemap Analyzer
- Website Contact Extractor

**Keywords:** favicon extractor, favicon scraper, website icon scraper, apple touch icon extractor, mask icon scraper, brand icon enrichment, website metadata, SEO QA, icon URL extractor, favicon.ico checker, company enrichment, website intelligence, Apify scraper, no code scraper, web automation

# Actor input Schema

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

Websites to scan for favicon and app icon URLs.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ]
}
```

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("benthepythondev/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": ["https://apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("benthepythondev/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": [
    "https://apify.com"
  ]
}' |
apify call benthepythondev/favicon-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Favicon Extractor",
        "description": "Extract favicon, apple-touch-icon and mask-icon URLs from websites.",
        "version": "1.0",
        "x-build-id": "zlA9d2ohYtqQyO9Tu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/benthepythondev~favicon-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-benthepythondev-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/benthepythondev~favicon-extractor/runs": {
            "post": {
                "operationId": "runs-sync-benthepythondev-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/benthepythondev~favicon-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-benthepythondev-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",
                "properties": {
                    "urls": {
                        "title": "URLs",
                        "type": "array",
                        "description": "Websites to scan for favicon and app icon URLs.",
                        "default": [
                            "https://apify.com"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
