Website to Markdown API for LLM & RAG (Apify Actor)

Tải bất kỳ URL nào dưới dạng Markdown nội dung chính sạch với liên kết và siêu dữ liệu, tùy chọn thu thập dữ liệu, dành cho LLM, RAG và các tác nhân AI, thông qua Apify Actor. Có thể gọi từ các ứng dụng khách MCP thông qua máy chủ Apify MCP (https://mcp.apify.com/?actors=pennydata/web-fetch-markdown-api). Trả phí theo mức sử dụng, $0.0007 mỗi trang được chuyển đổi; các trang thất bại hoặc trống sẽ không bị tính phí.

Máy chủ MCP được lưu trữ

npx add-mcp 'https://mcp.apify.com/?actors=pennydata/web-fetch-markdown-api'

Cài vào Claude Code, Codex, Cursor và nhiều công cụ khác

Tài liệu

Website to Markdown API for LLM & RAG, $0.7 per 1,000 pages (pennydata/web-fetch-markdown-api) Actor

Website to Markdown for LLM, RAG and AI agents: clean main-content Markdown with links and metadata from any URL, optional crawl. $0.0007 per page; errors are free.

Pricing

$0.70 / 1,000 page converted to markdowns

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 section below.

Each client library has reference documentation the quickstart does not restate: JavaScript/TypeScript (npm install apify-client) and Python (pip install apify-client).

README

Web Fetch to Markdown API for LLM and RAG

Turn web pages into clean, LLM-ready Markdown. Give it URLs, get one dataset row per page with the title, Markdown, word count and links. Built for RAG ingestion, AI agents, vector-database loading and knowledge-base building.

What you get

  • Readability main-content extraction (Mozilla Readability): navigation, footers, cookie banners and sidebars removed.
  • GitHub-flavoured Markdown: headings, lists, tables, fenced code blocks.
  • Links and metadata: title, description, deduplicated absolute links, word count.
  • Optional crawl: follow in-content links to a chosen depth, capped by Max pages.
  • Fast and cheap: plain HTTP (no browser), 512 MB, hundreds of pages per minute.
  • Pay per page, errors free: $0.0007 per page ($0.7 per 1,000). Failed, blocked, non-HTML and empty pages are not charged.

Input

FieldMeaning
startUrlsPages to convert
maxPagesCap on converted (charged) pages, default 10
maxCrawlDepth0 = only given URLs; 1+ follows links
sameDomainOnlyCrawl stays on the start domains
mainContentOnlyReadability extraction (default on)
includeLinks / includeImagesKeep links / image references
minWordsSmaller pages become free error rows

Output

{ "url": "https://example.com/", "title": "Example Domain", "markdown": "...", "wordCount": 25,
  "links": [{ "url": "https://iana.org/domains/example", "text": "More information..." }],
  "extractor": "readability", "depth": 0 }

Use with RAG

Run via the API, read the dataset, split markdown by headings (##) and embed. Works with LangChain, LlamaIndex, n8n and Make through the Apify integrations.

Limits and fair use

Plain HTTP only: pages that render content with JavaScript may return few or no words (a free error row). robots.txt is respected. Private/local addresses are blocked. Convert only pages you are allowed to process; you are responsible for the target site's terms.

Pricing

EventPrice
page-converted$0.0007

No API key and no subscription. Platform compute is billed by Apify as usual.

I built this and earn from its runs. Written with AI assistance (Claude).

Actor input Schema

startUrls (type: array):

Web pages to convert to Markdown. Public pages only; robots.txt is respected.

maxPages (type: integer):

Stop after this many converted (and charged) pages.

maxCrawlDepth (type: integer):

0 = only the given URLs. 1+ also follows links found in the extracted content, up to Max pages.

sameDomainOnly (type: boolean):

When crawling, only follow links on the start URLs' domains.

mainContentOnly (type: boolean):

Strip navigation, footers, cookie banners and sidebars using Mozilla Readability. Turn off for the whole page.

includeLinks (type: boolean):

Keep Markdown links and return a links array.

includeImages (type: boolean):

Keep image references in the Markdown.

minWords (type: integer):

Pages with fewer words are returned as free error rows (e.g. JavaScript-only pages).

proxyConfiguration (type: object):

Apify Proxy for sites that block datacenter IPs.

Actor input object example

{
  "startUrls": [
    "https://docs.apify.com/platform/actors"
  ],
  "maxPages": 10,
  "maxCrawlDepth": 0,
  "sameDomainOnly": true,
  "mainContentOnly": true,
  "includeLinks": true,
  "includeImages": false,
  "minWords": 1,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}

Actor output Schema

results (type: string):

No description

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

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 = {
    "startUrls": [
        "https://docs.apify.com/platform/actors"
    ],
    "maxPages": 10,
    "maxCrawlDepth": 0,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("pennydata/web-fetch-markdown-api").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

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 = {
    "startUrls": ["https://docs.apify.com/platform/actors"],
    "maxPages": 10,
    "maxCrawlDepth": 0,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("pennydata/web-fetch-markdown-api").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

echo '{
  "startUrls": [
    "https://docs.apify.com/platform/actors"
  ],
  "maxPages": 10,
  "maxCrawlDepth": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call pennydata/web-fetch-markdown-api --silent --output-dataset

MCP server setup

{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pennydata/web-fetch-markdown-api"
        }
    }
}

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/27NVIw2nfPb7I3eco/builds/O1GdAyikjqhHUxGub/openapi.json