Convert HTML to PDF with curl

Render HTML to PDF from the command line with one curl call. Works anonymously — an API key raises the rate limit. Full request and limits.

Endpoint POST /v1/render (JSON: html required, filename optional)
Anonymous calls allowed, rate-limited per IP (10/minute)
Limits 2 MiB of HTML, 50 pages, 20 s render timeout

The whole API is one endpoint: POST /v1/render takes a JSON body with your HTML and streams back the PDF. No SDK required — it works from a terminal in one command, with or without an API key:

curl -X POST https://api.pdfrender.dev/v1/render \
  -H 'Content-Type: application/json' \
  -d '{"html": "<h1>Hello</h1><p>Rendered by pdfrender.</p>", "filename": "hello.pdf"}' \
  -o hello.pdf

html is a complete HTML string; filename (optional, default document.pdf) sets the download filename in the Content-Disposition header. The response is application/pdf bytes — -o writes them straight to disk.

With an API key

Add the key as a header. A valid key lifts you from the anonymous per-IP limit to your plan's budget and meters one credit per render:

curl -X POST https://api.pdfrender.dev/v1/render \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_KEY' \
  -d @request.json \
  -o out.pdf

A missing or invalid key is not an error — the call simply stays anonymous. Inline images, fonts and CSS as data: URIs; external http(s) resources are never fetched (a document that references one is rejected with 400 listing the URLs), and no JavaScript runs.

Try it free

Try it free — 100 renders a month, no card — or paste HTML into the browser-based free HTML→PDF tool, no signup at all.