# Extract a site's brand assets

> Returns a site's brand assets (identity, logos, icons, colors, fonts, images, videos and social links) from one rendered page load.

Source: https://docs.spicrawl.com/api-reference/brand/brand-post

## POST /v1/brand

Operation ID: `brandPost`. API key scope: `scrape`.

Returns a site's brand assets (identity, logos, icons, colors, fonts, images, videos and social links) from one rendered page load. The page is rendered once, with JavaScript, and a single script reads everything from the live DOM.

Links only. Nothing is downloaded, rehosted or returned as bytes: logos, icons, images and font files are URLs on the target site, and a logo's inline SVG markup is returned only when it is small enough (up to 100 KB) and otherwise as `null` with its URL kept. Videos are returned as platform or embed links with a poster image; a direct video file (.mp4, .webm, .mov, .m4v, .ogv, .m3u8, .mpd) is never returned, even when a `<video>` element uses one.

No LLM is used. Extraction is deterministic, from the page's markup, styles and metadata.

Use `include` to ask for only some sections. Only the sections you ask for appear in the response. Each section is capped (logos 10, icons 20, colors 12, fonts 10, images 50, videos 20, socials 20). A section that fails on the page is empty and named in `warnings`; the request still succeeds.

Use `pages` (1 to 5, default 1) to also read the top pages of the site's sitemap. The start page is always read; the other pages are chosen by path (about, brand, press, media, company, contact, team, pricing first), then by depth. The merged answer carries `pages` with each page's status and credits, and every item carries the `page` it came from. Latency grows with the pages read.

`hints` is always present: short sentences on what to try next when a requested section is empty.

Billing: priced as full-browser rendering, not as a JavaScript-rendered scrape, because the brand script runs as an `evaluate` action that only a full browser can run: 8 credits on a direct or datacenter exit, with no surcharge (32 on a residential or mobile exit). `screenshot=true` renders in full-browser mode at the same price. With `pages` above 1, each page is billed as one such render, and each sitemap file read is billed as a plain scrape. Failures cost 0. A cache hit is billed at the same price as the render that stored it, and the cache behaves as it does for `/v1/scrape`. Check `X-Credits-Charged`.

Not idempotent: each call bills again, whether it renders the page or is served from cache.

### Example

```bash
curl -X POST "https://api.spicrawl.com/v1/brand" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'
```

### Request body

