REST API
Favicon API
Free, fast, and simple. No registration or API key required.
Base URL
https://yoursite.com/api/favicon/{domain}Basic Usage
Simply pass any domain as the path parameter to get its favicon:
HTML
<img src="https://yoursite.com/api/favicon/github.com" alt="GitHub favicon" loading="lazy" />Markdown
cURL
curl -L https://yoursite.com/api/favicon/github.com -o favicon.pngParameters
| Parameter | Type | Description |
|---|---|---|
| larger | boolean | Set to true to get a larger icon (up to 256px) |
| default-avatar | URL (encoded) | Custom fallback URL when no favicon is found |
| throw-error-on-404 | boolean | Return HTTP 404 when no icon found (useful for onerror handling) |
| redirect | boolean | When true, respond with 302 redirect instead of proxying the image bytes |
Examples
Default favicon (32px)
https://yoursite.com/api/favicon/github.comLarge favicon (up to 256px)
https://yoursite.com/api/favicon/github.com?larger=trueCustom fallback image
https://yoursite.com/api/favicon/example.com?default-avatar=https%3A%2F%2Fmysite.com%2Fdefault.pngError on not found
https://yoursite.com/api/favicon/example.com?throw-error-on-404=trueRedirect mode
https://yoursite.com/api/favicon/github.com?redirect=trueResponse
| Status | Description |
|---|---|
| 200 | Image bytes (proxied, cached) — default mode |
| 302 | Redirect to the favicon image when redirect=true |
| 400 | Invalid domain parameter |
| 404 | No favicon found (only with throw-error-on-404=true) |
Tips
- Reference our URL directly in your pages — no need to download and host icons yourself.
- Always use
loading="lazy"to avoid loading too many icons at once. - For Next.js projects, add this domain to your image domains configuration.
- Icons are served with long cache headers for maximum performance.
- Subdomains are supported (e.g.
play.google.com). - Discovery checks HTML
<link>icons, apple-touch-icons, web app manifests, then/favicon.ico.