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

# GET /brand

> Extract brand colors, logos, fonts, images, and social media links from any website. Costs 10 credits.

## Overview

`/brand` uses headless Chrome to visit a page and extract a comprehensive set of brand assets:

* **Colors** — extracted from the logo, optionally from the screenshot and source code
* **Logos** — primary logo URL with dimensions, plus secondary candidates and favicon
* **Fonts** — font family names detected on the page
* **Images** — OG image, Twitter card image, screenshot URL
* **Social links** — keyed by platform (twitter, linkedin, github, etc.)

## Color extraction options

| Parameter               | What it extracts                                      |
| ----------------------- | ----------------------------------------------------- |
| *(default)*             | Logo colors (`brand_colors`) only                     |
| `screenshotColors=6`    | + N dominant colors from the page screenshot          |
| `css=true`              | + Colors defined in CSS stylesheets                   |
| `html=true`             | + Colors defined in HTML attributes                   |
| `javascript=true`       | + Colors defined in JavaScript source                 |
| `filterAchromatic=true` | Exclude near-white, near-black, and greyscale results |

You can combine any of these.

## Example requests

<CodeGroup>
  ```bash Default theme={null}
  curl "https://api.prefetch.io/brand?url=https://stripe.com" \
    -H "X-API-Key: $PREFETCH_API_KEY"
  ```

  ```bash With screenshot colors theme={null}
  curl "https://api.prefetch.io/brand?url=https://stripe.com&screenshotColors=6" \
    -H "X-API-Key: $PREFETCH_API_KEY"
  ```

  ```bash Full color extraction theme={null}
  curl "https://api.prefetch.io/brand?url=https://stripe.com&screenshotColors=8&css=true&html=true&filterAchromatic=true" \
    -H "X-API-Key: $PREFETCH_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const res = await fetch(
    "https://api.prefetch.io/brand?url=https://stripe.com&screenshotColors=6",
    { headers: { "X-API-Key": process.env.PREFETCH_API_KEY } }
  );
  const { success, data } = await res.json();
  console.log(data.colors.brand_colors[0].hex); // "#635BFF"
  console.log(data.logos.primary.url);
  console.log(data.fonts.families);
  ```
</CodeGroup>

## Example response

```json theme={null}
{
  "success": true,
  "data": {
    "domain": "stripe.com",
    "url": "https://stripe.com",
    "colors": {
      "brand_colors": [
        { "hex": "#635BFF", "name": "blueviolet" },
        { "hex": "#00D4FF", "name": "cyan" }
      ],
      "screenshot_colors": [
        { "hex": "#FFFFFF", "name": "white" },
        { "hex": "#0A2540", "name": "darkblue" }
      ]
    },
    "fonts": {
      "families": ["Sohne", "Inter"]
    },
    "logos": {
      "primary": {
        "url": "https://assets.prefetch.io/logos/stripe-logo.svg",
        "width": null,
        "height": null
      },
      "secondary": [],
      "favicon_url": "https://stripe.com/favicon.ico",
      "icon_url": null,
      "apple_touch_icon": null
    },
    "images": {
      "og_image": "https://stripe.com/img/v3/home/social.png",
      "twitter_image": "https://stripe.com/img/v3/home/social.png",
      "screenshot_url": "https://assets.prefetch.io/screenshots/stripe-1440x900.jpg"
    },
    "social_links": {
      "twitter": "https://twitter.com/stripe",
      "linkedin": "https://linkedin.com/company/stripe"
    }
  },
  "meta": {
    "requestId": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
    "durationMs": 4130
  }
}
```


## OpenAPI

````yaml GET /brand
openapi: 3.1.0
info:
  title: Prefetch API
  description: >-
    Extract brand identity, company data, screenshots, and IAB classifications
    from any URL.
  version: 1.0.0
  contact:
    email: support@prefetch.io
servers:
  - url: https://api.prefetch.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Endpoints
    description: Data extraction endpoints. All require authentication and consume credits.
  - name: Health
    description: Health and readiness probes. No authentication required.
