# 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.

Published 2026-10-19 · https://avatarsapi.com/blog/favicon-api

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`

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

- `sz` asks for a size; many sites only have a 16 or 32 px icon, so you get an upscaled blur.
- When Google has nothing, it returns a generic globe with a 200 status, so you cannot tell a miss from a hit.
- It is undocumented. There are no terms of use and no SLA.

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

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

- Returns the site's favicon in ICO format.
- Also undocumented, also no terms or SLA.

## 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](https://bimigroup.org), 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:

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

- Validated: the candidate must be a real `image/*` response under 2 MiB from a public address.
- A real miss: if nothing usable exists, you get a 404 with a JSON body (`"code": "ENOTFOUND"`), so `onerror` can show your own placeholder.
- Cached at the edge for 7 days by default. Starter Projects can set `?ttl=` from 1 hour to 28 days; logos change rarely, so `?ttl=28d` suits them.

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](https://www.logo.dev/pricing) or [Brandfetch](https://docs.brandfetch.com/logo-api/overview). We compare those in [Clearbit Logo API alternatives](/blog/clearbit-logo-api-alternative).
