SnapPDF is an HTML to PDF API: POST an HTML string or a URL to one Bearer-authenticated REST endpoint and get a pixel-accurate PDF back. Real SDKs in 5 languages — and a free tier that doesn't expire. Start free, then $4/mo when you ship.
curl -X POST https://snappdf.au/api/v1/html-to-pdf \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Invoice #1024</h1>"}' \
--output invoice.pdfAuthenticate with a Bearer key (sk_live_* for production, sk_test_* for sandboxed tests). Base URL: https://snappdf.au/api/v1. HTML-to-PDF costs 5 credits per call.
Snapshot a URL to PDF
Swap the html field for url and SnapPDF renders the live page — fonts, CSS and layout intact. URL-to-PDF is one endpoint, also 5 credits.
curl -X POST https://snappdf.au/api/v1/html-to-pdf \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/report"}' \
--output report.pdfConvert HTML to PDF in your language
Real, shipped SDKs in 5 languages — JavaScript/TypeScript, Python, PHP, Ruby and Go. No hand-rolled HTTP clients required.
npm i snappdfimport { SnapPDF } from "snappdf";
const snap = new SnapPDF({ apiKey: process.env.SNAPPDF_KEY });
const pdf = await snap.htmlToPdf({
html: "<h1>Invoice #1024</h1>",
format: "A4",
});
await pdf.writeTo("invoice.pdf");pip install snappdffrom snappdf import SnapPDF
snap = SnapPDF(api_key=os.environ["SNAPPDF_KEY"])
pdf = snap.html_to_pdf(
html="<h1>Invoice #1024</h1>",
format="A4",
)
pdf.write_to("invoice.pdf")go get github.com/seaqae/snappdf-goclient := snappdf.New(os.Getenv("SNAPPDF_KEY"))
pdf, err := client.HTMLToPDF(snappdf.HTMLToPDFRequest{
HTML: "<h1>Invoice #1024</h1>",
Format: "A4",
})
if err != nil {
log.Fatal(err)
}
os.WriteFile("invoice.pdf", pdf, 0644)Also available: PHP (composer require snappdf/snappdf) and Ruby (gem install snappdf).
Page size, margins, wait-for & more
Pass any of these six options alongside html or url in the request body to control the output.
Page size — A4 (default), Letter, Legal, A3, A5 or Tabloid.
Rotate the page to landscape orientation. Defaults to false.
Page margins as { top, right, bottom, left } — accepts px, mm, cm or in (e.g. "20mm").
Render CSS background colours and images. Defaults to true.
Wait N milliseconds, or until a CSS selector appears, before snapshotting — for JS-rendered pages.
Zoom factor for the rendered page, 0.1–2.0. Defaults to 1.
SnapPDF vs PDFShift & DocRaptor
Five typed SDKs, a free tier that doesn't expire, and a $4 entry point — the three wedges most HTML-to-PDF APIs miss.
| Feature | SnapPDF | PDFShift | DocRaptor |
|---|---|---|---|
| HTML to PDF | Yes — HTML string or URL | Yes | Yes |
| Typed SDKs | 5 (JS/TS, Python, PHP, Ruby, Go) | Community / unofficial | Partial |
| Free tier | 100 credits/mo — never expires | 50 credits/mo | 7-day trial |
| Paid entry price | $4/mo | $9/mo | $15/mo |
| Unlimited test keys | Yes — sandboxed, free | No | Test mode |
Start free, scale to $49/mo
Six tiers from $0 to $49/mo. The free tier's 100 monthly credits cover 20 HTML-to-PDF conversions every month, forever.
100 credits/mo · unlimited sandboxed test keys
For side projects and small apps
For production workloads
Higher volume, webhooks
Managed support
Custom allowance + terms
HTML to PDF API questions, answered
How do I convert HTML to PDF with an API?
+
Send a POST request to https://snappdf.au/api/v1/html-to-pdf with a Bearer API key and a JSON body of {"html":"<h1>Hi</h1>"} (or {"url":"https://..."}). The response is the rendered PDF. With a SnapPDF SDK it is a single function call — snap.htmlToPdf({ html }). HTML-to-PDF costs 5 credits per call.
Can I render a live URL to PDF instead of an HTML string?
+
Yes. Send {"url":"https://..."} instead of {"html":"..."} to the same /api/v1/html-to-pdf endpoint and SnapPDF snapshots the live page — fonts, CSS and layout intact. URL-to-PDF also costs 5 credits per call.
Is there a free HTML to PDF API?
+
Yes. SnapPDF gives 100 free credits every month that never expire, plus unlimited sandboxed test keys (sk_test_*) for development. HTML-to-PDF costs 5 credits, so the free tier covers 20 conversions a month with zero cost and no card required.
What options can I pass to control the PDF output?
+
You can set page size (format), orientation (landscape), margins, printBackground, scale, and waitFor — a delay in milliseconds or a CSS selector to wait for before snapshotting JS-rendered pages. All options are passed in the same JSON body as the html or url field.
Which languages have a SnapPDF SDK?
+
SnapPDF ships real, shipped SDKs in 5 languages: JavaScript/TypeScript (npm i snappdf), Python (pip install snappdf), PHP (composer require snappdf/snappdf), Ruby (gem install snappdf) and Go (go get github.com/seaqae/snappdf-go).
How much does HTML to PDF cost per call?
+
HTML-to-PDF and URL-to-PDF cost 5 credits each. Most other SnapPDF operations cost 1 credit; compress, rasterise and redact cost 2. Top-up packs never expire (1,000 credits = $10, 5,000 = $40, 25,000 = $150, 100,000 = $500).
Ship your first HTML to PDF in 5 minutes
100 free credits every month, forever. No card required to start.