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

> Extract Structured Website Data. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Extract Structured Website Data.

<Info>
  Tool ID: `contextdev_post_web_extract`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
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={null}
deepline tools execute contextdev_post_web_extract --input '{
  "url": "https://example.com/resource",
  "schema": {}
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "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
    }
  }
}
```

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

## Input reference

Crawl a website, use the provided JSON Schema and instructions to prioritize relevant internal links, and extract structured data from the selected pages.

| 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`.                                                                                                                                                                                                                                                                                                                  |
| `payload.schema`           | `object`  | Yes      | —                                | JSON Schema for the returned data object. TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python users can pass the equivalent JSON Schema object.                                                                                                                                                                                                                                             |
| `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`                          | When true, every returned value must be grounded in facts stated on the page; fields that cannot be supported by the page are returned as null/empty. When false (default), the model may make reasonable inferences and derivations from the page content (e.g. ideal customer, competitor analysis, recommendations) while keeping verifiable specifics (names, quotes, URLs, dates, metrics) faithful to the source. |
| `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;` | —                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `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`                          | When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.                                                                                                                                                                                                           |
| `payload.stopAfterMs`      | `integer` | No       | `80000`                          | Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s). Minimum: 10000. Maximum: 110000.                                                                                                                                                                                                                                                                            |
| `payload.timeoutMS`        | `integer` | No       | —                                | 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). Minimum: 1000. Maximum: 300000.                                                                                                                                                                                                |
| `payload.tags`             | `array`   | No       | —                                | Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. Maximum items: 20.                                                                                                                                                                                                                                                                                                                            |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Crawl a website, use the provided JSON Schema and instructions to prioritize relevant internal links, and extract structured data from the selected pages.",
    "properties": {
      "url": {
        "type": "string",
        "description": "The starting website URL to crawl and extract from. Must include http:// or https://.",
        "format": "uri"
      },
      "schema": {
        "type": "object",
        "description": "JSON Schema for the returned data object. TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python users can pass the equivalent JSON Schema object.",
        "additionalProperties": true
      },
      "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": "When true, every returned value must be grounded in facts stated on the page; fields that cannot be supported by the page are returned as null/empty. When false (default), the model may make reasonable inferences and derivations from the page content (e.g. ideal customer, competitor analysis, recommendations) while keeping verifiable specifics (names, quotes, URLs, dates, metrics) faithful to the source.",
        "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",
        "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 1-based PDF page to parse. Must be greater than or equal to start when both are provided.",
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "includeFrames": {
        "type": "boolean",
        "description": "When true, iframe contents are included in Markdown before extraction.",
        "default": false
      },
      "maxAgeMs": {
        "type": "integer",
        "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",
        "description": "Optional browser wait time in milliseconds after initial page load for each crawled page.",
        "minimum": 0,
        "maximum": 30000
      },
      "settleAnimations": {
        "type": "boolean",
        "description": "When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.",
        "default": false
      },
      "stopAfterMs": {
        "type": "integer",
        "description": "Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).",
        "default": 80000,
        "minimum": 10000,
        "maximum": 110000
      },
      "timeoutMS": {
        "type": "integer",
        "description": "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).",
        "minimum": 1000,
        "maximum": 300000
      },
      "tags": {
        "type": "array",
        "description": "Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.",
        "maxItems": 20,
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        }
      }
    },
    "required": [
      "url",
      "schema"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name                                 | Type      | Required | Default | Details |
| ------------------------------------ | --------- | -------- | ------- | ------- |
| `result.data`                        | `object`  | Yes      | —       | —       |
| `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.key_metadata`           | `object`  | No       | —       | —       |
| `result.meta`                        | `object`  | No       | —       | —       |

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

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "urls_analyzed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "metadata": {
            "type": "object",
            "properties": {
              "numUrls": {
                "type": "integer"
              },
              "maxCrawlDepth": {
                "type": "integer"
              },
              "numSucceeded": {
                "type": "integer"
              },
              "numFailed": {
                "type": "integer"
              },
              "numSkipped": {
                "type": "integer"
              },
              "numBlocked": {
                "type": "integer"
              }
            },
            "required": [
              "numUrls",
              "maxCrawlDepth",
              "numSucceeded",
              "numFailed",
              "numSkipped",
              "numBlocked"
            ],
            "additionalProperties": false
          },
          "key_metadata": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": false
          }
        },
        "required": [
          "status",
          "url",
          "urls_analyzed",
          "data",
          "metadata"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Context.dev provider guide](/docs/providers/contextdev/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
