---
name: scrape-web-page
description: "Read one public web page as clean Markdown, with its title, author, publish date and images, and with the header, footer and navigation removed. Pages drawn by script, such as shop product pages, are rendered first. Use it to read the pages AI answers cite or a search result. 1 credit per page."
---

# Scrape a web page with querying.ai

Send `Authorization: Bearer $QUERYING_API_KEY` on every request to https://api.querying.ai. Getting a key, and the 500 credits a new account starts with: https://querying.ai/auth.md

## Submit

```bash
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://example.com/article", "maxChars": 50000}}'
```

- `url`: the page to read. A `link` from `GOOGLE_SERP` or a `sources[].url` from an AI answer works as is.
- `maxChars`: 1,000-200,000, default 100,000. `country` (default `US`) sets where the page is read from.

## Read the result

Tasks run asynchronously. The POST returns `task.id` with `status` `QUEUED`. Poll `GET /v1/async/task/{id}` every few seconds until `task.status` is `COMPLETED` or `FAILED`, or add `"webhook": {"url": "https://your.server/hook"}` to the request and the finished task arrives at that URL as a POST. A finished task stays readable for 24 hours.

- `markdown`: the main content with its images; `truncated` is `true` when it stopped at `maxChars`.
- `title`, `author`, `publishedAt`, `images[]` and `finalUrl`, the address after redirects.
- A page that refuses the request ends the task as `FAILED` with `PAGE_UNAVAILABLE` and the site's own status in the message; the credit is released.

## Errors

| HTTP | `code` | When |
| --- | --- | --- |
| 401 | `MISSING_API_KEY` | The key is missing, wrong, expired or revoked. |
| 402 | `INSUFFICIENT_CREDITS` | The account balance is below the task's credits. |
| 403 | `KEY_SCOPE_DENIED` | The key is limited to other engines. |
| 422 | `REGION_UNSUPPORTED` | The engine serves other countries; pick another engine or country. |
| 429 | `KEY_DAILY_CREDIT_LIMIT` | The key reached its daily credit limit; `details.retryAfterSec` counts down to the next UTC day. |

## Over MCP

`scrape_page` on https://mcp.querying.ai/mcp submits and waits for the Markdown. run_prompt takes COMMERCE_SERP with site and query, and `read_product` reads one product page by url.

Reference: https://docs.querying.ai/engines/overview
