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

# Branding

> Read the colors, fonts, spacing, buttons and logo of a site from how the page looks. One request at $1 per 1,000 pages, with no extra fee.

Use `branding` when you need the colors, fonts or button styles of a page as values. For an image of the page instead, ask for a [screenshot](https://docs.stophy.dev/scrape/screenshot.md).

## Make a request

Get an API key in the [Quickstart](https://docs.stophy.dev/quickstart). This request reads the look of a home page.

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/scrape \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://bun.com",
    "formats": ["branding"]
  }'
```

```typescript TypeScript theme={null}
import { Stophy } from "stophy";

const stophy = new Stophy();

const { data } = await stophy.scrape({
  url: "https://bun.com",
  formats: ["branding"],
});
console.log(data.branding?.colors);
console.log(data.branding?.fonts);
```

```python Python theme={null}
from stophy import Stophy

stophy = Stophy()

data = stophy.scrape(
    url="https://bun.com",
    formats=["branding"],
)["data"]
print(data["branding"]["colors"])
print(data["branding"]["fonts"])
```

## Read the response

Read `data.branding` for the styles. Start with `logo`, `colorScheme` and `colors` if you only need the brand assets and palette.

```json theme={null}
{
  "success": true,
  "data": {
    "branding": {
      "colorScheme": "light",
      "logo": "https://bun.com/logo.svg",
      "colors": {
        "primary": "#ff1f8f",
        "accent": "#ff6ab5",
        "background": "#ffffff"
      }
    }
  }
}
```

Colors are hex values. A field the page does not show is left out, so check that a field is there before you use it.

| Field | What it holds |
| - | - |
| `colorScheme` | `light` or `dark`. |
| `logo` | The URL of the logo. |
| `colors` | `primary`, `secondary`, `accent`, `background`, `textPrimary`, `textSecondary`, `link`, `success`, `warning` and `error`. |
| `fonts` | The font families the page uses. |
| `typography` | Font families, sizes, weights and line heights. |
| `spacing` | Base unit, border radius, padding and margins. |
| `components` | Styles of `buttonPrimary`, `buttonSecondary` and `input`. |
| `images` | `logo`, `favicon` and `ogImage`. |
| `icons`, `animations`, `layout`, `personality` | Other style facts, when the page shows them. |

## Options

Choose `branding` in `formats` to get styles instead of the default Markdown.

| Field | Type | Default | Effect |
| - | - | - | - |
| `formats` | `array` | `["markdown"]` | Add `"branding"` to return the look of the page. |

## Limits and errors

Use `branding` for web pages, not PDFs. It requires a live browser read.

* The page is read in a browser and never from a stored copy, so the call takes a few seconds.
* A PDF comes back as Markdown only. Asking for `branding` on a PDF returns `400 invalidRequest`.
* A page that answers with a 404 or 410 status, or cannot be read, costs nothing.

## Price

\$1 per 1,000 pages, the same as any page. `branding` adds nothing.

## Related

Use these formats if you need an image or the page text rather than styles.

* [Screenshot](https://docs.stophy.dev/scrape/screenshot.md) captures how the page looks as an image.
* [Images](https://docs.stophy.dev/scrape/images.md) lists the image URLs on a page.
* [Waiting and rendering](https://docs.stophy.dev/scrape/waiting-and-rendering.md) lets a late page finish loading first.
* [Scrape overview](https://docs.stophy.dev/scrape/overview) lists every format.


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