> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brandfetch.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Brandfetch returns real company logos, brand data, and brand context. It does not design, generate, or edit logos.
> To show a logo in a user interface, use the Logo API as an image URL in an <img> tag, such as https://cdn.brandfetch.io/domain/{domain}?c={CLIENT_ID}. The client ID is public and belongs in frontend code. Never download, proxy, re-host, or optimize these images on a server, because requests that look programmatic are redirected with automated_traffic. In Next.js, this means next/image needs a custom loader or the unoptimized prop.
> To turn a company name that a user types into a domain, use the Brand Search API with the same client ID, and keep only the domain the user picks.
> For colors, fonts, downloadable logo files, and company data as JSON, call the Brand API from a server with the header Authorization: Bearer {API_KEY}, reading the key from an environment variable and never exposing it to the browser. Prefer typed routes such as /v2/brands/domain/{domain} and /v2/brands/ticker/{ticker} over the auto-detect route /v2/brands/{identifier}.
> Use the Brand Context API for a written summary of what a company does, who it sells to, and how it sounds, and the Transaction API to identify the merchant behind a card or bank transaction label.
> When a request fails, branch on the x-bf-error header code rather than on the status code or the message text. Every code, and what to do about it, is listed at https://docs.brandfetch.com/concepts/errors.
> Requests for brandfetch.com are free on the Brand API and Brand Context API, so use that domain in tests and examples.
> Brand API responses can be cached for up to 30 days, while Logo API images must be hotlinked rather than stored and Brand Search results must not be stored at all. See https://docs.brandfetch.com/concepts/caching.
> If the user has no credentials yet, https://brandfetch.com/auth.md explains how they get a client ID and an API key. An agent without an account can pay $0.10 per Brand API, Brand Context API, or Transaction API request with x402 or MPP, as described at https://docs.brandfetch.com/agents/pay-per-request.

# Google Favicon API

> How Google's s2/favicons URL works: the domain and sz parameters, which sizes it honors, the 16px default, the globe it returns on a miss, and a logo API alternative.

The Google Favicon API is an image URL, `https://www.google.com/s2/favicons`, that returns a website's favicon as a PNG. You pass a domain and an optional size, and Google returns the icon it has stored for that site. You don't need a key or an account.

> [!WARNING]
>
> Google doesn't document or support this endpoint. There are no published terms, rate limits, or uptime commitments, and it can change or stop working at any time.

## How to use the Google Favicon API

Put the URL in an `<img>` tag:

```html theme={null}
<img src="https://www.google.com/s2/favicons?domain=nike.com&sz=64" alt="Nike" width="32" height="32" />
```

| Parameter | What it does | Example |
| - | - | - |
| `domain` | The site to get the favicon for | `domain=nike.com` |
| `domain_url` | A full URL instead of a domain | `domain_url=https://www.nike.com/us/` |
| `sz` | The size in pixels, 16 by default | `sz=64` |

The request answers with a `301` redirect to a `gstatic.com` host, which serves the image. Browsers follow the redirect automatically. In your own code, turn on redirect following, or you'll get the redirect back instead of the image.

## Which sizes the Google Favicon API returns

Only certain `sz` values work. These are the ones Google honored in tests Brandfetch ran on November 5, 2026:

| `sz` | Result |
| - | - |
| 16, 24, 32, 48, 64, 96, 128, 180, 256 | An icon at that size, if the site provides one that large |
| Any other value, such as 100, 192, or 512 | A 16px icon |

Even then, the size is a ceiling, not a promise, because Google can only serve the icons a site publishes. Asking for `sz=256` returned 256px for stripe.com, but 192px for nike.com and only 32px for github.com. Check the image's real size before you render it large.

## What happens when there is no favicon

When Google has no icon for a domain, it returns a grey globe at 16px with a `404` status, whatever size you asked for.

Browsers render the globe anyway, and the `<img>` tag fires `onload` instead of `onerror`. So your page can't tell a miss from a real icon. The only way to catch a miss is to fetch the URL from your own code and check for the `404`.

## Favicon vs logo

A favicon is a browser-tab icon, designed to be legible at 16 by 16 pixels. Many favicons are cropped, simplified, or unrelated to the company's actual logo. A logo API returns the brand's real assets instead: the icon, the symbol, and the full horizontal logo, in light and dark versions.

There's also no brand data behind Google's endpoint. It returns whatever the site declares, with no check that it represents the company. Brandfetch returns a logo for 95% of brands in its core sample, and for 86% in an uncurated sample of local, non-tech businesses. The method and results are published on [coverage and quality](https://docs.brandfetch.com/accuracy/coverage-and-quality.md).

## Google Favicon API vs Brandfetch Logo API

| | Google Favicon API | Brandfetch Logo API |
| - | - | - |
| Status | Undocumented, unsupported | Documented, with a [status page](https://status.brandfetch.io/) |
| Returns | The site's favicon | The brand's icon, symbol, or logo |
| Sizes | 9 fixed values, capped by what the site publishes | Any width or height from 16 to 2048px, aspect ratio kept |
| Formats | PNG | WebP, PNG, JPG, and SVG for logos and symbols |
| Light and dark versions | No | Yes |
| On a miss | 16px globe with a `404` | Your choice: lettermark, transparent, Brandfetch logo, or an empty `404` |
| Look up by | Domain or URL | [Domain, stock ticker, ISIN, or crypto symbol](https://docs.brandfetch.com/concepts/identifiers.md) |
| Free usage | Not published | [1,000,000 requests a month](https://docs.brandfetch.com/concepts/limits-and-billing.md) |
| Key | None | A free [client ID](https://docs.brandfetch.com/concepts/authentication.md#client-id), safe in frontend code |

## Switch from the Google Favicon API

Switching is a one-line change. Keep the same domain, and set the size with `w` and `h`:

**Google Favicon API**

```text theme={null}
https://www.google.com/s2/favicons?domain=nike.com&sz=128
```

**Brandfetch**

```text theme={null}
https://cdn.brandfetch.io/nike.com/w/128/h/128/icon?c=BRANDFETCH_CLIENT_ID
```

* `icon` is the square brand icon and the closest match to a favicon. `logo` gives you the horizontal logo, and `symbol` gives you the mark.
* `theme/light` returns a light logo for dark backgrounds.
* `fallback/404` returns an empty `404` on a miss, so you can show your own placeholder. `fallback/lettermark` returns the brand's initial on a square.

You can get a client ID in the [developer dashboard](https://developers.brandfetch.com/register). Every option is listed in [Logo API parameters](https://docs.brandfetch.com/logo-api/parameters.md).

## FAQ

> [accordion] Is the Google Favicon API free?
>
> Yes, it needs no key or account. But Google doesn't publish any limits or terms for it, so there's no guarantee it stays available.

> [accordion] What is the largest size the Google Favicon API returns?
>
> 256px, and only when the site publishes an icon that large. Any value above 256 returns a 16px icon.

> [accordion] Why does the Google Favicon API return a globe?
>
> The globe means Google has no favicon for that domain. It comes back at 16px with a `404` status, but an `<img>` tag displays it anyway.

> [accordion] Can the Google Favicon API return a company logo?
>
> No, it only returns the favicon the site declares. For a company's logo, symbol, or icon in light and dark versions, use a logo API such as the [Brandfetch Logo API](https://docs.brandfetch.com/logo-api/overview.md).

## Get started

> [card] [Logo API overview](https://docs.brandfetch.com/logo-api/overview.md)
>
> Show any company's logo with an image URL.

> [card] [Get your client ID](https://developers.brandfetch.com/register)
>
> Free account, no credit card required.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.