> ## 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 Post Web Extract

> Crawl a website and extract structured data matching a JSON schema and your instructions. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Crawl a website and extract structured data matching a JSON schema and your instructions.

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

## 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_post_web_extract',
  {
    "url": "https://example.com/resource",
    "schema": {}
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline run contextdev_post_web_extract --input '{
  "url": "https://example.com/resource",
  "schema": {}
}'
```

## 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": {
    "status": "example",
    "url": "https://example.com",
    "urls_analyzed": [
      "https://example.com"
    ],
    "data": {},
    "metadata": {
      "numUrls": 123,
      "maxCrawlDepth": 123,
      "numSucceeded": 123,
      "numFailed": 123,
      "numSkipped": 123,
      "numBlocked": 123
    },
    "cache_metadata": {
      "status": "hit",
      "age_ms": 123
    },
    "request_id": "123e4567-e89b-42d3-a456-426614174000"
  }
}
```

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

## Input reference

Extract website data using your JSON Schema and instructions.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.url` | `string` | Yes | — | The starting website URL to crawl and extract from. Must include http\:// or https\://. Format: `uri`. Minimum length: 1. |
| `payload.schema` | `record` | Yes | — | JSON Schema (not an example object) for the returned object. Image fields include relevant page image references. |
| `payload.instructions` | `string` | No | — | Optional extraction guidance, such as which facts to prioritize or how to interpret fields in the schema. Maximum length: 2000. |
| `payload.factCheck` | `boolean` | No | `false` | Require facts stated on the page. Unsupported fields become null or empty. |
| `payload.followSubdomains` | `boolean` | No | `false` | When true, follow links on subdomains of the starting URL's domain. |
| `payload.maxPages` | `integer` | No | `5` | Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. Minimum: 1. Maximum: 50. |
| `payload.maxDepth` | `integer` | No | — | Optional maximum link depth from the starting URL (0 = only the starting page). If omitted, there is no crawl depth limit. Minimum: 0. |
| `payload.pdf` | `object` | No | `&#123;"shouldParse":true&#125;` | PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. |
| `payload.includeFrames` | `boolean` | No | `false` | When true, iframe contents are included in Markdown before extraction. |
| `payload.maxAgeMs` | `integer` | No | `604800000` | Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms). Minimum: 0. Maximum: 2592000000. |
| `payload.waitForMs` | `integer` | No | — | Optional browser wait time in milliseconds after initial page load for each crawled page. Minimum: 0. Maximum: 30000. |
| `payload.settleAnimations` | `boolean` | No | `false` | Wait briefly for CSS animations and transitions to settle before reading each page. |
| `payload.actions` | `array` | No | — | Browser steps before page discovery. Maximum items: 5. |
| `payload.stopAfterMs` | `integer` | No | `80000` | Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are provided. Minimum: 10000. Maximum: 110000. |
| `payload.timeoutOpts` | `object` | No | — | Request deadline and what to return when it passes. |
| `payload.zdr` | `"enabled" \| "disabled"` | No | `"disabled"` | `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR. Allowed: `enabled`, `disabled`. |
| `payload.tags` | `array` | No | — | Labels for filtering usage in the dashboard. Maximum items: 20. |
| `payload.timeoutMS` | `integer` | No | — | Deprecated: use timeoutOpts.milliseconds. Request deadline in milliseconds. sent as timeoutOpts with the "fail" behavior. Minimum: 1000. Maximum: 300000. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Extract website data using your JSON Schema and instructions.",
    "properties": {
      "url": {
        "type": "string",
        "description": "The starting website URL to crawl and extract from. Must include http:// or https://.",
        "minLength": 1,
        "format": "uri"
      },
      "schema": {
        "type": "object",
        "description": "JSON Schema (not an example object) for the returned object. Image fields include relevant page image references.",
        "additionalProperties": {}
      },
      "instructions": {
        "type": "string",
        "description": "Optional extraction guidance, such as which facts to prioritize or how to interpret fields in the schema.",
        "maxLength": 2000
      },
      "factCheck": {
        "type": "boolean",
        "description": "Require facts stated on the page. Unsupported fields become null or empty.",
        "default": false
      },
      "followSubdomains": {
        "type": "boolean",
        "description": "When true, follow links on subdomains of the starting URL's domain.",
        "default": false
      },
      "maxPages": {
        "type": "integer",
        "description": "Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.",
        "default": 5,
        "minimum": 1,
        "maximum": 50
      },
      "maxDepth": {
        "type": "integer",
        "description": "Optional maximum link depth from the starting URL (0 = only the starting page). If omitted, there is no crawl depth limit.",
        "minimum": 0
      },
      "pdf": {
        "type": "object",
        "description": "PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.",
        "default": {
          "shouldParse": true
        },
        "properties": {
          "shouldParse": {
            "type": "boolean",
            "description": "When true, PDF pages are fetched and parsed. When false, PDF pages are skipped.",
            "default": true
          },
          "start": {
            "type": "integer",
            "description": "First 1-based PDF page to parse.",
            "minimum": 1
          },
          "end": {
            "type": "integer",
            "description": "Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must be >= start.",
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "includeFrames": {
        "type": "boolean",
        "description": "When true, iframe contents are included in Markdown before extraction.",
        "default": false
      },
      "maxAgeMs": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms).",
        "default": 604800000,
        "minimum": 0,
        "maximum": 2592000000
      },
      "waitForMs": {
        "type": [
          "integer",
          "null"
        ],
        "description": "Optional browser wait time in milliseconds after initial page load for each crawled page.",
        "minimum": 0,
        "maximum": 30000
      },
      "settleAnimations": {
        "type": "boolean",
        "description": "Wait briefly for CSS animations and transitions to settle before reading each page.",
        "default": false
      },
      "actions": {
        "type": [
          "array",
          "null"
        ],
        "description": "Browser steps before page discovery.",
        "maxItems": 5,
        "items": {
          "description": "Browser action discriminated by `do`. Each variant exposes only its applicable fields.",
          "anyOf": [
            {
              "type": "object",
              "description": "Pause for a fixed number of milliseconds before continuing to the next action.",
              "properties": {
                "do": {
                  "type": "string",
                  "description": "Use `wait` to pause for a fixed duration.",
                  "enum": [
                    "wait"
                  ]
                },
                "timeMs": {
                  "type": "integer",
                  "description": "Time to pause in milliseconds before the next action.",
                  "minimum": 0,
                  "maximum": 30000
                }
              },
              "required": [
                "do",
                "timeMs"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "description": "Resolve and perform one natural-language browser action.",
              "properties": {
                "do": {
                  "type": "string",
                  "description": "Use `perform` for a plain-language browser instruction.",
                  "enum": [
                    "perform"
                  ]
                },
                "action": {
                  "type": "string",
                  "description": "One browser instruction, such as clicking a button or entering text.",
                  "minLength": 1,
                  "maxLength": 500
                }
              },
              "required": [
                "do",
                "action"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "description": "Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.",
              "properties": {
                "do": {
                  "type": "string",
                  "description": "Use `scroll` to move through the page or a container.",
                  "enum": [
                    "scroll"
                  ]
                },
                "direction": {
                  "type": "string",
                  "description": "Direction to scroll. Defaults to down.",
                  "enum": [
                    "up",
                    "down",
                    "left",
                    "right"
                  ]
                },
                "amount": {
                  "description": "Pixels per scroll, one visible viewport, or the current scroll boundary. Defaults to viewport.",
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100000
                    },
                    {
                      "type": "string",
                      "enum": [
                        "viewport",
                        "max"
                      ]
                    }
                  ]
                },
                "container": {
                  "type": "string",
                  "description": "CSS selector for the first matching scroll container. Defaults to the page.",
                  "minLength": 1,
                  "maxLength": 2000
                },
                "maxScrolls": {
                  "type": "integer",
                  "description": "Maximum scroll iterations. Stops early when scrolling and scrollable extent stop changing. Defaults to 1.",
                  "minimum": 1,
                  "maximum": 50
                }
              },
              "required": [
                "do"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "stopAfterMs": {
        "type": "integer",
        "description": "Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are provided.",
        "default": 80000,
        "minimum": 10000,
        "maximum": 110000
      },
      "timeoutOpts": {
        "type": "object",
        "description": "Request deadline and what to return when it passes.",
        "properties": {
          "milliseconds": {
            "type": "integer",
            "description": "Deadline in milliseconds.",
            "minimum": 1000,
            "maximum": 300000
          },
          "behavior": {
            "type": "string",
            "description": "\"fail\" returns 408 at the deadline. \"return-partial\" returns available results; inspect the response’s partial flag.",
            "default": "fail",
            "enum": [
              "fail",
              "return-partial"
            ]
          }
        },
        "required": [
          "milliseconds"
        ],
        "additionalProperties": false
      },
      "zdr": {
        "type": "string",
        "description": "`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.",
        "default": "disabled",
        "enum": [
          "enabled",
          "disabled"
        ]
      },
      "tags": {
        "type": "array",
        "description": "Labels for filtering usage in the dashboard.",
        "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": 1000,
        "maximum": 300000
      }
    },
    "required": [
      "url",
      "schema"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.partial` | `boolean` | No | — | — |
| `result.data.status` | `string` | Yes | — | — |
| `result.data.url` | `string` | Yes | — | — |
| `result.data.urls_analyzed` | `array` | Yes | — | — |
| `result.data.data` | `record` | Yes | — | — |
| `result.data.metadata` | `object` | Yes | — | — |
| `result.data.metadata.numUrls` | `integer` | Yes | — | — |
| `result.data.metadata.maxCrawlDepth` | `integer` | Yes | — | — |
| `result.data.metadata.numSucceeded` | `integer` | Yes | — | — |
| `result.data.metadata.numFailed` | `integer` | Yes | — | — |
| `result.data.metadata.numSkipped` | `integer` | Yes | — | — |
| `result.data.metadata.numBlocked` | `integer` | Yes | — | — |
| `result.data.metadata.actionsApplied` | `array` | No | — | — |
| `result.data.metadata.actionsApplied[].instruction` | `string` | Yes | — | — |
| `result.data.metadata.actionsApplied[].status` | `"applied" \| "failed" \| "skipped"` | Yes | — | Allowed: `applied`, `failed`, `skipped`. |
| `result.data.metadata.actionsApplied[].method` | `string` | No | — | — |
| `result.data.metadata.actionsApplied[].targetDescription` | `string` | No | — | — |
| `result.data.metadata.actionsApplied[].completionEvidence` | `string` | No | — | — |
| `result.data.metadata.actionsApplied[].error` | `string` | No | — | — |
| `result.data.metadata.actionsApplied[].durationMs` | `number` | No | — | — |
| `result.data.cache_metadata` | `object` | Yes | — | — |
| `result.data.cache_metadata.status` | `"hit" \| "miss" \| "zdr"` | Yes | — | Allowed: `hit`, `miss`, `zdr`. |
| `result.data.cache_metadata.age_ms` | `integer` | Yes | — | Minimum: 0. |
| `result.data.key_metadata` | `object` | No | — | — |
| `result.data.request_id` | `string` | Yes | — | Format: `uuid`. |
| `result.meta` | `object` | No | — | — |

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

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "partial": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "urls_analyzed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "data": {
            "type": "object",
            "additionalProperties": {}
          },
          "metadata": {
            "type": "object",
            "properties": {
              "numUrls": {
                "type": "integer"
              },
              "maxCrawlDepth": {
                "type": "integer"
              },
              "numSucceeded": {
                "type": "integer"
              },
              "numFailed": {
                "type": "integer"
              },
              "numSkipped": {
                "type": "integer"
              },
              "numBlocked": {
                "type": "integer"
              },
              "actionsApplied": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "instruction": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "applied",
                        "failed",
                        "skipped"
                      ]
                    },
                    "method": {
                      "type": "string"
                    },
                    "targetDescription": {
                      "type": "string"
                    },
                    "completionEvidence": {
                      "type": "string"
                    },
                    "error": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "instruction",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "numUrls",
              "maxCrawlDepth",
              "numSucceeded",
              "numFailed",
              "numSkipped",
              "numBlocked"
            ],
            "additionalProperties": false
          },
          "cache_metadata": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "hit",
                  "miss",
                  "zdr"
                ]
              },
              "age_ms": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "status",
              "age_ms"
            ],
            "additionalProperties": false
          },
          "key_metadata": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": false
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "status",
          "url",
          "urls_analyzed",
          "data",
          "metadata",
          "cache_metadata",
          "request_id"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## 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.