Favicon APIs: Google, DuckDuckGo, and what to use in production

How google.com/s2/favicons and icons.duckduckgo.com work, why they're risky in a product, and how to get a higher-quality logo for any domain.

Need a small icon next to a link, a company row, or a search result? The usual trick is a favicon service. Two free ones are everywhere, and neither is an official product.

Google: google.com/s2/favicons

<img src="https://www.google.com/s2/favicons?domain=stripe.com&sz=64" alt="">

DuckDuckGo: icons.duckduckgo.com/ip3/<domain>.ico

<img src="https://icons.duckduckgo.com/ip3/stripe.com.ico" alt="">

Why that matters

Both are fine for an internal dashboard. In a product, an undocumented endpoint can change or start blocking hotlinks without notice, and a 200 globe looks like a bug to your users.

Better: try the brand logo first

Many companies publish a verified square logo for email clients through BIMI, a DNS record that points at an SVG. It is usually the cleanest logo you can get for a domain, and it is public.

https://avatarsapi.com/domain/<domain> tries BIMI first, then falls back to DuckDuckGo and Google favicons, and validates whatever it finds:

<img src="https://avatarsapi.com/domain/stripe.com?size=64" alt="">

The landing page of avatarsapi.com uses exactly this for its own grid of 72 platform logos.

If you need a full logo database

Favicons and BIMI cover the icon case. If you need wordmarks, dark-mode variants, or lookups by ticker, use a dedicated logo API such as logo.dev or Brandfetch. We compare those in Clearbit Logo API alternatives.

Try it: put https://avatarsapi.com/github/torvalds in an <img src>. No key, no signup. Read the docs or create a Project.