Free Favicon API

Get any website's favicon by URL with one GET request. No API key, no sign-up.

Quick start

The favicondl favicon API turns any domain or URL into its favicon with a single GET request. There is no API key, no account and no SDK. Pass size as one of 16, 32, 48, 64, 128, 180, 192, 256 or 512 to get a square PNG of that size. Any other number snaps to the nearest allowed size (a tie uses the smaller one):

<img src="https://favicondl.com/api/extract?url=github.com&size=32" width="32" height="32" alt="GitHub favicon">

Omit size to receive the original file. A raster smaller than the requested size is upscaled and may look soft. SVG is rasterized at the requested size. X-Favicon-Native-Size and X-Favicon-Upscaled on the image response say when that happened.

Or ask for JSON to see which file was found and where it came from:

curl "https://favicondl.com/api/extract?url=github.com&format=json"
curl "https://favicondl.com/api/extract?url=github.com&size=32&format=json"
{
  "ok": true,
  "domain": "github.com",
  "size": null,
  "resized": false,
  "upscaled": false,
  "vector": true,
  "nativeWidth": null,
  "nativeHeight": null,
  "iconUrl": "https://github.githubassets.com/favicons/favicon.svg",
  "proxyUrl": "https://favicondl.com/api/proxy?url=https%3A%2F%2Fgithub.githubassets.com%2Ffavicons%2Ffavicon.svg",
  "source": "html",
  "rel": "icon",
  "format": "svg",
  "width": null,
  "height": null,
  "pageUrl": "https://github.com/",
  "candidates": [
    { "url": "https://github.githubassets.com/favicons/favicon.svg", "format": "svg", "vector": true, "source": "html", "rel": "icon", "proxyUrl": "…" },
    { "url": "https://github.githubassets.com/assets/app-icon-512-7f9c4ff2e960.png", "format": "png", "width": 512, "height": 512, "source": "manifest", "rel": "manifest", "proxyUrl": "…" },
    { "url": "https://github.com/favicon.ico", "format": "ico", "width": 32, "height": 32, "source": "direct", "rel": "favicon.ico", "proxyUrl": "…" }
  ]
}

iconUrl is the original file on the website. proxyUrl is the image to download: the original file when size is omitted, or an exact square PNG (&size=32 and so on) when size is set. It sends Access-Control-Allow-Origin: *.

width and height are the measured source (null for SVG). When size is set, outputWidth and outputHeight match it, nativeWidth / nativeHeight are the source pixels, and upscaled is true only when a raster was enlarged — that PNG may look soft. candidates lists up to 8 other verified icons. It is empty when we had to fall back to Google or DuckDuckGo.

