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

![GitHub](https://yoursite.com/api/favicon/github.com)

cURL

curl -L https://yoursite.com/api/favicon/github.com -o favicon.png

Parameters

ParameterTypeDescription
largerbooleanSet to true to get a larger icon (up to 256px)
default-avatarURL (encoded)Custom fallback URL when no favicon is found
throw-error-on-404booleanReturn HTTP 404 when no icon found (useful for onerror handling)
redirectbooleanWhen true, respond with 302 redirect instead of proxying the image bytes

Examples

Default favicon (32px)

https://yoursite.com/api/favicon/github.com

Large favicon (up to 256px)

https://yoursite.com/api/favicon/github.com?larger=true

Custom fallback image

https://yoursite.com/api/favicon/example.com?default-avatar=https%3A%2F%2Fmysite.com%2Fdefault.png

Error on not found

https://yoursite.com/api/favicon/example.com?throw-error-on-404=true

Redirect mode

https://yoursite.com/api/favicon/github.com?redirect=true

Response

StatusDescription
200Image bytes (proxied, cached) — default mode
302Redirect to the favicon image when redirect=true
400Invalid domain parameter
404No 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.