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.pngQuery parameters
| Parameter | Default | Description |
|---|---|---|
| larger | false | Prefer the largest available source: apple-touch-icon (usually 180×180) or SVG. |
| default-avatar | false | Skip discovery and return a letter-avatar SVG for the domain. |
| throw-error-on-404 | false | Return HTTP 404 instead of a letter-avatar when no icon is found. |
Examples
Default favicon
https://faviconhub.app/github.comLarger icon
https://faviconhub.app/github.com?larger=trueForced letter avatar
https://faviconhub.app/example.org?default-avatar=true404
404 on missing icon
https://faviconhub.app/no-such-favicon-site.dev?throw-error-on-404=trueCode 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-Type | MIME type of the returned icon (image/x-icon, image/png, image/svg+xml …) |
| Cache-Control | Icons are cached for 24 hours; misses for 10 minutes. |
| X-Favicon-Source | The 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.