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

# Color palette

> Get a brand's full color system: roles, themes, contrast pairs, and where each color is used

Every brand response carries `colors`: the brand's accent, dark, and light colors. Add `palette=true` to a Brand API request to get the brand's full color system. `palette=1` does the same:

```curl Palette theme={null}
curl --request GET \
--url 'https://api.brandfetch.io/v2/brands/domain/nike.com?palette=true' \
--header 'Authorization: Bearer <token>'
```

The response gains one key, `palette`. The rest of the response does not change. A request without the parameter, or with another value, does not change.

The `palette` object holds:

* `colors`: the ranked colors. Each color has a `role` such as `primary` or `background`, and a `context` of `identity`, `interface`, or `both`. Each color also has the text color that reads best on it.
* `onPairs`: the background and text pairs that the brand's website uses, with their WCAG contrast.
* `themes`: the light and dark themes that the website showed.
* `gradients`: the gradients in the brand's stylesheets.
* `logos`: the colors of each logo and icon.

Each color also says where the website uses it:

* `usage`: the elements that the website paints with the color, such as `button` backgrounds or `link` text, with counts and example labels. This is the field to read when you want to know what a color is for.
* `tokens`: the website's own CSS variable names for the color, such as `hds-color-core-brand-500`.
* `variants`: the near-identical HEX codes that Brandfetch merged into the color.

When Brandfetch finds no color that it can defend as the brand's color, no color has the role `primary`. An integration that shows one brand color has nothing to show for that brand.

A color that only a theme, gradient, on-pair, or logo references is also in `colors`, with `rank: null` and `member: true`. To get the brand colors alone, keep the colors with a `rank`.

If a brand has no palette yet, the first request builds one from the brand's last crawl and stores it. This first request can take some seconds longer. Later requests get the stored palette. A palette built this way has no new render, so `themes` and `onPairs` can be empty. The next crawl of the brand replaces it.


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