Render HTML
Send HTML in the body of POST /v1/take and get it back as a PDF, a screenshot or markdown, for example invoices, reports or certificates that your application generates. All options of the take endpoint work, including the PDF options and markdown.
Billing
Every successful render of HTML counts as one request against your quota, whatever the format and also with upload=1; the X-Cost header of the response says so. A render that fails (time limit, validation error) is not billed. Your quota is checked before the HTML is rendered: if it does not cover the request, the API answers 429 with quota.required in the body.
Send HTML
Send a JSON body with html and the options you need. The response is the file itself, as for GET /v1/take.
HTML to PDF
curl https://api.screenshotbase.com/v1/take \
-H "apikey: YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Invoice INV-42</h1><p>Total: EUR 49.00</p>", "format": "pdf", "pdf_margin": "15mm"}' \
-o invoice.pdf
Check the status code before you save the body: errors come back as JSON (see status codes).
The request body
html: the HTML to render, at most 10 MB (10,485,760 bytes of UTF-8), or 50 MB (52,428,800 bytes) withasync=1, so larger documents go through an async job. Send a whole document or a fragment; a fragment is rendered like a page with that body.markdown: markdown to render instead ofhtml, see Markdown input.- Any option of
GET /v1/takeas a JSON field:format,viewport_width,full_page,hide_selectors(an array of selectors),styles, thepdf_*options,upload,attachment_nameand so on. Booleans may betrue/falseor1/0. url: the POST endpoint also renders a URL, with the same rules asGET /v1/take. Send exactly one ofurl,htmlandmarkdown.
html and markdown belong in the request body. In the query string they are refused with a 422, on POST and GET alike, because URLs end up in logs.
Markdown input
Send markdown instead of html to render a README, release notes or a report you write in markdown, as a PDF, a screenshot or markdown again. It is converted to an HTML page and then rendered exactly like html, with the same options, time limit and cost.
curl https://api.screenshotbase.com/v1/take \
-H "apikey: YOUR-API-KEY" \
-H "Content-Type: application/json" \
-d '{"markdown": "# Release notes\n\n| Version | Date |\n| --- | --- |\n| 2.4 | 2026-10-10 |\n\n- [x] Faster exports", "format": "pdf", "pdf_margin": "15mm"}' \
-o notes.pdf
- GitHub's flavor of markdown: tables, task lists, strikethrough and autolinks. At most 1 MB (1,048,576 bytes), and it must be UTF-8.
- The page has a readable default style: system fonts in a centered column of 980 px, with a dark variant for
prefers-color-scheme: darkand print rules for PDFs.stylescan change it, as for any page. - The first level-1 heading becomes the page's title (the
{title}of a PDF template, thetitleof a markdown JSON response). - Raw HTML in the markdown is kept and rendered as
htmlwould be. Links with ajavascript:ordata:target lose it. Relative URLs do not resolve, as forhtml. - Markdown that is too large or too complex to convert answers
422(The markdown field could not be converted to HTML: ...), not billed. When the server converts as much markdown as it may at once, the request answers503renderer_busywithRetry-After: 5, also not billed. - An async job keeps the converted page, encrypted, never the markdown.
Images, fonts and links
The HTML is rendered as an https page on an address of its own, so:
- Relative URLs do not resolve. Use absolute URLs (
https://www.example.com/logo.png), embed small files asdata:URLs, or add a base element to the head of your document, as shown below. - Plain http resources:
http://images are upgraded to https; otherhttp://resources, such as stylesheets, scripts or fonts, are blocked as mixed content. Serve them over https. - Internal addresses are never loaded. Everything the HTML references is held to the same rules as a page from a URL: resources on private, loopback, link-local or other reserved addresses and internal host names are not fetched, and navigations to them are blocked (see status codes).
Resolve relative URLs with a base element
<!doctype html>
<html>
<head>
<base href="https://www.example.com/assets/">
<link rel="stylesheet" href="invoice.css">
</head>
<body>
<img src="logo.png" alt="Example Inc.">
<h1>Invoice INV-42</h1>
</body>
</html>
JavaScript in the HTML runs as in a browser, so pages that build their content with script work. The wait_until, delay and block_* options apply as for URLs.
Time limit
A render of HTML must finish within 110 seconds of the start of the request: loading what the HTML references, the delay (at most 30 seconds), and printing or taking the screenshot. A render that takes longer is stopped and answered with 408; it is not billed. Through the MCP server, a tool call must finish within about 12 seconds, and delay is at most 7 there. HTML that needs longer can be rendered as an async job, with up to 300 seconds.
Privacy
We do not keep the HTML you send: it is written to a temporary file for the render and deleted afterwards. The result is stored only when you pass upload=1. An async job keeps its HTML encrypted, with its result, until the job is deleted, at most 7 days after it finished.
Stored files are public
With upload=1, anyone who has the returned URL can open the file. For documents with personal data, such as invoices, take the file from the response instead of uploading it.
Errors
Besides the errors of GET /v1/take, a request with HTML can answer:
422withSend only one of url, html and markdown.orEither the url, the html or the markdown field is required.;422withThe html field must not be larger than 10 MB (10485760 bytes); with async=true up to 50 MB., orThe markdown field must not be larger than 1 MB (1048576 bytes).;422withThe html field is only accepted in the JSON body of a POST request.(the same formarkdown);422withThe markdown field must be UTF-8 text.orThe markdown field could not be converted to HTML: ...;500withThe page could not be rendered.when the HTML could not be rendered for another reason.
None of them is billed. The status codes page lists all errors.
AI agents (MCP)
On the MCP server, this endpoint is the takePost tool. A screenshot arrives as an image and a PDF as an embedded resource, up to 3 MB; for a larger file, pass upload: true and use the URL of the stored file.
Sandbox keys
A sandbox API key returns a placeholder file of the requested format without rendering the HTML, at no cost (X-Cost: 0).