# Web Fetch — Any URL to Markdown or Text for AI Agents (`actor-forge/web-fetch`) Actor

Fetch any URL as clean Markdown and plain text for AI agents, MCP and RAG: web pages, PDF, Word, Excel, PowerPoint, EPUB, CSV and JSON. One url in, one result with title and token estimate out. Static HTML, no JavaScript rendering. $1 per 1,000 pages.

- **URL**: https://apify.com/actor-forge/web-fetch.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 94.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 page results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Web Fetch — Any URL to Markdown or Text for AI Agents

Fetch any URL as clean Markdown and plain text for AI agents, MCP and RAG: web pages, PDF, Word, Excel, PowerPoint, EPUB, CSV and JSON. One url in, one result with title and token estimate out. Static HTML, no JavaScript rendering. $1 per 1,000 pages.

**Fetch any URL and get it back as clean Markdown and plain text: one URL in, one result out.** It is a **web fetch tool for AI agents**, **MCP** clients (Claude, Cursor, ChatGPT), LangChain/LlamaIndex RAG pipelines and n8n/Make/Zapier flows. Give it a `url` (or a list) and it works out what the link really is, then returns LLM-ready **Markdown and plain text in the same row**, with the title, metadata, a `tokenEstimate` and the `route` used. Web pages keep only the main content (Mozilla Readability), with headings, lists, tables and links. **Documents work in the same call**: PDFs (text layer, up to 100 pages by default), Word, Excel and PowerPoint, OpenDocument, EPUB, CSV and JSON. OCR for images and scanned PDFs is one toggle away, off by default so calls stay fast and cheap. **What it does not do:** it fetches static HTML with no browser, so it does **not render JavaScript** and does **not get around bot protection, CAPTCHAs or logins**; app-shell pages and refused requests come back as free error rows. It sends an honest crawler user agent and respects robots.txt. **$1 per 1,000 web pages, $2 per 1,000 documents** ($3 per 1,000 OCR pages when you turn OCR on), with no compute bill on top. Failed fetches, unsupported files, pages blocked by robots.txt and empty results are never charged.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| url | detectedFormat | route | title | tokenEstimate | markdown |
| --- | --- | --- | --- | --- | --- |
| https://arxiv.org/pdf/1706.03762 | pdf | pdf-text | Attention Is All You Need | 9600 | Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures… |
| https://en.wikipedia.org/wiki/Retrieval-augmented_generation | html | html | Retrieval-augmented generation - Wikipedia | 5811 | **Retrieval-augmented generation** (**RAG**) is a technique that enables large language models… |
| https://calibre-ebook.com/downloads/demos/demo.docx | docx | office | DOCX Demo | 2604 | # Demonstration of DOCX support in calibre\n\nThis document demonstrates the ability of the calibre DOCX Input plugin… |
| https://raw.githubusercontent.com/apache/poi/trunk/test-data/spreadsheet/SampleSS.xlsx | xlsx | office | Sample Spreadsheet | 96 | ## First Sheet\n\n| Test spreadsheet | column_B |\n| --- | --- |\n| 2nd row | 2nd row 2nd column |… |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `page-result` | $0.001 | per web page converted to Markdown | 1,000 web pages = $1.00 |
| `document-converted` | $0.002 | per PDF (each started 50 text pages), Word, Excel, PowerPoint, OpenDocument, EPUB, CSV or JSON file converted | A 15-page PDF = $0.002; a 120-page PDF = $0.006; 1,000 Word files = $2.00 |
| `page-ocr` | $0.003 | per image, or scanned PDF page, read by OCR | A 10-page scanned PDF = $0.03 |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 1 GB = $0.00005 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `url` | string | no | — | One link to fetch: a web page, PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), OpenDocument, EPUB, CSV, JSON or image. The file type is detected automatically. |
| `urls` | array | no | — | Optional: more links to convert in the same run (up to 1,000 in total, duplicates removed). |
| `includeText` | boolean | no | `true` | Add a text field with the Markdown syntax removed (on by default, so each row has both). |
| `onlyMainContent` | boolean | no | `true` | Keep only the article or main content of web pages (navigation, footers and cookie banners removed). Turn off to convert the whole page body. |
| `ocr` | boolean | no | `false` | Read text from images (PNG, JPEG, TIFF, WebP, GIF, BMP) and from PDF pages that have no text layer, with Tesseract OCR ($0.003 per page). Off by default here so agent calls stay fast and the price predictable; images and scanned PDFs are then reported, not charged. |
| `ocrLanguages` | array | no | `["eng"]` | Languages in your scanned documents (up to 3). For 29 languages and word boxes use the OCR to Text actor. |
| `maxOcrPages` | integer | no | `20` | Upper limit of scanned pages read by OCR in one PDF ($0.003 each). Pages beyond it are left out and the row is marked truncated. |
| `maxPdfPages` | integer | no | `100` | Read at most this many pages of each PDF. |
| `maxRowsPerSheet` | integer | no | `1000` | Excel, OpenDocument and CSV tables are cut after this many rows (marked truncated). |
| `respectRobotsTxt` | boolean | no | `true` | Skip URLs that the site's robots.txt disallows. It is checked before every request: web pages, direct file links and every redirect target. A robots.txt that answers with a server error counts as disallow-all (RFC 9309). |

