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

# Context.dev: Contextdev Get Web Styleguide

> Get a website's brand style guide: colors, typography, spacing, shadows, and UI components. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Get a website's brand style guide: colors, typography, spacing, shadows, and UI components.

> [!NOTE]
>
> Tool ID: `contextdev_get_web_styleguide`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'contextdev_get_web_styleguide',
  {
    "domain": "example.com",
    "directUrl": "https://example.com/resource",
    "maxAgeMs": 7776000000
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline run contextdev_get_web_styleguide --input '{
  "domain": "example.com",
  "directUrl": "https://example.com/resource",
  "maxAgeMs": 7776000000
}'
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "cache_metadata": {
      "status": "hit",
      "age_ms": 123
    },
    "request_id": "123e4567-e89b-42d3-a456-426614174000"
  }
}
```

Use `deepline describe contextdev_get_web_styleguide --json` for the latest machine-readable contract.

## Input reference

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

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.domain` | `string` | No | — | 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. Minimum length: 3. |
| `payload.directUrl` | `string` | No | — | Exact URL to inspect. Provide either `domain` or `directUrl`, not both. Format: `uri`. |
| `payload.maxAgeMs` | `integer` | No | `7776000000` | Maximum age of cached brand data in ms. Defaults to 3 months. clamped to 0–1 year. `0` refreshes. |
| `payload.timeoutOpts` | `object` | No | — | Request deadline and what to return when it passes. |
| `payload.colorScheme` | `"light" \| "dark"` | No | — | Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key. Allowed: `light`, `dark`. |
| `payload.zdr` | `"enabled" \| "disabled"` | No | — | `enabled` disables request logs and traces and omits request and response content from usage logs. Brand data and hosted assets may still be stored. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. Allowed: `enabled`, `disabled`. |
| `payload.tags` | `array` | No | — | Comma-separated labels for filtering usage, e.g. `production,team-alpha`. Maximum items: 20. |
| `payload.timeoutMS` | `integer` | No | — | Deprecated: use timeoutOpts.milliseconds. Request deadline in milliseconds. sent as timeoutOpts with the "fail" behavior. Minimum: 1. Maximum: 300000. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Extract colors, typography, spacing, and component styles from a website.",
    "properties": {
      "domain": {
        "type": "string",
        "description": "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.",
        "minLength": 3
      },
      "directUrl": {
        "type": "string",
        "description": "Exact URL to inspect. Provide either `domain` or `directUrl`, not both.",
        "format": "uri"
      },
      "maxAgeMs": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1 year. `0` refreshes.",
        "default": 7776000000
      },
      "timeoutOpts": {
        "type": "object",
        "description": "Request deadline and what to return when it passes.",
        "properties": {
          "milliseconds": {
            "type": "integer",
            "description": "Deadline in milliseconds.",
            "minimum": 1,
            "maximum": 300000
          },
          "behavior": {
            "type": "string",
            "description": "\"fail\" returns 408 at the deadline. \"return-partial\" returns available results; inspect the response’s partial flag. \"return-partial\" requires at least 5000 ms. On POST /web/scrape, an output that is not ready in time fails with error_code REQUEST_TIMEOUT inside a 200 response under either behavior; 408 is returned only when the whole request cannot respond by the deadline.",
            "default": "fail",
            "enum": [
              "fail",
              "return-partial"
            ]
          }
        },
        "required": [
          "milliseconds"
        ],
        "additionalProperties": false
      },
      "colorScheme": {
        "type": "string",
        "description": "Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.",
        "enum": [
          "light",
          "dark"
        ]
      },
      "zdr": {
        "type": "string",
        "description": "`enabled` disables request logs and traces and omits request and response content from usage logs. Brand data and hosted assets may still be stored. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.",
        "enum": [
          "enabled",
          "disabled"
        ]
      },
      "tags": {
        "type": "array",
        "description": "Comma-separated labels for filtering usage, e.g. `production,team-alpha`.",
        "maxItems": 20,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        }
      },
      "timeoutMS": {
        "type": "integer",
        "description": "Deprecated: use timeoutOpts.milliseconds. Request deadline in milliseconds; sent as timeoutOpts with the \"fail\" behavior.",
        "minimum": 1,
        "maximum": 300000
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.finalDOMState` | `"loaded" \| "still-loading"` | No | — | Allowed: `loaded`, `still-loading`. |
| `result.data.status` | `string` | No | — | — |
| `result.data.domain` | `string` | No | — | — |
| `result.data.styleguide` | `object` | No | — | — |
| `result.data.styleguide.mode` | `"light" \| "dark"` | Yes | — | Allowed: `light`, `dark`. |
| `result.data.styleguide.colors` | `object` | Yes | — | — |
| `result.data.styleguide.colors.accent` | `string` | Yes | — | — |
| `result.data.styleguide.colors.background` | `string` | Yes | — | — |
| `result.data.styleguide.colors.text` | `string` | Yes | — | — |
| `result.data.styleguide.typography` | `object` | Yes | — | — |
| `result.data.styleguide.typography.headings` | `object` | Yes | — | — |
| `result.data.styleguide.typography.headings.h1` | `object` | No | — | — |
| `result.data.styleguide.typography.headings.h1.fontFamily` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h1.fontFallbacks` | `array` | Yes | — | — |
| `result.data.styleguide.typography.headings.h1.fontSize` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h1.fontWeight` | `number` | Yes | — | — |
| `result.data.styleguide.typography.headings.h1.lineHeight` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h1.letterSpacing` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h2` | `object` | No | — | — |
| `result.data.styleguide.typography.headings.h2.fontFamily` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h2.fontFallbacks` | `array` | Yes | — | — |
| `result.data.styleguide.typography.headings.h2.fontSize` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h2.fontWeight` | `number` | Yes | — | — |
| `result.data.styleguide.typography.headings.h2.lineHeight` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h2.letterSpacing` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h3` | `object` | No | — | — |
| `result.data.styleguide.typography.headings.h3.fontFamily` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h3.fontFallbacks` | `array` | Yes | — | — |
| `result.data.styleguide.typography.headings.h3.fontSize` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h3.fontWeight` | `number` | Yes | — | — |
| `result.data.styleguide.typography.headings.h3.lineHeight` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h3.letterSpacing` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h4` | `object` | No | — | — |
| `result.data.styleguide.typography.headings.h4.fontFamily` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h4.fontFallbacks` | `array` | Yes | — | — |
| `result.data.styleguide.typography.headings.h4.fontSize` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h4.fontWeight` | `number` | Yes | — | — |
| `result.data.styleguide.typography.headings.h4.lineHeight` | `string` | Yes | — | — |
| `result.data.styleguide.typography.headings.h4.letterSpacing` | `string` | Yes | — | — |
| `result.data.styleguide.typography.p` | `object` | No | — | — |
| `result.data.styleguide.typography.p.fontFamily` | `string` | Yes | — | — |
| `result.data.styleguide.typography.p.fontFallbacks` | `array` | Yes | — | — |
| `result.data.styleguide.typography.p.fontSize` | `string` | Yes | — | — |
| `result.data.styleguide.typography.p.fontWeight` | `number` | Yes | — | — |
| `result.data.styleguide.typography.p.lineHeight` | `string` | Yes | — | — |
| `result.data.styleguide.typography.p.letterSpacing` | `string` | Yes | — | — |
| `result.data.styleguide.elementSpacing` | `object` | Yes | — | — |
| `result.data.styleguide.elementSpacing.xs` | `string` | Yes | — | — |
| `result.data.styleguide.elementSpacing.sm` | `string` | Yes | — | — |

The table shows the first 50 fields. Expand the raw schema below for every field.

> [!NOTE]
>
> This output schema is too large for an inline display. Read the complete live contract with `deepline describe contextdev_get_web_styleguide --json`.

## Deepline cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0.01` per pricing unit.

## Related documentation

* [Connect integrations](https://deepline.com/docs/integrations.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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