paths:
  /brand:
    get:
      tags:
        - Endpoints
      summary: Extract brand assets
      description: >-
        Extracts brand colors, logos, fonts, images, and social media links from
        a website. A screenshot is always captured. **Credit cost: 10.**
      operationId: getBrand
      parameters:
        - $ref: '#/components/parameters/url'
        - name: screenshotColors
          in: query
          required: false
          description: >-
            Extract N dominant colors from the page screenshot. Range: 2–12.
            Omit to skip screenshot color extraction.
          schema:
            type: integer
            minimum: 2
            maximum: 12
        - name: css
          in: query
          required: false
          description: Extract colors from linked CSS files. Pass `true` to enable.
          schema:
            type: boolean
            default: false
        - name: html
          in: query
          required: false
          description: Extract colors from inline HTML. Pass `true` to enable.
          schema:
            type: boolean
            default: false
        - name: javascript
          in: query
          required: false
          description: Extract colors from linked JS files. Pass `true` to enable.
          schema:
            type: boolean
            default: false
        - name: screenshotWidth
          in: query
          required: false
          description: 'Viewport width in pixels. Range: 320–3000. Default: 1440.'
          schema:
            type: integer
            minimum: 320
            maximum: 3000
            default: 1440
        - name: screenshotHeight
          in: query
          required: false
          description: 'Viewport height in pixels. Range: 320–3000. Default: 900.'
          schema:
            type: integer
            minimum: 320
            maximum: 3000
            default: 900
        - name: screenshotFormat
          in: query
          required: false
          description: 'Screenshot format. Default: `jpeg`.'
          schema:
            type: string
            enum:
              - jpeg
              - png
              - pdf
            default: jpeg
        - name: screenshotFullPage
          in: query
          required: false
          description: Capture the full scrollable page. Pass `true` to enable.
          schema:
            type: boolean
            default: false
        - name: disableAdblocker
          in: query
          required: false
          description: >-
            Disable the built-in adblocker. Pass `true` to enable (useful for
            sites that detect ad blockers).
          schema:
            type: boolean
            default: false
        - name: filterAchromatic
          in: query
          required: false
          description: >-
            Exclude near-white, near-black, and greyscale colors from results.
            Pass `true` to enable.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Brand extraction result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/BrandData'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - success
                  - data
                  - meta
        '400':
          description: Invalid URL or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Revoked key, expired key, credit limit, or blocklisted URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: URL hostname could not be resolved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service temporarily busy — retry shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '504':
          description: Request timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    url:
      name: url
      in: query
      required: true
      description: >-
        The website URL to process. `https://` is prepended automatically if no
        protocol is provided.
      schema:
        type: string
        example: https://stripe.com
  schemas:
    BrandData:
      type: object
      properties:
        domain:
          type: string
          description: Normalized domain extracted from the URL.
          example: stripe.com
        url:
          type: string
          format: uri
          description: The URL that was scraped.
          example: https://stripe.com
        colors:
          $ref: '#/components/schemas/ColorsBlock'
        fonts:
          $ref: '#/components/schemas/BrandFonts'
        logos:
          $ref: '#/components/schemas/LogosBlock'
        images:
          $ref: '#/components/schemas/ImagesBlock'
        social_links:
          $ref: '#/components/schemas/SocialLinks'
      required:
        - domain
        - url
        - colors
        - fonts
        - logos
        - images
        - social_links
    Meta:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
          description: Unique identifier for this request.
          example: a3f2c1d4-7b6e-4f2a-9c1d-8e3f2a1b4c5d
        durationMs:
          type: integer
          nullable: true
          description: Time taken to process the request in milliseconds.
          example: 1842
      required:
        - requestId
        - durationMs
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
          description: Human-readable error message.
          example: Credit limit exceeded
        meta:
          $ref: '#/components/schemas/Meta'
      required:
        - success
        - error
        - meta
    ColorsBlock:
      type: object
      properties:
        brand_colors:
          type: array
          items:
            $ref: '#/components/schemas/ColorItem'
          description: Colors extracted from the logo and brand assets.
        logo_colors:
          type: array
          items:
            $ref: '#/components/schemas/ColorItem'
          description: Colors extracted from the primary logo.
        screenshot_colors:
          type: array
          items:
            $ref: '#/components/schemas/ColorItem'
          description: >-
            Dominant colors extracted from the page screenshot. Present only
            when `screenshotColors` parameter is provided.
        css_colors:
          type: array
          items:
            $ref: '#/components/schemas/ColorItem'
          description: Colors extracted from CSS stylesheets. Present only when `css=true`.
        html_colors:
          type: array
          items:
            $ref: '#/components/schemas/ColorItem'
          description: >-
            Colors extracted from HTML attributes. Present only when
            `html=true`.
        javascript_colors:
          type: array
          items:
            $ref: '#/components/schemas/ColorItem'
          description: >-
            Colors extracted from JavaScript source. Present only when
            `javascript=true`.
      required:
        - brand_colors
    BrandFonts:
      type: object
      properties:
        families:
          type: array
          items:
            type: string
          description: Font family names detected on the page.
          example:
            - Inter
            - Roboto
      required:
        - families
    LogosBlock:
      type: object
      properties:
        primary:
          $ref: '#/components/schemas/LogoObject'
          description: Best candidate for the primary logo.
        secondary:
          type: array
          items:
            $ref: '#/components/schemas/LogoObject'
          description: Other logo candidates found on the page.
        favicon_url:
          type: string
          format: uri
          nullable: true
          description: URL to the site favicon.
          example: https://stripe.com/favicon.ico
        icon_url:
          type: string
          format: uri
          nullable: true
          description: URL to the site icon.
        apple_touch_icon:
          type: string
          format: uri
          nullable: true
          description: URL to the Apple Touch Icon.
      required:
        - primary
        - secondary
        - favicon_url
        - icon_url
        - apple_touch_icon
    ImagesBlock:
      type: object
      properties:
        og_image:
          type: string
          format: uri
          nullable: true
          description: OpenGraph image URL.
        twitter_image:
          type: string
          format: uri
          nullable: true
          description: Twitter card image URL.
        screenshot_url:
          type: string
          format: uri
          nullable: true
          description: URL to the page screenshot stored in cloud storage.
      required:
        - og_image
        - twitter_image
        - screenshot_url
    SocialLinks:
      type: object
      additionalProperties:
        type: string
      description: Social media profile URLs keyed by platform name.
      example:
        twitter: https://twitter.com/stripe
        linkedin: https://linkedin.com/company/stripe
    ColorItem:
      type: object
      properties:
        hex:
          type: string
          description: Hex color code.
          example: '#18E299'
        name:
          type: string
          description: Closest named CSS color.
          example: mediumspringgreen
      required:
        - hex
        - name
    LogoObject:
      type: object
      nullable: true
      properties:
        url:
          type: string
          format: uri
          nullable: true
          description: Public URL to the logo asset.
          example: https://cdn.example.com/logo.svg
        width:
          type: number
          nullable: true
          description: Intrinsic width of the logo in pixels.
        height:
          type: number
          nullable: true
          description: Intrinsic height of the logo in pixels.
      required:
        - url
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Prefetch API key. Obtain one from the dashboard.

````