### Limits & honest notes

- Web pages are fetched as static HTML, with no browser. Pages that build their content with JavaScript (an empty app shell) are reported, not charged; use a browser-based crawler for those. This actor converts the URLs you give it and does not crawl sites (see Website to Markdown for that).
- OCR is off by default in this listing. With it off, images and PDF pages without a text layer are reported with a clear reason and not charged. Turn on "ocr" to read them (up to 20 scanned pages per PDF by default, set by maxOcrPages; 7 languages). For 29 languages and word boxes, use OCR to Text.
- Legacy binary Office files (.doc, .xls, .ppt), RTF, OpenDocument presentations (.odp), HEIC/AVIF images and SVG are not supported. They are reported with a clear reason and never charged.
- Spreadsheets are cut at 1,000 rows per sheet by default (maxRowsPerSheet), and very large results are cut at about 3.5 million characters. Cut rows are marked truncated: true.
- PDFs are read up to their first 100 pages by default in this listing; raise maxPdfPages (up to 2,000) for longer PDFs.
- Files up to 50 MB. Password-protected PDFs and pages behind a login can't be read.
- Polite by design: it sends an honest crawler user agent (ActorForge-AnyUrlToMarkdown) and does not pose as a browser. When a site answers 429 (rate limited) or 403 (refused), that URL is retried at most once (429 only, after Retry-After up to 30 s) and the remaining URLs on the same host are skipped as free error rows.
- tokenEstimate is characters divided by 4. That is a good guide for English with GPT and Claude tokenizers, not an exact count.
- Respects your run budget: set a maximum total charge and processing stops cleanly at the cap. No result is delivered without being paid for, and none is charged twice.

### Related ActorForge actors

- [Any URL to Markdown](https://apify.com/actor-forge/any-url-to-markdown) — the same converter with OCR on by default
- [Website to Markdown](https://apify.com/actor-forge/website-to-markdown) — crawl a whole site, not single URLs
- [PDF to Markdown](https://apify.com/actor-forge/pdf-to-markdown) — PDF-only, with per-page output and RAG chunks

### Changelog

- **2026-10-22** — Initial release of the Web Fetch listing: the Any URL to Markdown engine with Markdown + text in one row, OCR off and a 100-page PDF cap by default.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

## `url` (type: `string`):

One link to fetch: a web page, PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), OpenDocument, EPUB, CSV, JSON or image. The file type is detected automatically.

## `urls` (type: `array`):

Optional: more links to convert in the same run (up to 1,000 in total, duplicates removed).

## `includeText` (type: `boolean`):

Add a text field with the Markdown syntax removed (on by default, so each row has both).

## `onlyMainContent` (type: `boolean`):

Keep only the article or main content of web pages (navigation, footers and cookie banners removed). Turn off to convert the whole page body.

## `ocr` (type: `boolean`):

Read text from images (PNG, JPEG, TIFF, WebP, GIF, BMP) and from PDF pages that have no text layer, with Tesseract OCR ($0.003 per page). Off by default here so agent calls stay fast and the price predictable; images and scanned PDFs are then reported, not charged.

## `ocrLanguages` (type: `array`):

Languages in your scanned documents (up to 3). For 29 languages and word boxes use the OCR to Text actor.

## `maxOcrPages` (type: `integer`):

Upper limit of scanned pages read by OCR in one PDF ($0.003 each). Pages beyond it are left out and the row is marked truncated.

## `maxPdfPages` (type: `integer`):

Read at most this many pages of each PDF.

## `maxRowsPerSheet` (type: `integer`):

Excel, OpenDocument and CSV tables are cut after this many rows (marked truncated).

## `respectRobotsTxt` (type: `boolean`):

Skip URLs that the site's robots.txt disallows. It is checked before every request: web pages, direct file links and every redirect target. A robots.txt that answers with a server error counts as disallow-all (RFC 9309).

## Actor input object example

```json
{
  "url": "https://en.wikipedia.org/wiki/Markdown",
  "includeText": true,
  "onlyMainContent": true,
  "ocr": false,
  "ocrLanguages": [
    "eng"
  ],
  "maxOcrPages": 20,
  "maxPdfPages": 100,
  "maxRowsPerSheet": 1000,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `results` (type: `string`):

One row per URL with Markdown, optional plain text, token estimate, detected format, route and metadata.

## `summary` (type: `string`):

URLs converted per route, and URLs that failed or were skipped (never charged).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "url": "https://en.wikipedia.org/wiki/Markdown"
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/web-fetch").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "url": "https://en.wikipedia.org/wiki/Markdown" }

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/web-fetch").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://en.wikipedia.org/wiki/Markdown"
}' |
apify call actor-forge/web-fetch --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,actor-forge/web-fetch"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/GanNJHrBWGLC9dANm/builds/Tn5yRiYC954kS7VwP/openapi.json
