Web Extraction

Extract a styleguide

Changed on

Extract colors, typography, spacing, and component styles from a website.

get/web/styleguide

Request

  • Base URL: https://api.context.dev/v1
  • URL: https://api.context.dev/v1/web/styleguide
  • Auth: HTTP bearer

Query parameters

domainstring

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.

directUrlstring uri

Exact URL to inspect. Provide either domain or directUrl, not both.

maxAgeMsinteger nullable

Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1 year. 0 refreshes.

millisecondsinteger required

Deadline in milliseconds.

behavior'fail' | 'return-partial'

"fail" returns 408 at the deadline. "return-partial" returns available results; inspect the response’s partial flag. "return-partial" requires at least 5000 ms.

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.

zdr'enabled' | 'disabled'

enabled turns on zero data retention. Returns 403 ZDR_NOT_ENABLED unless your organization has ZDR.

tagsstring[]

Labels for filtering usage in the dashboard.

Comma-separated labels for filtering usage, e.g. production,team-alpha.

[
  "production",
  "team-alpha"
]

Response

Successful response

finalDOMState'loaded' | 'still-loading'

loaded, or still-loading when capture ended before the page finished loading.

statusstring

Always ok on success.

domainstring

The normalized domain that was processed

codeinteger

HTTP status code

request_idstring uuid required

Unique ID of this request, also in X-Request-Id. Include it when contacting support.

Example response

{
  "request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"
}

Changes

    • warning

      added the new NO_PUBLISHED_MARKDOWN enum value to the response property for the response status

    • warning

      added the new USAGE_EXCEEDED enum value to the response property for the response status