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

# Web page to Markdown API (WEB_SCRAPE)

> Read one web page or PDF and get its main content as Markdown, with its title, metadata and images.

`WEB_SCRAPE` reads one page and returns its main content as Markdown: headings, paragraphs, lists, tables, links and images, with the site's header, footer and navigation removed. Pages that script draws, such as shop product pages, are rendered before they are read. To read a search result, pass a `link` from [`GOOGLE_SERP`](/engines/google-serp)'s `organicResults`.

| | |
| - | - |
| `taskType` | `WEB_SCRAPE` |
| Input | `url` (required); `maxChars`, `country` |
| Credits | 1 per task, a multi-page PDF included |
| Country | `US`, or `KR` for Coupang and Olive Young storefronts, when you send none. |
| Location | Not supported (`422 LOCATION_UNSUPPORTED`). |

## Request

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "WEB_SCRAPE", "payload": { "url": "https://www.example.com/guide", "maxChars": 50000 } }'
```

The task runs asynchronously. Read the result as described in [Async tasks](/concepts/async-tasks.md).

## Parameters

| Field | Required | Description |
| - | - | - |
| `url` | Yes | A public `http` or `https` address on the default port, up to 2,048 characters. Addresses with credentials, private or internal hosts, or other ports return `422 VALIDATION_ERROR`. |
| `maxChars` | No | Caps `markdown`, an integer from 1,000 to 200,000. Defaults to 100,000. |
| `country` | No | The language and region the page is requested for. Without it, domestic Coupang and Olive Young storefronts use `KR` and every other page uses `US`. |

## Response

For example:

```json theme={"theme":"css-variables"}
{
  "url": "https://www.example.com/guide",
  "finalUrl": "https://www.example.com/guide",
  "statusCode": 200,
  "title": "...",
  "description": "...",
  "author": "...",
  "publishedAt": "2026-09-12T07:36:36Z",
  "siteName": "...",
  "language": "en",
  "image": "https://...",
  "markdown": "# ...\n\n...\n\n![...](https://...)",
  "images": [{ "url": "https://...", "alt": "..." }],
  "truncated": false
}
```

| Field | Description |
| - | - |
| `url` | The address you sent. |
| `finalUrl` | The address after redirects. |
| `statusCode` | The HTTP status of the page that was read. |
| `markdown` | The main content. Never empty in a completed task. |
| `images` | The pictures in `markdown`, in the order they appear. |
| `truncated` | `true` when `markdown` stopped at `maxChars`. The cut falls on a paragraph break where possible. |
| `title`, `description`, `author`, `publishedAt`, `siteName`, `language`, `image` | Present when the page declares them. |

## PDFs

HTML, plain text and text-based PDFs are supported. A PDF returns its text in page order, its title, author, subject (as `description`) and language when present, and `images: []`. OCR, attachments and layout reconstruction are not supported.

| PDF limit | Value |
| - | - |
| Download size | 8 MiB |
| Pages | 100 |
| Extracted text | 1,000,000 characters |
| Extraction time | 20 seconds |

The whole document is checked regardless of `maxChars`; only the returned Markdown is shortened. Textless, encrypted, damaged, incomplete and over-limit PDFs fail with `PAGE_UNAVAILABLE`.

## Limits and errors

* A page that cannot be read fails the task with `PAGE_UNAVAILABLE` and the reason: an unsupported format, a page answering 404 or 410, or a site that refuses the request.
* A redirect to an address that breaks the `url` rules fails the task. The rules are checked again on every redirect hop.
* `WEB_SCRAPE` ignores `markdown`, `rawResponse` and `searchQueries`. It rejects `html` and `analysis` with `422` and `citationAnalysis` with `400`; see [unsupported flags](/engines/response-options.md#unsupported-flags).
* Other request errors are listed in [Errors](/concepts/errors.md).

## Related

* [Web crawl](/engines/web-crawl.md) to read many pages of one site
* [Web map](/engines/web-map.md) to list a site's addresses first


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