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

# CORS, canvas, and Content Security Policy

> img.logo.dev sends Access-Control-Allow-Origin on every response, so you can draw logos on a canvas without a proxy. For OG images and PDFs, get the file from the Logo.dev API.

Every response from `img.logo.dev` carries `Access-Control-Allow-Origin: *`. With `crossorigin="anonymous"` set, canvas calls such as `toDataURL()` work without a proxy. For OG images and PDFs that you render on the server, get the file from the Logo.dev API, and CORS does not apply.

## Draw a logo on a canvas

A cross-origin image taints a `<canvas>`. On a tainted canvas, `toDataURL()` and `getImageData()` throw a `SecurityError`. Set `crossorigin="anonymous"` so the browser makes a CORS request and the canvas stays clean:

```html theme={null}
<img
  src="https://img.logo.dev/stripe.com?token=LOGO_DEV_PUBLISHABLE_KEY"
  crossorigin="anonymous"
  alt="Stripe logo"
/>
```

In script, set `crossOrigin` before `src`:

```javascript theme={null}
const img = new Image();
img.crossOrigin = "anonymous";
img.src = "https://img.logo.dev/stripe.com?token=LOGO_DEV_PUBLISHABLE_KEY";
img.onload = () => {
  ctx.drawImage(img, 0, 0);
  canvas.toDataURL(); // succeeds: the canvas is not tainted
};
```

## Allow img.logo.dev in your Content Security Policy

If your app sets a `Content-Security-Policy`, the browser blocks any image whose origin isn't in `img-src`. The image fires its `error` event, as a broken link does, and the console shows a CSP violation. Add `img.logo.dev` to `img-src`:

```http theme={null}
Content-Security-Policy: img-src 'self' https://img.logo.dev;
```

Your server calls the API with a [secret key](https://www.logo.dev/docs/platform/api-keys.md), not the browser. The API does not need a `connect-src` entry.

## Generate OG images and PDFs on the server

Open Graph images (Satori, `@vercel/og`), PDF and screenshot rendering (Puppeteer, Playwright), and image processing (sharp) need the logo file on your server. Get the file from the API, not the CDN. `GET /v2/brands/logo` returns a download URL for the file. Store the file, and pass its bytes to the renderer. See [self-hosting](https://www.logo.dev/docs/platform/self-hosting.md) for the code.

> [card] [Use Logo.dev with Next.js](https://www.logo.dev/docs/integrations/nextjs.md)
>
> Render `next/image` with `unoptimized` so the browser loads each logo.


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