---
title: "Scrape Styleguide"
method: GET
path: "/web/styleguide"
tags: ["Web Extraction"]
---

# Scrape Styleguide

`GET /web/styleguide`

Extract a comprehensive design system from a website including colors, typography, spacing, shadows, and UI components.

## Query parameters

- `domain` string — Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.
- `directUrl` string, uri — A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.
- `maxAgeMs` integer, nullable — Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.
- `timeoutMS` integer — Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
- `colorScheme` 'light' | 'dark' — Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.
- `tags` string[] — Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

## Response `200`

Successful response

- object
  - `status` string — Status of the response, e.g., 'ok'
  - `domain` string — The normalized domain that was processed
  - `styleguide` object — Comprehensive styleguide data extracted from the website
    - `mode` 'light' | 'dark', required — The primary color mode of the website design
    - `colors` object, required — Primary colors used on the website
      - `accent` string, required — Accent color (hex format)
      - `background` string, required — Background color (hex format)
      - `text` string, required — Text color (hex format)
    - `typography` object, required — Typography styles used on the website
      - `headings` object, required — Heading styles
        - `h1` object
          - `fontFamily` string, required — Primary face (first family in the computed stack)
          - `fontFallbacks` string[], required — Full ordered font list from resolved computed font-family
          - `fontSize` string, required
          - `fontWeight` number, required
          - `lineHeight` string, required
          - `letterSpacing` string, required
        - `h2` object
          - `fontFamily` string, required — Primary face (first family in the computed stack)
          - `fontFallbacks` string[], required — Full ordered font list from resolved computed font-family
          - `fontSize` string, required
          - `fontWeight` number, required
          - `lineHeight` string, required
          - `letterSpacing` string, required
        - `h3` object
          - `fontFamily` string, required — Primary face (first family in the computed stack)
          - `fontFallbacks` string[], required — Full ordered font list from resolved computed font-family
          - `fontSize` string, required
          - `fontWeight` number, required
          - `lineHeight` string, required
          - `letterSpacing` string, required
        - `h4` object
          - `fontFamily` string, required — Primary face (first family in the computed stack)
          - `fontFallbacks` string[], required — Full ordered font list from resolved computed font-family
          - `fontSize` string, required
          - `fontWeight` number, required
          - `lineHeight` string, required
          - `letterSpacing` string, required
      - `p` object
        - `fontFamily` string, required — Primary face (first family in the computed stack)
        - `fontFallbacks` string[], required — Full ordered font list from resolved computed font-family
        - `fontSize` string, required
        - `fontWeight` number, required
        - `lineHeight` string, required
        - `letterSpacing` string, required
    - `elementSpacing` object, required — Spacing system used on the website
      - `xs` string, required
      - `sm` string, required
      - `md` string, required
      - `lg` string, required
      - `xl` string, required
    - `shadows` object, required — Shadow styles used on the website
      - `sm` string, required
      - `md` string, required
      - `lg` string, required
      - `xl` string, required
      - `inner` string, required
    - `fontLinks` object, required — Font assets keyed by family name as it appears in fontFamily/fontFallbacks (non-generic names only). Clients match typography.fontFamily / fontWeight or button styles to pick a file URL from files.
    - `components` object, required — UI component styles
      - `button` object, required — Button component styles
        - `primary` object
          - `backgroundColor` string, required
          - `color` string, required
          - `borderColor` string, required — Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)
          - `borderRadius` string, required
          - `borderWidth` string, required
          - `borderStyle` string, required
          - `padding` string, required
          - `minWidth` string, required — Sampled minimum width of the button box (typically px)
          - `minHeight` string, required — Sampled minimum height of the button box (typically px)
          - `fontSize` string, required
          - `fontWeight` number, required
          - `fontFamily` string — Primary button typeface (first in fontFallbacks)
          - `fontFallbacks` string[] — Full ordered font list from computed font-family
          - `textDecoration` string, required
          - `textDecorationColor` string — Hex color of the underline when it differs from the text color
          - `boxShadow` string, required — Computed box-shadow (comma-separated layers when present)
          - `css` string, required — Ready-to-use CSS declaration block for this component style
        - `secondary` object
          - `backgroundColor` string, required
          - `color` string, required
          - `borderColor` string, required — Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)
          - `borderRadius` string, required
          - `borderWidth` string, required
          - `borderStyle` string, required
          - `padding` string, required
          - `minWidth` string, required — Sampled minimum width of the button box (typically px)
          - `minHeight` string, required — Sampled minimum height of the button box (typically px)
          - `fontSize` string, required
          - `fontWeight` number, required
          - `fontFamily` string — Primary button typeface (first in fontFallbacks)
          - `fontFallbacks` string[] — Full ordered font list from computed font-family
          - `textDecoration` string, required
          - `textDecorationColor` string — Hex color of the underline when it differs from the text color
          - `boxShadow` string, required — Computed box-shadow (comma-separated layers when present)
          - `css` string, required — Ready-to-use CSS declaration block for this component style
        - `link` object
          - `backgroundColor` string, required
          - `color` string, required
          - `borderColor` string, required — Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)
          - `borderRadius` string, required
          - `borderWidth` string, required
          - `borderStyle` string, required
          - `padding` string, required
          - `minWidth` string, required — Sampled minimum width of the button box (typically px)
          - `minHeight` string, required — Sampled minimum height of the button box (typically px)
          - `fontSize` string, required
          - `fontWeight` number, required
          - `fontFamily` string — Primary button typeface (first in fontFallbacks)
          - `fontFallbacks` string[] — Full ordered font list from computed font-family
          - `textDecoration` string, required
          - `textDecorationColor` string — Hex color of the underline when it differs from the text color
          - `boxShadow` string, required — Computed box-shadow (comma-separated layers when present)
          - `css` string, required — Ready-to-use CSS declaration block for this component style
      - `card` object — Card component style
        - `backgroundColor` string, required
        - `borderColor` string, required — Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has alpha)
        - `borderRadius` string, required
        - `borderWidth` string, required
        - `borderStyle` string, required
        - `padding` string, required
        - `boxShadow` string, required
        - `textColor` string, required
        - `css` string, required — Ready-to-use CSS declaration block for this component style
  - `code` integer — HTTP status code
  - `key_metadata` KeyMetadata — Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
    - `credits_consumed` integer, required — The number of credits consumed by this request.
    - `credits_remaining` integer, required — The number of credits remaining for your organization after this request.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `408` — Request Timeout
- `429` — Rate limit exceeded
- `500` — Internal server error

---

[API](https://skmtc.net/context/apis/context-dev.md) · [All operations](https://skmtc.net/context/apis/context-dev/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/context/context-dev/versions/182f532c2552/schema)
