Convert any URL to a pixel-perfect PDF document with a single API call. Custom page sizes, margins, headers, footers, and background printing — powered by real Chromium rendering.
Start Free — 200 PDFs/monthSnapAPI renders any URL in a full Chromium browser instance, executes JavaScript, loads web fonts, and prints the result to PDF using the browser's native print engine. The output is identical to what you would get from Chrome's "Save as PDF" feature but accessible over a simple HTTP endpoint.
curl -X POST https://api.snapapi.pics/v1/pdf -H "X-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{
"url": "https://example.com/invoice",
"page_format": "A4",
"margin": {"top": "20mm", "bottom": "20mm", "left": "15mm", "right": "15mm"},
"print_background": true
}'
The response includes either a hosted PDF URL or base64-encoded binary data, depending on the response_type parameter. Hosted URLs remain accessible for 72 hours. For permanent storage, decode the base64 data and write directly to your own S3, GCS, or Cloudflare R2 bucket.
Authentication uses the X-Api-Key header. Generate your key at the SnapAPI dashboard after registering at snapapi.pics.
The page_format parameter accepts standard paper sizes: A4, Letter, Legal, A3, and Tabloid. For custom dimensions, specify width and height in CSS units (mm, in, px). Margins are configured per-edge with margin.top, margin.bottom, margin.left, and margin.right.
Set print_background: true to include background colors and images in the PDF output — essential for branded invoices, reports, and marketing materials. Without this flag, Chromium strips backgrounds as it does in the default print dialog, leaving a plain white page.
The landscape parameter switches orientation. Custom headers and footers inject text or HTML at the top and bottom of every page — useful for page numbers, document titles, and company logos. The page_ranges parameter limits output to specific pages when converting long documents.
The most popular use case for website-to-PDF conversion is automated document generation. SaaS applications generate invoices, receipts, statements, and reports by rendering an HTML template at a dynamic URL and converting it to PDF. The HTML template handles all styling and layout; the API converts it to a print-ready document.
This approach separates document design from PDF generation. Your frontend team designs the template using standard HTML and CSS. Your backend passes data to the template via URL parameters or server-side rendering, then calls SnapAPI to produce the PDF. Changes to document design require only HTML edits — no PDF library code changes.
For high-volume generation, use async processing with a message queue. Push PDF jobs to Redis or SQS, process them with workers that call the API, and store the resulting PDFs. The webhook_url parameter enables a push model where SnapAPI delivers the result to your endpoint when generation completes.
CSS print stylesheets give you precise control over how your HTML renders as a PDF. Use @media print rules to hide navigation, footers, and interactive elements that make no sense on paper. The page-break-before and page-break-after properties control where content splits across pages — preventing tables from breaking mid-row and keeping headings attached to their following paragraphs.
SnapAPI respects all CSS print rules when generating PDFs. This means your existing print stylesheets work out of the box without any API-specific adjustments. If your page already prints well from Chrome's print dialog, it will produce identical output through the API.
For dynamic content, the custom_css parameter injects additional CSS rules before rendering. Use this to override styles without modifying the source page — hiding ads, adjusting margins, or changing font sizes specifically for PDF output. The custom_js parameter executes JavaScript before the print capture, enabling you to expand collapsed sections, trigger data loading, or modify DOM elements programmatically.
Web fonts load automatically during rendering. SnapAPI waits for font downloads to complete before generating the PDF, ensuring text renders in the correct typeface rather than falling back to system defaults.
wkhtmltopdf uses an outdated QtWebKit engine that fails to render modern CSS features: flexbox, grid, CSS variables, and recent web font formats often produce incorrect output or crash the process entirely. It has been effectively unmaintained since 2022 and is not suitable for production use with modern web pages.
Puppeteer's PDF generation uses Chromium's print engine and produces high-quality output, but running Puppeteer in production requires managing headless Chrome processes, memory limits, crash recovery, and browser version updates. On serverless platforms like AWS Lambda or Vercel Functions, the Chromium binary exceeds deployment size limits without special packaging.
SnapAPI uses the same Chromium print engine as Puppeteer but hosts the browser infrastructure. Your application sends an HTTP request and receives a PDF — no browser processes to manage, no binary to package, no crash handling to implement. The rendering quality is identical to Puppeteer because the underlying engine is the same.
Free tier: 200 PDF conversions per month with no credit card. Starter at $19/month gives 5,000 conversions. Pro at $79/month provides 50,000. Business at $299/month supports 500,000. All plans include full access to every SnapAPI endpoint — screenshots, scraping, extraction, and AI analysis share the same monthly quota.
The PDF endpoint works identically across all languages — send a POST request with a JSON body and receive a PDF URL or binary data. Python developers use requests, Node.js developers use fetch or the snapapi-js SDK, and Go developers use the standard net/http package. Official SDKs are available for 8 languages at github.com/Sleywill.
Batch PDF generation follows the same concurrency patterns as screenshot batches. Queue URLs into a task queue, process them with workers that call the API concurrently, and store the resulting PDFs. For Node.js, Promise.all with a concurrency limiter handles batches efficiently. For Python, asyncio with aiohttp provides the same capability.
The MCP server (snapapi-mcp on npm) exposes the PDF endpoint as a tool in AI coding environments. Ask Claude Code or Cursor to "convert this URL to PDF" and the MCP server handles the API call transparently. This is particularly useful for generating documentation PDFs during development without switching to a browser.
Sign up at snapapi.pics, retrieve your API key from the dashboard, and your first PDF conversion takes under five minutes from registration to output.
Regulated industries — healthcare, finance, legal, and government — often require archival copies of web pages in a fixed, non-editable format. PDF is the standard archival format because it preserves visual layout, embeds fonts, and can be signed digitally. SnapAPI's PDF endpoint produces archive-quality documents that capture the complete rendered state of a page at a specific point in time.
For compliance workflows, schedule PDF captures at regular intervals using cron, Celery, or a serverless scheduled function. Store each PDF with a timestamp and the source URL in your document management system. This creates an auditable trail of how a web page appeared at each capture time — useful for regulatory submissions, litigation holds, and terms-of-service monitoring.
SnapAPI processes all rendering in ephemeral browser instances. No page content, cookies, or session state is stored on SnapAPI infrastructure after the response is delivered. Your application receives the PDF and decides what to persist, keeping data residency under your control.
For pages behind authentication, pass session cookies or custom headers with the API request. The browser instance uses these credentials to access the page before converting to PDF. Combined with stealth mode for bot-protected pages, SnapAPI handles virtually any page that renders in a standard browser. Proxy routing through residential IPs is available on Pro and Business plans for geographic restrictions.
Does the PDF include web fonts? Yes. SnapAPI waits for all fonts to download before generating the PDF. Google Fonts, Adobe Fonts, and self-hosted web fonts all render correctly.
Can I convert password-protected pages? Yes. Pass session cookies or authentication headers with your API request. The browser uses these credentials to access the page before conversion.
What about JavaScript-rendered pages? SnapAPI executes all JavaScript before generating the PDF. React, Vue, Angular, and Next.js pages render fully including client-side data fetching and dynamic content.
How long are hosted PDFs available? Hosted URLs remain accessible for 72 hours. For permanent storage, use the base64 response type and write the PDF to your own storage infrastructure.