Generate PDFs from URLs, HTML, or Markdown via API
Render PDF documents with ScreenshotOne in one simple API call, be it URL to PDF, HTML to PDF, or Markdown to PDF.



Control the page layout
Choose A4, Letter, or another paper format. Set margins and landscape orientation for reports, invoices, and other paginated documents.
Choose print or screen styles
Use a page's print stylesheet for a document layout, or screen styles to keep its web appearance. Include background graphics when your design needs them.
Save a long page in one PDF
Use the one-page option when you want a continuous document. For reliable exports, wait for the content you need before rendering.
Integrate today
Generate a PDF in your language
These requests return PDF bytes. Choose A4 paper, print styles, and margins, then save the response as a .pdf file.
# Set SCREENSHOTONE_ACCESS_KEY in your environment.curl --fail --silent --show-error --get \ 'https://api.screenshotone.com/take' \ --header "X-Access-Key: $SCREENSHOTONE_ACCESS_KEY" \ --data-urlencode 'url=https://example.com/' \ --data-urlencode 'format=pdf' \ --data-urlencode 'pdf_paper_format=a4' \ --data-urlencode 'pdf_margin=12mm' \ --data-urlencode 'pdf_print_background=true' \ --data-urlencode 'media_type=print' \ --output example.pdf// Node.js 22+. Save as url-to-pdf.mjs and run on your server.import { writeFile } from "node:fs/promises";
const accessKey = process.env.SCREENSHOTONE_ACCESS_KEY;if (!accessKey) throw new Error("Set SCREENSHOTONE_ACCESS_KEY first.");
const response = await fetch("https://api.screenshotone.com/take", { method: "POST", headers: { "Content-Type": "application/json", "X-Access-Key": accessKey }, body: JSON.stringify({ url: "https://example.com/", format: "pdf", pdf_paper_format: "a4", pdf_margin: "12mm", pdf_print_background: true, media_type: "print", }), signal: AbortSignal.timeout(120_000),});if (!response.ok) throw new Error(`PDF request failed: HTTP ${response.status}`);
const pdf = Buffer.from(await response.arrayBuffer());if (pdf.subarray(0, 5).toString() !== "%PDF-") { throw new Error("The response was not a PDF.");}await writeFile("example.pdf", pdf);import jsonimport osfrom pathlib import Pathfrom urllib.request import Request, urlopen
request = Request( "https://api.screenshotone.com/take", data=json.dumps({ "url": "https://example.com/", "format": "pdf", "pdf_paper_format": "a4", "pdf_margin": "12mm", "pdf_print_background": True, "media_type": "print", }).encode("utf-8"), headers={ "Content-Type": "application/json", "X-Access-Key": os.environ["SCREENSHOTONE_ACCESS_KEY"], }, method="POST",)# HTTP errors raise before the output file is written.with urlopen(request, timeout=120) as response: pdf = response.read()if not pdf.startswith(b"%PDF-"): raise ValueError("The response was not a PDF.")Path("example.pdf").write_bytes(pdf)Choose how your PDF is rendered
Use pdf_paper_format and pdf_margin for a paginated document. Set media_type=screen to use screen styles, or use pdf_fit_one_page=true with no fixed paper format and zero margins for one long page. See the PDF options for the full list.
Try your own page in the free URL-to-PDF tool, or follow the Node.js and Python guideto automate exports.

ScreenshotOne is the best product on the market - and that's before you take into account how responsive and easy Dmytro is to work with.
Any time we've found a rare edge case, it's been resolved in hours.
Great company, great founder - can't say enough!
Automate PDF generation
Send a URL, HTML, or Markdown and save the PDF response. Start with the free plan, then connect document generation to your application or workflow.
