Website to Markdown API for LLM & RAG (Apify Actor)
Fetch any URL as clean main-content Markdown with links and metadata, optional crawl, for LLM, RAG and AI agents, through an Apify Actor. Callable from MCP clients via the Apify MCP server (https://mcp.apify.com/?actors=pennydata/web-fetch-markdown-api). Pay per use, $0.0007 per page converted; failed or empty pages are not charged.
ホスト型 MCP サーバー
npx add-mcp 'https://mcp.apify.com/?actors=pennydata/web-fetch-markdown-api'Claude Code、Codex、Cursor などにインストールできます
ドキュメント
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.
- URL: https://apify.com/pennydata/web-fetch-markdown-api.md
- Developed by: Penny Data (community)
- Stats: 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- User rating: No ratings yet
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
| Field | Meaning |
|---|---|
startUrls | Pages to convert |
maxPages | Cap on converted (charged) pages, default 10 |
maxCrawlDepth | 0 = only given URLs; 1+ follows links |
sameDomainOnly | Crawl stays on the start domains |
mainContentOnly | Readability extraction (default on) |
includeLinks / includeImages | Keep links / image references |
minWords | Smaller 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
| Event | Price |
|---|---|
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