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

> Scrape a web page URL into clean Markdown text for reading, extraction, or LLM use, optionally with links and images. Context.dev Contextdev Get Web Scrape.

Scrape a web page URL into clean Markdown text for reading, extraction, or LLM use, optionally with links and images.

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

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

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

### CLI

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

## 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": {
    "success": true,
    "markdown": "example",
    "contentLength": 123,
    "url": "https://example.com",
    "metadata": {
      "sourceUrl": "https://example.com",
      "finalUrl": "https://example.com"
    },
    "cache_metadata": {
      "status": "hit",
      "age_ms": 123
    },
    "finalDOMState": "loaded",
    "request_id": "123e4567-e89b-42d3-a456-426614174000"
  }
}
```

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

## Input reference

Scrapes the given URL into LLM usable Markdown. Inspect key\_metadata on JSON responses from a recognized API key. Use error\_code to distinguish stable failure categories. ### YouTube YouTube URLs return the video or channel itself rather than the surrounding player and navigation chrome. A URL addressing a single video (`/watch`, `youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration, view count, keywords, full description, and the transcript when the video has captions that can be retrieved. videos without captions return everything except the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`) returns its name, handle, subscriber count, video count, and full description. When `includeImages=true`, video responses also include the thumbnail and channel responses include the avatar.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.url` | `string` | Yes | — | Full URL to scrape into LLM usable Markdown (must include http\:// or https\:// protocol) Format: `uri`. Minimum length: 1. |
| `payload.includeLinks` | `boolean` | No | `true` | Preserve hyperlinks in Markdown output (`html-conversion` only). |
| `payload.includeImages` | `boolean` | No | `false` | Include image references in Markdown output (`html-conversion` only). |
| `payload.shortenBase64Images` | `boolean` | No | `true` | Shorten base64-encoded image data in the Markdown output (`html-conversion` only). |
| `payload.useMainContentOnly` | `boolean` | No | `false` | Extract only the main content of the page, excluding headers, footers, sidebars, and navigation |
| `payload.includeHTML` | `boolean` | No | `false` | When true, the response also includes an `html` field with the page HTML the Markdown was converted from — the same body the Scrape HTML endpoint returns for the equivalent request. |
| `payload.sourcePreference` | `array` | No | `["html-conversion","markdown-direct"]` | Markdown sources in order of preference: `html-conversion` converts the page HTML, `markdown-direct` uses Markdown the site publishes. Minimum items: 1. Items must be unique. |
| `payload.pdf` | `object` | No | `&#123;"shouldParse":true,"ocr":false&#125;` | PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range. |
| `payload.includeFrames` | `boolean` | No | `false` | When true, the contents of iframes are rendered to Markdown. |
| `payload.includeSelectors` | `array` | No | — | Keep matching HTML subtrees before converting to Markdown. Maximum items: 50. |
| `payload.excludeSelectors` | `array` | No | — | Remove matching elements after inclusions. Exclusions take precedence. Maximum items: 50. |
| `payload.maxAgeMs` | `integer` | No | `259200000` | Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1 year (31536000000 ms). `0` fetches fresh. Minimum: 0. Maximum: 31536000000. |
| `payload.waitForMs` | `integer` | No | — | Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). When combined with timeoutOpts, timeoutOpts.milliseconds must be at least waitForMs + 10000 ms. A shorter deadline is rejected with 400 TIMEOUT\_TOO\_SHORT\_FOR\_WAIT. Minimum: 0. Maximum: 30000. |
| `payload.settleAnimations` | `boolean` | No | `false` | When true, waits briefly for CSS and transition animations to settle before converting to Markdown. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages. |
| `payload.actions` | `array` | No | — | Optional browser actions executed in array order after the page loads and before content is captured. Send a JSON array in the query parameter. Maximum: 5 actions. Maximum items: 5. |
| `payload.headers` | `record` | No | — | HTTP headers for the target origin. Non-empty headers bypass caching. |
| `payload.country` | `"ad" \| "ae" \| "af" \| "ag" \| "ai" \| "al" \| "am" \| "ao" \| "ar" \| "at" \| "au" \| "aw" \| "az" \| "ba" \| "bb" \| "bd" \| "be" \| "bf" \| "bg" \| "bh" \| "bi" \| "bj" \| "bm" \| "bn" \| "bo" \| "bq" \| "br" \| "bs" \| "bw" \| "by" \| "bz" \| "ca" \| "cd" \| "cf" \| "cg" \| "ch" \| "ci" \| "cl" \| "cm" \| "cn" \| "co" \| "cr" \| "cv" \| "cw" \| "cy" \| "cz" \| "de" \| "dj" \| "dk" \| "dm" \| "do" \| "dz" \| "ec" \| "ee" \| "eg" \| "es" \| "et" \| "fi" \| "fj" \| "fr" \| "ga" \| "gb" \| "gd" \| "ge" \| "gf" \| "gg" \| "gh" \| "gm" \| "gn" \| "gp" \| "gq" \| "gr" \| "gt" \| "gu" \| "gw" \| "gy" \| "hk" \| "hn" \| "hr" \| "ht" \| "hu" \| "id" \| "ie" \| "il" \| "im" \| "in" \| "iq" \| "ir" \| "is" \| "it" \| "je" \| "jm" \| "jo" \| "jp" \| "ke" \| "kg" \| "kh" \| "kn" \| "kr" \| "kw" \| "ky" \| "kz" \| "la" \| "lb" \| "lc" \| "lk" \| "lr" \| "ls" \| "lt" \| "lu" \| "lv" \| "ly" \| "ma" \| "mc" \| "md" \| "me" \| "mf" \| "mg" \| "mk" \| "ml" \| "mm" \| "mn" \| "mo" \| "mq" \| "mr" \| "mt" \| "mu" \| "mv" \| "mw" \| "mx" \| "my" \| "mz" \| "na" \| "nc" \| "ne" \| "ng" \| "ni" \| "nl" \| "no" \| "np" \| "nz" \| "om" \| "pa" \| "pe" \| "pf" \| "pg" \| "ph" \| "pk" \| "pl" \| "pr" \| "ps" \| "pt" \| "py" \| "qa" \| "re" \| "ro" \| "rs" \| "ru" \| "rw" \| "sa" \| "sc" \| "sd" \| "se" \| "sg" \| "si" \| "sk" \| "sl" \| "sm" \| "sn" \| "so" \| "sr" \| "ss" \| "st" \| "sv" \| "sx" \| "sy" \| "sz" \| "tc" \| "td" \| "tg" \| "th" \| "tj" \| "tl" \| "tm" \| "tn" \| "tr" \| "tt" \| "tw" \| "tz" \| "ua" \| "ug" \| "us" \| "uy" \| "uz" \| "vc" \| "ve" \| "vg" \| "vi" \| "vn" \| "ye" \| "yt" \| "za" \| "zm" \| "zw"` | No | — | Fetch from this country (ISO 3166-1 alpha-2). Allowed: `ad`, `ae`, `af`, `ag`, `ai`, `al`, `am`, `ao`, `ar`, `at`, `au`, `aw`, `az`, `ba`, `bb`, `bd`, `be`, `bf`, `bg`, `bh`, `bi`, `bj`, `bm`, `bn`, `bo`, `bq`, `br`, `bs`, `bw`, `by`, `bz`, `ca`, `cd`, `cf`, `cg`, `ch`, `ci`, `cl`, `cm`, `cn`, `co`, `cr`, `cv`, `cw`, `cy`, `cz`, `de`, `dj`, `dk`, `dm`, `do`, `dz`, `ec`, `ee`, `eg`, `es`, `et`, `fi`, `fj`, `fr`, `ga`, `gb`, `gd`, `ge`, `gf`, `gg`, `gh`, `gm`, `gn`, `gp`, `gq`, `gr`, `gt`, `gu`, See the live schema for the complete constraint. |
| `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 | — | 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. |

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

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.success` | `true` | Yes | — | Allowed: `true`. |
| `result.data.markdown` | `string` | Yes | — | — |
| `result.data.html` | `string` | No | — | — |
| `result.data.contentLength` | `integer` | Yes | — | Minimum: 0. |
| `result.data.url` | `string` | Yes | — | — |
| `result.data.metadata` | `object` | Yes | — | — |
| `result.data.metadata.sourceUrl` | `string` | Yes | — | — |
| `result.data.metadata.finalUrl` | `string` | Yes | — | — |
| `result.data.metadata.title` | `string` | No | — | — |
| `result.data.metadata.description` | `string` | No | — | — |
| `result.data.metadata.language` | `string` | No | — | — |
| `result.data.metadata.keywords` | `array` | No | — | — |
| `result.data.metadata.canonicalUrl` | `string` | No | — | — |
| `result.data.metadata.author` | `string` | No | — | — |
| `result.data.metadata.siteName` | `string` | No | — | — |
| `result.data.metadata.image` | `string` | No | — | — |
| `result.data.metadata.favicon` | `string` | No | — | — |
| `result.data.metadata.publishedTime` | `string` | No | — | — |
| `result.data.metadata.modifiedTime` | `string` | No | — | — |
| `result.data.metadata.robots` | `string` | No | — | — |
| `result.data.metadata.openGraph` | `record` | No | — | — |
| `result.data.metadata.twitter` | `record` | No | — | — |
| `result.data.metadata.alternates` | `array` | No | — | — |
| `result.data.metadata.alternates[].href` | `string` | Yes | — | — |
| `result.data.metadata.alternates[].hreflang` | `string` | No | — | — |
| `result.data.metadata.alternates[].type` | `string` | No | — | — |
| `result.data.metadata.alternates[].title` | `string` | No | — | — |
| `result.data.metadata.headings` | `array` | No | — | — |
| `result.data.metadata.headings[].level` | `integer` | Yes | — | Minimum: 1. Maximum: 6. |
| `result.data.metadata.headings[].text` | `string` | Yes | — | — |
| `result.data.metadata.jsonLd` | `array` | No | — | — |
| `result.data.metadata.additionalMeta` | `record` | 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.actionsApplied` | `array` | No | — | — |
| `result.data.actionsApplied[].instruction` | `string` | Yes | — | — |
| `result.data.actionsApplied[].status` | `"applied" \| "failed" \| "skipped"` | Yes | — | Allowed: `applied`, `failed`, `skipped`. |
| `result.data.actionsApplied[].method` | `string` | No | — | — |
| `result.data.actionsApplied[].targetDescription` | `string` | No | — | — |
| `result.data.actionsApplied[].completionEvidence` | `string` | No | — | — |
| `result.data.actionsApplied[].error` | `string` | No | — | — |
| `result.data.actionsApplied[].durationMs` | `number` | No | — | — |
| `result.data.actionsHtmlStale` | `boolean` | No | — | — |
| `result.data.finalDOMState` | `"loaded" \| "still-loading"` | Yes | — | Allowed: `loaded`, `still-loading`. |
| `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": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "markdown": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "contentLength": {
            "type": "integer",
            "minimum": 0
          },
          "url": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "sourceUrl": {
                "type": "string"
              },
              "finalUrl": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "language": {
                "type": "string"
              },
              "keywords": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "canonicalUrl": {
                "type": "string"
              },
              "author": {
                "type": "string"
              },
              "siteName": {
                "type": "string"
              },
              "image": {
                "type": "string"
              },
              "favicon": {
                "type": "string"
              },
              "publishedTime": {
                "type": "string"
              },
              "modifiedTime": {
                "type": "string"
              },
              "robots": {
                "type": "string"
              },
              "openGraph": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "twitter": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "alternates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "href": {
                      "type": "string"
                    },
                    "hreflang": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "href"
                  ],
                  "additionalProperties": false
                }
              },
              "headings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "level": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 6
                    },
                    "text": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "level",
                    "text"
                  ],
                  "additionalProperties": false
                }
              },
              "jsonLd": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "additionalMeta": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            },
            "required": [
              "sourceUrl",
              "finalUrl"
            ],
            "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
          },
          "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
            }
          },
          "actionsHtmlStale": {
            "type": "boolean"
          },
          "finalDOMState": {
            "type": "string",
            "enum": [
              "loaded",
              "still-loading"
            ]
          },
          "key_metadata": {
            "type": "object",
            "properties": {},
            "required": [],
            "additionalProperties": false
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "success",
          "markdown",
          "contentLength",
          "url",
          "metadata",
          "cache_metadata",
          "finalDOMState",
          "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.