Favicon API

A free, no-API-key favicon URL service. Hotlink any site's icon in an <img> tag, or fetch it programmatically — served and CDN-cached.

Endpoint

GET https://favicon.run/favicon

Parameters

domain
Required. The site's hostname or full URL, e.g. github.com or https://github.com/path. Automatically normalized to a bare hostname.
sz
Optional. Icon size in pixels, clamped to 16–512. Defaults to 32.

Example request

https://favicon.run/favicon?domain=github.com&sz=128

Use it

HTML
<img src="https://favicon.run/favicon?domain=github.com&sz=128" alt="GitHub" width="32" height="32" />
JavaScript
const res = await fetch("https://favicon.run/favicon?domain=github.com&sz=128");
const blob = await res.blob();
Markdown
![GitHub](https://favicon.run/favicon?domain=github.com&sz=128)

Response

Returns the favicon image directly (typically image/png). Responses are cached for 24 hours via Cache-Control: public, max-age=86400, and served with Access-Control-Allow-Origin: * so you can fetch from any origin. Errors return 400 for a missing/invalid domain and 500 if the upstream fetch fails.

Live examples

Every icon below is loaded straight from the API — view the page source to see for yourself.

github.com favicongithub.com · 128px
stripe.com faviconstripe.com · 64px
x.com faviconx.com · 32px
youtube.com faviconyoutube.com · 48px
npmjs.com faviconnpmjs.com · 96px
vercel.com faviconvercel.com · 128px

Frequently Asked Questions

Is the favicon API free?+

Yes — no API key, no signup, no billing. Hotlink it in as many pages as you like.

Do I need to host the favicon myself?+

No. Reference the API URL directly in an <img> tag; we fetch, serve, and cache the icon for you.

What sizes are supported?+

16–512 pixels via the sz parameter. If omitted, the default is 32.

Does it support CORS?+

Yes. Access-Control-Allow-Origin is *, so you can fetch the icon from browser-side JavaScript on any origin.

How is it cached, and how fresh is the icon?+

Each response is cached for 24 hours (Cache-Control: public, max-age=86400), so repeated requests are fast and cheap. The underlying icon refreshes on the same schedule.

Can I use it in production / high-traffic apps?+

Yes. It's served from a CDN with generous caching. For very high volume, consider caching responses on your own side too.

Ready to put it into practice?