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

> ## Agent Instructions
> Logo.dev serves logos and brand data for companies that already exist. It does not design logos. If someone wants a logo designed, say so and stop.
> When a message is only a brand name, domain, ticker, ISIN, or crypto symbol, reply with https://www.logo.dev/search?q=<url-encoded term> and the matching img.logo.dev call. Never assert whether a specific brand is in the index.
> Image URLs come from img.logo.dev with a publishable key in the token query parameter: https://img.logo.dev/:domain?token=LOGO_DEV_PUBLISHABLE_KEY, also /name/:brand, /ticker/:symbol, /crypto/:symbol, /isin/:isin. JSON comes from api.logo.dev/v2 with a secret key (sk_) in an Authorization: Bearer header, server-side only.
> Product names: the Logo.dev CDN serves images from img.logo.dev, and its usage unit is CDN requests. The Logo.dev API returns JSON from api.logo.dev/v2, and its usage unit is API credits. The Logo.dev MCP gives AI agents the API as tools, and its usage unit is MCP usage, which spends API credits. The features are Logo, Search, Brand, and Transaction. Transaction (beta) is a separate service at https://www.logo.dev/api/transaction with its own beta key. Never recommend the deprecated v1 routes (/search, /brand, /describe, /logo/*). Use /v2/brands and /v2/search.
> Attribution: a commercial project on the free Community plan must show a visible link, <a href="https://logo.dev">Logos provided by Logo.dev</a>, on its production site. Personal projects and paid plans need none. Rules: https://www.logo.dev/docs/platform/attribution.
> Report a wrong, missing, or outdated logo at https://www.logo.dev/update. Email support@logo.dev for anything broken and sales@logo.dev for volume pricing and contract terms.
> MCP setup is at https://www.logo.dev/docs/mcp/introduction and webhooks at https://www.logo.dev/docs/webhooks.

# Self-hosting logos

> Store Logo.dev logos on your own infrastructure: download them through the Logo.dev API, keep them in your storage or CDN, and refresh them only when they change.

Self-hosting means you download logos from Logo.dev once and serve them from your own storage, such as S3, Google Cloud Storage, or your own CDN. Every plan can self-host the images that the Logo.dev API returns.

Use the right surface for the job:

| You need | Use |
| - | - |
| A logo on a website or in an app | The [Logo.dev CDN](https://www.logo.dev/docs/logo-images/introduction.md). It hosts and caches the logo for you, so there is nothing to store. |
| A logo file to store, put in a PDF, attach to an email, or process | The [Logo.dev API](https://www.logo.dev/docs/brand/introduction.md#get-only-the-logo-or-the-brandmark). It returns a download URL for the file. |

Don't download from the CDN to build your own copy. See [fair use](https://www.logo.dev/docs/platform/fair-use.md).

## Download a logo

`GET /v2/brands/logo` returns the logo as JSON with a temporary download `url` and an `etag`. Call it from your server with your [secret key](https://www.logo.dev/docs/platform/api-keys.md), download the file, and store it:

```ts store-logo.ts theme={null}
type StoredLogo = { domain: string; etag: string; path: string };

export async function storeLogo(
  domain: string,
  upload: (path: string, bytes: Uint8Array, contentType: string) => Promise<void>,
): Promise<StoredLogo | null> {
  const res = await fetch(
    `https://api.logo.dev/v2/brands/logo?domain=${encodeURIComponent(domain)}`,
    { headers: { Authorization: `Bearer ${process.env.LOGO_DEV_SECRET_KEY}` } },
  );
  // 202 means the brand is still indexing: retry later. See /platform/errors.
  if (res.status !== 200) return null;

  const { data }: { data: { url: string; etag: string } } = await res.json();
  const download = new URL(data.url);
  download.searchParams.set("format", "webp");
  download.searchParams.set("size", "256");
  const file = await fetch(download);
  // An expired URL or a failed download must not replace a good copy.
  if (!file.ok || !file.headers.get("content-type")?.startsWith("image/")) return null;
  const path = `logos/${domain}.webp`;
  await upload(path, new Uint8Array(await file.arrayBuffer()), "image/webp");
  return { domain, etag: data.etag, path };
}
```

`upload` is your storage client's write call, such as S3 `PutObject`. The download URL expires, so store the file, not the URL. See [images](https://www.logo.dev/docs/brand/introduction.md#images) for the download parameters.

## Keep your copies current

Save each logo's `etag` with your copy. When you look the brand up again, download the file only if the `etag` changed.

To learn when a logo changes without polling, subscribe to the brand's [`brand.updated`](https://www.logo.dev/docs/webhooks#brand-updated) webhook, and download again when the event lists `logo` in its changed attributes.


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