Agent Page Extract: Website to Markdown for AI Agents and RAG
Pricing
from $2.00 / 1,000 pages extracted
Agent Page Extract: Website to Markdown for AI Agents and RAG
Give it URLs. Get clean, LLM-ready Markdown. Cheerio first, a real browser only when the page is JavaScript-rendered. For RAG pipelines, AI agents, and html to markdown.
Pricing
from $2.00 / 1,000 pages extracted
Rating
0.0
(0)
Developer
Mario Stefano
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
1
Monthly active users
11 days ago
Last modified
Categories
Features
Share
Agent Page Extract — website to markdown for AI agents and RAG
Give Agent Page Extract a URL. It returns the page as clean, LLM-ready Markdown (or plain text) with the navigation, footer, ads, and cookie banner removed. Use it as a webpage to markdown step in a RAG pipeline, as an AI agent web reader, or as an html to markdown converter that stays cheap on static pages and only opens a browser when the page is actually JavaScript-rendered.
Market and public-sector signals are a different Actor: GW8 Signal API.
One dataset row per page: URL, title, description, markdown, optional text, word count, token estimate, optional links, fetch time, and status.
What it does
- Fetches the page with Crawlee CheerioCrawler (a plain HTTP fetch, no browser).
- If that HTML is empty or still a JavaScript shell, and browser fallback is on, renders it once with PlaywrightCrawler.
- Removes nav, footer, ads, cookie banners, and any extra CSS selectors you pass.
- Extracts the main article with Mozilla Readability and converts it with Turndown.
- Writes the row to the default dataset. A successful row (
status: "ok") is the billable page.
Public pages only. The actor does not log in, does not solve bot checks, and does not follow a page that is clearly a "verify you are human" interstitial. Those rows are blocked and are not billed as extracted pages.
Use cases
- RAG scraper. Turn documentation, help centers, and blogs into chunks you can embed.
- AI agent web reader. Hand an agent one URL, or a short same-host crawl, and let it read Markdown instead of HTML.
- LLM ready context. Drop the chrome so the model spends tokens on the article.
tokenEstimateisceil(characters / 4)on the plain text, a sizing hint rather than a vendor tokenizer. - Website to markdown / webpage to markdown. One page or a small docs crawl (
crawlDepth0, 1, or 2). - HTML to markdown and clean text extractor.
outputFormatismarkdown,text, orboth.
Crawl scope stays small on purpose: same host as the page that linked it, depth at most 2, at most 200 pages, and up to 100 same-host links discovered per page.
Pricing
Pay per event. Copy these two events into the Actor's monetization settings (they are also in .actor/pay_per_event.json).
| Event | When it is charged | Price |
|---|---|---|
actor-start | Once, when the run starts | $0.005 |
page-extracted | Once per page with status: "ok" | $0.002 |
Empty pages, robots.txt skips, bot-check interstitials, fetch errors, and pages skipped by the browser budget are stored with a status and are not charged as page-extracted. The start event is still charged if the run begins.
1 page = $0.007 including the $0.005 start fee; best value at 5+ pages. Five successful pages cost $0.015, so the start fee is a third of that bill. One successful page is $0.007, and most of that is the start fee.
| Successful pages | What you pay |
|---|---|
| 1 | $0.007 |
| 5 | $0.015 |
| 10 (the default cap) | $0.025 |
| 200 (the hard cap) | $0.405 |
Formula: $0.005 + $0.002 × successful pages. Set the run's maximum charge at least to $0.007 so one start plus one page fits. Browser fallback needs 1024 MB. Below that the Actor stays on Cheerio and records memory below 1024MB. The manifest allows 512–4096 MB and defaults to 1024 MB.
Input
| Field | Default | What it does |
|---|---|---|
startUrls | required | URL strings or { "url": "..." } objects. http and https only. |
crawlDepth | 0 | Same-host hops. 0 means only the URLs you listed. Max 2. |
maxPages | 10 | Pages processed, including non-ok rows. Hard cap 200. |
includeLinks | false | Add article links (url, text) to the row. |
outputFormat | markdown | markdown, text, or both. |
removeSelectors | none | Extra CSS selectors removed before extraction. |
useBrowserFallback | true | Render in Chrome only when the cheap fetch is empty or a JS shell. |
maxBrowserPages | 3 | Playwright pages per run. 0 stays on Cheerio. Maximum 20. |
respectRobotsTxt | true | Obey robots.txt. Disallowed URLs are blocked and not fetched. |
{"startUrls": [{ "url": "https://docs.example.com/guide" }],"crawlDepth": 1,"maxPages": 20,"includeLinks": true,"outputFormat": "both","removeSelectors": [".newsletter", "#chat-widget"],"useBrowserFallback": true,"maxBrowserPages": 3,"respectRobotsTxt": true}
Output
Each page is one item in the default dataset. The Overview view shows URL, title, description, status, words, token estimate, and fetch time. Open the Markdown view to read the article.
{"url": "https://docs.example.com/guide","title": "Getting started","description": "Install the reader and turn a webpage into clean markdown.","markdown": "# Getting started\n\nAgent Page Extract turns a public webpage into clean markdown...","text": "Getting started\n\nAgent Page Extract turns a public webpage into clean markdown...","wordCount": 86,"tokenEstimate": 112,"links": [{ "url": "https://docs.example.com/guide/install", "text": "Install the reader" }],"fetchedAt": "2026-11-05T23:00:00.000Z","status": "ok"}
text is present when outputFormat is text or both. links is present when includeLinks is true. markdown is present when the format is markdown or both.
status | Meaning | page-extracted charge |
|---|---|---|
ok | Main content extracted | Yes |
empty | Fetched, but no article text, or the browser budget skipped it | No |
blocked | robots.txt, or a bot-check interstitial | No |
error | The fetch failed | No |
How the fetch stays cheap
Cheerio runs first on every URL. Playwright runs only for pages that came back empty or as a JavaScript shell (<div id="root">, "enable JavaScript", and similar) while useBrowserFallback is true, and only while the run is still inside its browser budget:
- at most
maxBrowserPagesbrowser pages (default 3, hard max 20) - at most 90 seconds of browser time for the whole run, including later crawl depths. Each batch only gets the time still left
- no browser at all when the container memory is known and below 1024 MB
A page that misses that budget is status: "empty" with note set to browser budget reached, browser time budget reached, or memory below 1024MB. Those rows are not charged. A normal article never opens Chrome. A short static note does not either. A bot-check page is not sent to the browser.
The browser waits for domcontentloaded, uses a 15 second navigation timeout and a 20 second handler timeout, and aborts Playwright resource types image, font, and media (including assets whose URLs have no file extension). Each run writes a RUN_STATS key-value record: cheerioPages, browserPages, browserMs, and memoryMbytes. The final status message includes the browser page count.
The crawler sends User-Agent: Mozilla/5.0 (compatible; AgentPageExtract/1.0; +https://apify.com) and, unless you turn it off, checks robots.txt for that agent (and for *).
FAQ
Can I get plain text instead of Markdown?
Yes. Set outputFormat to text or both. The clean text extractor uses the same article Readability picked.
Will it crawl a whole website?
No. Depth is 0–2 and the page cap is 200, same host only. That is enough for a docs section, not a full-site mirror.
Does it execute JavaScript?
Only as a fallback, and only when the first fetch has no real article. Turn useBrowserFallback off to stay on HTTP.
Does it respect robots.txt?
Yes, by default. Disallowed URLs are marked blocked and are not downloaded.
Why was a page not charged?
Only status: "ok" fires page-extracted. Empty, blocked, and error rows are still in the dataset so you can see what happened.
What is tokenEstimate?
Math.ceil(plainText.length / 4). Use it to size a context window. It is not a count from a specific model tokenizer.
Can it read pages behind a login or a captcha?
No. It reads public HTML. A "verify you are human" page is stored as blocked and is not rendered in the fallback browser.
How much memory should a run use?
1024 MB is the default and the minimum that enables Playwright. 512 MB runs Cheerio only. The maximum is 4096 MB. The Docker image is apify/actor-node-playwright-chrome.
How is this different from Apify's Website Content Crawler?
Website Content Crawler is the full-site tool: sitemaps, large crawls, and a browser-first fetch. Agent Page Extract is the small reader. Cheerio fetches every URL first, Playwright is capped (default 3 pages, 90 seconds), depth stops at 2, and a successful page is $0.002 plus the $0.005 start. Use this Actor for a handful of URLs. Use Website Content Crawler when the job is a large site.
Local tests
From this folder, on Node 20 or newer:
npm installnpm test
The tests serve mock HTML pages on 127.0.0.1 and check extraction, robots.txt, crawl depth, the page cap, and the browser fallback. They do not call Apify, and they do not touch the Render app in the rest of this repository.
Keywords
website to markdown, webpage to markdown, LLM ready, RAG scraper, AI agent web reader, html to markdown, clean text extractor