`application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | string (uri) | yes | Page to read. Required; must be http or https with a host. Private and reserved addresses are refused, as on /v1/scrape. |
| `include` | array of string: `identity`, `logos`, `icons`, `colors`, `fonts`, `images`, `videos`, `socials` | no | Sections to return. Omitted means all of them. An unknown value is a 400. |
| `screenshot` | boolean; default `false` | no | Also return a screenshot of the rendered page, as on /v1/scrape. Renders in full-browser mode and bills that tier. |
| `pages` | integer; default `1` | no | Read the start page and up to pages - 1 more pages from the site's sitemap (robots.txt Sitemap line, else /sitemap.xml; the first child of a sitemap index), and merge them into one answer. Each page is one full-browser render; each sitemap file is one plain fetch. Any other value is a 400. |

Example `all_sections`: Every section

```json
{
  "url": "https://example.com"
}
```

Example `logos_and_colors`: Logos and colors only

```json
{
  "url": "https://example.com",
  "include": [
    "logos",
    "colors"
  ]
}
```

### Responses

#### 200

The brand assets. Only the sections named in `include` appear (all of them by default). `credits`
and `engine` are copied from the render, and the `X-Credits-Charged`, `X-Credits-Remaining`,
`X-Request-Id`, `X-Engine` and `X-Warning` headers are set as they are on `/v1/scrape`.

Headers: `X-Request-Id`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | The URL requested. |
| `final_url` | string | yes | The URL the page finally loaded from, after redirects. |
| `identity` | object | no |  |
| `logos` | array of object | no |  |
| `icons` | array of object | no |  |
| `colors` | array of object | no |  |
| `fonts` | array of object | no |  |
| `images` | array of object | no |  |
| `videos` | array of object | no | Platform or embed links only. A direct media file is never returned. |
| `socials` | array of object | no |  |
| `screenshot` |  | no | Copied from the scrape envelope when `screenshot` was true. Same shape as on /v1/scrape. |
| `credits` | integer | no | Credits charged for the render, as on /v1/scrape. |
| `engine` | string | no | The rendering tier that served the page (X-Engine). |
| `warnings` | array of string | yes | Warnings from the page's brand script (a section that failed) and from the scrape envelope. With `pages` above 1, every page's warnings. |
| `hints` | array of string | yes | Short sentences on what to try next when a requested section came back empty, or when a multi-page request found no sitemap. Empty when there is nothing to say. |
| `pages` | array of object | no | Present only when `pages` is above 1. One entry per page read, the start page first. |

Example `brand`: Brand assets of a site

```json
{
  "url": "https://example.com",
  "final_url": "https://example.com/",
  "identity": {
    "name": "Example",
    "description": "Example makes widgets.",
    "language": "en",
    "domain": "example.com",
    "theme_color": "#1d4ed8",
    "tagline": "Widgets for every workshop",
    "subtitle": "Example makes widgets for home makers and professional shops alike.",
    "cta": [
      {
        "text": "Get started",
        "url": "https://example.com/signup"
      },
      {
        "text": "Watch the demo",
        "url": null
      }
    ]
  },
  "logos": [
    {
      "url": "https://example.com/logo.svg",
      "svg": null,
      "format": "svg",
      "width": 0,
      "height": 0,
      "source": "header",
      "theme": "light",
      "score": 0.92
    }
  ],
  "icons": [
    {
      "url": "https://example.com/favicon-32.png",
      "rel": "icon",
      "sizes": "32x32",
      "type": "image/png"
    }
  ],
  "colors": [
    {
      "hex": "#1d4ed8",
      "role": "primary",
      "source": "theme_color",
      "confidence": 0.9
    }
  ],
  "fonts": [
    {
      "family": "Inter",
      "role": "body",
      "weights": [
        400,
        600
      ],
      "source": "google",
      "files": [
        "https://fonts.gstatic.com/s/inter/v13/example.woff2"
      ]
    }
  ],
  "images": [
    {
      "url": "https://example.com/og.png",
      "alt": "Example widgets",
      "width": 1200,
      "height": 630,
      "role": "og"
    }
  ],
  "videos": [
    {
      "provider": "youtube",
      "id": "dQw4w9WgXcQ",
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "embed_url": "https://www.youtube.com/embed/dQw4w9WgXcQ",
      "poster": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
    }
  ],
  "socials": [
    {
      "network": "github",
      "url": "https://github.com/example"
    }
  ],
  "credits": 8,
  "engine": "browser",
  "warnings": []
}
```

#### 400

The request is invalid. Not retryable; fix the request using `code` and `diagnostics.hint`.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 402

`ERR::LIMIT::QUOTA_EXCEEDED`: the organization is out of credits. Not retryable until credits are added. For a partner workspace the message says its free credits are used, with the date they return; once the partner's balance or the workspace's own balance has been funded and is exhausted, it says the provider's balance is exhausted and the partner must add balance. For an ordinary organization the `detail` ends with: To get higher limits, contact our team from the dashboard or at support@spicrawl.com about upgrading your plan.

Headers: `X-Request-Id`, `X-Credits-Remaining`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 404

No such resource for this key's organization.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 413

The request body exceeds the size limit.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 429

Rate, concurrency or live-session limit reached. Retryable after `Retry-After`. For an ordinary organization the rate and concurrency `detail` ends with the sentence "To get higher limits, contact our team from the dashboard or at support@spicrawl.com about upgrading your plan."

Headers: `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`, `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 502

The target, the proxy or the render engine failed. Check `code` and `target_status`; most are retryable and cost 0 credits.

Headers: `Retry-After`, `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 503

No proxy exit or engine capacity was available. Retryable after `Retry-After`; 0 credits.

Headers: `Retry-After`, `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 504

The target did not answer in time (`ERR::UPSTREAM::TIMEOUT`). Retryable; 0 credits. See `diagnostics.hint`.

Headers: `Retry-After`, `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
