markdown=true to /getPageSource and you get the rendered page as clean Markdown instead: headings, paragraphs, lists, tables, links and images with alt text - without scripts, styles, navigation or footer.
The page is fetched exactly like an HTML call: JavaScript-rendered, behind Cloudflare, DataDome, PerimeterX or Akamai, from the country you choose. Only the output changes, and it costs the same as an HTML call.
Request
get_markdown() in Python and Ruby, getMarkdown() in Node.js and PHP.
Response
The body is Markdown,Content-Type: text/markdown; charset=utf-8. For https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html:
- Text structure: headings, paragraphs, bulleted and numbered lists (nested lists kept), block quotes and code blocks with their language.
- Tables as Markdown tables. Key/value lists (
<dl>, common on spec sheets) become- **Weight**: 300 glines. - Absolute links: every link and image URL is resolved against the page, so an agent can follow it.
mailto:andtel:links are kept. - Images with alt text as
. Images without alt text are decoration or tracking pixels and are left out.
<svg>, iframes and embeds, buttons and form controls, dialogs, and hidden elements (hidden, aria-hidden="true").
Main content only
By default (main_content_only=true) you get the page’s main content:
- If the page has a
<main>element holding at least 30% of the page’s text, that element is used, without the menus inside it. - Otherwise the whole page is used, without navigation, the site header, the footer and sidebars (
<nav>,<header>,<footer>,<aside>and their ARIA roles). An article’s own<header>is kept.
main_content_only=false to keep the whole page, for example when you need the footer’s contact details or the site’s navigation links.
Combining with other parameters
proxy_countryworks as usual: the page is fetched from that country, then converted.stepsrun first: click “load more”, type into a search box or wait for a selector, then the resulting page is converted. See browser steps.parsed_data,get_cookiesandlist_elementseach return their own format, so they cannot be combined withmarkdown=true. Such a request answers422and is not billed.
Errors and billing
A Markdown call is billed like an HTML call: only when the page is delivered. Errors are the same as for HTML (see page source) and keep their plain-text body. When the target itself answers 404, 410 or a 5xx error page, that page comes back as Markdown with the target’s status in theX-Origin-Status header, as described in handling failures.
Markdown or parsed data?
Using an AI assistant? The MCP server has a
fetch_markdown tool, and search_and_read searches Google and returns the top results as Markdown in one call.
