URL to markdown

Pass format=markdown to the take endpoint to get the content of a web page as markdown, for example to give it to a language model, index it for search or keep it as text. The page is rendered in a headless Chromium browser first, so content that JavaScript builds is included.

Your first conversion

By default the response is the markdown itself, as text/markdown; charset=UTF-8.

Markdown of a web page

GET
/v1/take
curl -G https://api.screenshotbase.com/v1/take \
    -H "apikey: YOUR-API-KEY" \
    --data-urlencode "url=https://example.com" \
    -d format=markdown

For example.com, the response currently looks like this. The page's script adds the same text in five more languages and the link, and both are part of the markdown; the translations are shortened here.

Response (shortened)

# Example Domain

This domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.

…

[Learn more](https://iana.org/help/example-domains)

Main content or whole page

With the default markdown_main_content_only=1, you get the main content of the page: the article, without navigation, sidebars, headers, footers and banners. The markdown starts with the page's main heading as a level-1 heading. When no clear article is found, or the article detection would lose tables or code blocks, the main region of the page is converted instead: the main element, the only article element, or the body without navigation, sidebars, header and footer.

Set markdown_main_content_only=0 to convert the whole page body. Hidden elements and consent dialogs are left out either way.

What the markdown contains

  • Headings, paragraphs and lists, including nested lists.
  • Links and images with absolute URLs. Links keep web (http, https), mailto and tel targets; other links, such as javascript: or data:, keep only their text. Lazy-loaded images get their real source.
  • Tables as GitHub-flavored markdown tables. A table without a header row gets its first row as the header. Tables that only lay out the page (a table around other tables, a single row or column) become plain text.
  • Code blocks as fenced blocks, with the language taken from language-* classes.

Left out are scripts, styles, form controls, embedded media and frames, hidden elements, tracking pixels and consent dialogs. Content inside iframes and shadow DOM is not included.

For markdown, block_cookie_banners and block_ads are on by default, so banners and ads do not end up in the text. Pass block_cookie_banners=0 or block_ads=0 to switch them off. To leave out more elements, list their CSS selectors in hide_selectors.

JSON response

With response_type=json, the response is a JSON object (the markdown is shortened as above):

response_type=json

{
    "url": "https://example.com/",
    "title": "Example Domain",
    "description": null,
    "markdown": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. This is not a service; avoid relying on it for testing and monitoring purposes.\n\n…\n\n[Learn more](https://iana.org/help/example-domains)\n"
}
  • url: the page's final URL, after redirects; null for HTML input.
  • title: the page's Open Graph title, else the title of the article or of the document; null if there is none.
  • description: the page's meta description (or its Open Graph or Twitter description); null if there is none.
  • markdown: the markdown, as in the text response.

Downloads and storage

The text response is shown inline. Set attachment_name to receive it as a download, named after it with .md appended. attachment_name does not apply with response_type=json or upload=1.

With upload=1, the markdown is stored as a .md file and the response is a JSON object with its public URL; response_type does not apply then. The conversion costs the same either way. If the markdown could not be stored, the API answers 503 and the request is not billed. Anyone with the URL can open a stored file.

HTML input

To convert HTML that you have rather than a URL, send it to POST /v1/take with format=markdown (see Render HTML), at most 10 MB (50 MB with async=1). Relative links and images in your HTML stay relative unless the HTML has a base element. In the JSON response, url is null.

Time limit and size

A conversion must finish within 110 seconds of the start of the request: loading the page, the delay (at most 30 seconds) and the conversion. A slower one answers 408 and is not billed. Through the MCP server, a tool call must finish within about 12 seconds, and delay is at most 7 there.

Very large pages are refused with 422 and the message The page is too large to convert to markdown.: pages with more than about 2 million characters of HTML once scripts and styles are removed, or whose conversion needs too much memory. Such requests are not billed.

AI agents (MCP)

On the MCP server, the take tool returns markdown as text, so agents can use it directly without upload.

Sandbox keys

A sandbox API key returns a placeholder text without rendering the page, at no cost (X-Cost: 0). With response_type=json, its url is the URL you sent.