How the API picks an icon

  1. The homepage is requested like a normal browser would, following redirects (including www ↔ bare domain). Every icon <link> is read: icon, shortcut icon, apple-touch-icon, apple-touch-icon-precomposed and mask-icon. Relative and protocol-relative (//cdn…) links are resolved against the final page URL or its <base> tag (source: "html").
  2. The web app manifest linked from the page is opened for its icon list, which is often where the 192px and 512px icons are (source: "manifest").
  3. Well-known paths /favicon.ico and /apple-touch-icon.png are tried as well (source: "direct").
  4. Every candidate is downloaded and checked: the bytes must really be an image (PNG, ICO, SVG, WebP, JPEG, GIF …), and we measure its real pixel size instead of trusting the file name.
  5. Google's favicon service, then DuckDuckGo, are used only if nothing on the site works, at the size you request (source: "google_s2" or "duckduckgo").

The verified candidates are ranked so the largest sharp source wins: a full-colour SVG first, then the largest square PNG/ICO/WebP. Safari's single-colour mask-icon and manifest icons marked only as maskable are ranked lower because they do not look like the normal favicon. That source is then resized to one of 16, 32, 48, 64, 128, 180, 192, 256 or 512 (other numbers snap to the nearest). Omit size to keep the original file. Downscales use Lanczos, upscales use high-quality resampling, non-square icons are padded with transparency, and SVG is rasterized at the requested size. An upscaled raster may look soft; the response never describes it as a sharp original.

If you get google_s2, the site either has no icon we could reach or blocked our request (for example a bot challenge page). For a single site, the favicon downloader on our homepage also tries a few extra sources directly from your browser and shows every size it found so you can pick one.

Favicon API comparison: favicondl vs Google S2, DuckDuckGo and Icon Horse

All four services are free to start with and need no API key. They differ in what they return:

favicondlGoogle S2DuckDuckGoIcon Horse
Endpoint/api/extract?url=example.comgoogle.com/s2/favicons?domain=example.com&sz=64icons.duckduckgo.com/ip3/example.com.icoicon.horse/icon/example.com
API keyNoNoNoNo (free plan)
Published free quotaNone (fair use)None publishedNone published1,000 icons/month on the free plan
Size parametersize 16, 32, 48, 64, 128, 180, 192, 256 or 512. Other numbers snap to the nearest. Omit it for the original file.szNoNot documented
What you get backAn exact square PNG when size is set; otherwise the original file (SVG, PNG, ICO …)PNG or JPEG (observed)ICO (observed)PNG (observed)
JSON metadataYes (format=json: icon URL, source, format, measured pixel size and up to 8 alternative icons)NoNoNo
Result for github.com in our testfavicon.svg (vector)16×16 PNG at sz=16, 180×180 at sz=256ICO with 16×16 and 32×32256×256 PNG

Results come from our own requests on 12 October 2026; the Icon Horse quota is taken from its pricing section. Third-party services can change at any time, so check each provider's terms before relying on it in production.

Overview

Mzu favicondl provides copy-ready favicon URL templates and a favicon extractor UI. Its own extraction API finds the real icons a website publishes, and an image proxy makes them downloadable from browser code.

Fast

Optimized fetching for quick preview

Free

No signup required

Reliable

Designed for high availability

Authentication

This project uses free Favicon services URL templates, no authentication or API Key is required.

Note: Although we don't require an API Key, please use the service reasonably to avoid excessive requests.

Endpoints

GET FaviconDL Extract API

Find and download a usable favicon for a domain or URL

Base URL:

https://favicondl.com/api/extract

Full Example:

https://favicondl.com/api/extract?url=example.com&size=128

Parameters

Parameter Name Type Required Default Value Description
url string Yes - The target domain or URL, e.g. example.com
size number No none (original file) Allowed sizes are 16, 32, 48, 64, 128, 180, 192, 256 and 512. Any other number snaps to the nearest (a tie uses the smaller size) and the request redirects to that URL. Omit size for the original file. A non-numeric size returns 400. A smaller raster is upscaled and may look soft; SVG is rasterized at the snapped size.
format string No redirect Use json for metadata; omit it for a downloadable image redirect

Parameter Details:

url

Supports domains and full website URLs:

  • • example.com
  • • www.example.com
  • • https://example.com/docs
  • • sub.example.com
size

Square PNG at one of the sizes below. Any other number snaps to the nearest. Omit it for the original file.

  • • 16 - 16x16
  • • 32 - 32x32
  • • 48 - 48x48
  • • 64 - 64x64
  • • 128 - 128x128
  • • 180 - 180x180
  • • 192 - 192x192
  • • 256 - 256x256
  • • 512 - 512x512

Only url (domain still works as an alias), size and format are read. Any other query parameter is ignored. The host is lowercased, https is assumed, one leading www. is removed, and a trailing slash is removed. A request that is not already in that form redirects with 308 to the stable URL, which is what the CDN caches. /api/proxy keeps www and the image path, because those identify the file.

Responses

Successful Response (JSON format)

JSON Response
{
  "ok": true,
  "domain": "example.com",
  "size": 32,
  "resized": true,
  "outputFormat": "png",
  "outputWidth": 32,
  "outputHeight": 32,
  "upscaled": false,
  "nativeWidth": null,
  "nativeHeight": null,
  "vector": true,
  "iconUrl": "https://example.com/favicon.svg",
  "proxyUrl": "https://favicondl.com/api/proxy?url=...&size=32",
  "source": "html",
  "rel": "icon",
  "format": "svg",
  "width": null,
  "height": null,
  "pageUrl": "https://example.com/",
  "candidates": [ ... ]
}

Error Response

Error Response
{
  "ok": false,
  "error": "Missing url"
}

Note: When using format=redirect, the API will directly redirect to the favicon URL without returning a JSON response.

Examples

JavaScript (Fetch)

JavaScript
async function getFavicon(url, size = 128) {
  const endpoint = new URL('https://favicondl.com/api/extract');
  endpoint.searchParams.set('url', url);
  endpoint.searchParams.set('size', String(size));
  const response = await fetch(endpoint);
  if (!response.ok) throw new Error(`Favicon request failed: ${response.status}`);
  return await response.blob();
}

const icon = await getFavicon('example.com', 128);
const imageUrl = URL.createObjectURL(icon);
document.querySelector('#favicon-preview').src = imageUrl;

Python (Requests)

Python
import requests

def get_favicon(url: str, size: int = 128) -> bytes:
    response = requests.get(
        "https://favicondl.com/api/extract",
        params={"url": url, "size": size},
        timeout=15,
    )
    response.raise_for_status()
    return response.content

icon_bytes = get_favicon("example.com", 128)
with open("example-favicon", "wb") as output:
    output.write(icon_bytes)

PHP (cURL)

PHP
<?php
function getFavicon(string $url, int $size = 128): string {
    $endpoint = 'https://favicondl.com/api/extract?url=' . urlencode($url) . '&size=' . $size;
    $context = stream_context_create(['http' => ['follow_location' => 1, 'timeout' => 15]]);
    $icon = file_get_contents($endpoint, false, $context);
    if ($icon === false) {
        throw new RuntimeException('Favicon request failed');
    }
    return $icon;
}

file_put_contents('example-favicon', getFavicon('example.com', 128));
?>

HTML Direct Reference

HTML
<!-- Exact 32×32 PNG. Allowed: 16, 32, 48, 64, 128, 180, 192, 256, 512. Other numbers snap to the nearest. -->
<img src="https://favicondl.com/api/extract?url=example.com&size=32" alt="example.com favicon" width="32" height="32">

<!-- Omit size for the original file. Small rasters requested above native size may look soft. -->
<img src="https://favicondl.com/api/extract?url=example.com" alt="example.com favicon">

Errors

Errors return an HTTP status code and a small JSON body with ok set to false and an error message.

HTTP Status Code Error message Description Solution
400 Missing url No url or domain parameter was sent Add ?url=example.com to the request
400 Invalid format format is neither json nor redirect Use format=json, or omit it for a redirect
400 Invalid domain The value could not be read as a hostname Send a domain such as example.com or a full https:// URL
405 Method not allowed Only GET requests are supported Send a GET request
502 Favicon extraction failed The extractor could not return an icon Retry later
415 Target is not an image Only from /api/proxy: the URL did not return real image data Use an iconUrl or candidates[].url returned by /api/extract

OpenAPI spec and MCP server

  • OpenAPI 3 spec: https://favicondl.com/openapi.yaml — import it into Postman, Insomnia or a client generator.
  • MCP server: favicondl MCP (registry name io.github.sweesama/favicondl) exposes an extract_favicon tool so Claude, Cursor and other MCP clients can fetch icons.

Rate Limits

Free

No registration required, completely free to use all features

Fair use

  • • There is no API key and no fixed published quota
  • • Icons found on the site are cached at the edge for 24 hours; Google/DuckDuckGo fallbacks for 10 minutes
  • • Please cache icons on your side and avoid bulk crawling

Commercial Use

There is no paid tier or SLA. For high-volume or business-critical use, store the icons you need in your own storage.

Copied!