Favicon API Documentation

Everything the API can do, on one page.

Base URL

https://faviconhub.app/{domain}
https://faviconhub.app/api/favicon/{domain}

Basic usage

Request a domain's favicon by putting the domain in the path. The response is the raw icon file with the correct Content-Type.

GET https://faviconhub.app/github.com

HTTP/1.1 200 OK
Content-Type: image/png
Cache-Control: public, max-age=86400
X-Favicon-Source: https://github.com/favicon.png

Query parameters

ParameterDefaultDescription
largerfalsePrefer the largest available source: apple-touch-icon (usually 180×180) or SVG.
default-avatarfalseSkip discovery and return a letter-avatar SVG for the domain.
throw-error-on-404falseReturn HTTP 404 instead of a letter-avatar when no icon is found.

Examples

Default favicon
https://faviconhub.app/github.com
Larger icon
https://faviconhub.app/github.com?larger=true
Forced letter avatar
https://faviconhub.app/example.org?default-avatar=true
404
404 on missing icon
https://faviconhub.app/no-such-favicon-site.dev?throw-error-on-404=true

Code samples

HTML
<img src="https://faviconhub.app/github.com" alt="GitHub favicon" width="32" height="32" />
JavaScript
const res = await fetch('https://faviconhub.app/github.com?larger=true');
const blob = await res.blob();
const url = URL.createObjectURL(blob);
cURL
curl -L -o favicon.png "https://faviconhub.app/github.com?larger=true"
CSS
.site-icon {
  background-image: url('https://faviconhub.app/github.com');
  background-size: contain;
}

Response headers

Useful headers on every successful response:

Content-TypeMIME type of the returned icon (image/x-icon, image/png, image/svg+xml …)
Cache-ControlIcons are cached for 24 hours; misses for 10 minutes.
X-Favicon-SourceThe URL the icon was fetched from.

Fair use

The API is free without a key. Please cache responses on your side where possible and avoid bulk scraping millions of domains; abusive traffic may be rate-limited.

Favicon API Documentation · FaviconHub