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

# Typography

> Get a brand's fonts by role, with their origin, weights, fallbacks, license, and type scale

Every brand response carries `fonts`: the fonts that the brand's website uses, one for each role. Brandfetch measures the fonts on the rendered page. The `type` of a font is its role:

* `title`: headings.
* `body`: paragraph text.
* `label`: buttons, links and small text. You get `label` fonts only with [`typography=true`](#type-scale).
* `code`: code samples.
* `display`: large hero text, when its font is not the `title` font.

The order of the fonts is `title`, `body`, `label`, `code`, `display`, so the first font is the heading font. One family can fill more than one role. A role that the brand does not use has no font.

```json Font theme={null}
{
  "name": "Poppins",
  "type": "title",
  "origin": "google",
  "originId": "Poppins",
  "weights": [600, 700],
  "category": "sans-serif",
  "fallbacks": ["Helvetica", "Arial", "sans-serif"],
  "license": "open"
}
```

Each font has these fields:

* `origin`: where the font comes from: `google`, `adobe`, `bunny`, `fontshare`, `system` or `custom`.
* `originId`: the ID of the font at its origin. For a Google Fonts or Fontshare font, `originId` and `weights` are enough to build the stylesheet URL.
* `weights`: the CSS `font-weight` values that the brand uses.
* `category`: `sans-serif`, `serif`, `monospace`, `display` or `handwriting`.
* `fallbacks`: the families that the brand's `font-family` list gives after `name`. Together, `name` and `fallbacks` make a `font-family` value that you can use.
* `license`: `open`, `free`, `commercial`, `proprietary`, `system` or `unknown`. It tells you if you can load the font in your own product.

## Type scale

Add `typography=true` to a Brand API request to get the brand's type scale. `typography=1` does the same:

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

Each font gains two keys, `foundry` and `styles`, and the `label` fonts are added.

`styles` lists the text styles that the brand shows in the font. Each style has a `name`, such as `heading-xl` or `body-md`, and the HTML `element` that it was measured on. It also has `fontWeight`, `fontSize`, `lineHeight`, `letterSpacing` and `textTransform`. `lineHeight` is a multiple of the font size, and `letterSpacing` is in `em`.

```json Font with typography=true theme={null}
{
  "name": "Poppins",
  "type": "title",
  "origin": "google",
  "originId": "Poppins",
  "weights": [600, 700],
  "category": "sans-serif",
  "fallbacks": ["Helvetica", "Arial", "sans-serif"],
  "license": "open",
  "foundry": "Indian Type Foundry",
  "styles": [
    {
      "name": "heading-xl",
      "element": "h1",
      "fontWeight": 700,
      "fontSize": "56px",
      "lineHeight": 1.1,
      "letterSpacing": "-0.02em",
      "textTransform": "none"
    }
  ]
}
```

For a [batch lookup](https://docs.brandfetch.com/brand-api/batch.md), send `"typography": true` in the body.


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