API reference
Turn HTML or a URL into a PDF with one request. Real browser rendering, flat pricing, 500 free documents a month.
1. Get an API key
Keys look like pp_live_…. Pick a plan and you get one on the welcome page right after checkout. No key needed to try it on the live playground.
2. Render a PDF
POST to /v1/pdf with html (or url) and optional options. The response body is the raw application/pdf.
curl -X POST https://api.pdfpipe.xyz/v1/pdf \
-H "Authorization: Bearer pp_live_your_key" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Invoice #4012</h1>","options":{"format":"A4"}}' \
--output invoice.pdfconst res = await fetch("https://api.pdfpipe.xyz/v1/pdf", {
method: "POST",
headers: {
Authorization: "Bearer pp_live_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
html: "<h1>Invoice #4012</h1>",
options: { format: "A4" },
}),
});
const pdf = Buffer.from(await res.arrayBuffer());
require("fs").writeFileSync("invoice.pdf", pdf);import requests
res = requests.post(
"https://api.pdfpipe.xyz/v1/pdf",
headers={"Authorization": "Bearer pp_live_your_key"},
json={"html": "<h1>Invoice #4012</h1>", "options": {"format": "A4"}},
)
with open("invoice.pdf", "wb") as f:
f.write(res.content)Render from a URL
curl -X POST https://api.pdfpipe.xyz/v1/pdf \
-H "Authorization: Bearer pp_live_your_key" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","options":{"format":"A4"}}' \
--output page.pdfEndpoints
| Method & path | Auth | Purpose |
|---|---|---|
| POST /v1/pdf | Bearer key | Render HTML or a URL to PDF (metered) |
| POST /v1/demo | none | Playground render, rate-limited per IP per day |
| GET /health | none | Liveness check |
PDF options
| Option | Values | Default |
|---|---|---|
| format | A4 · A3 · A5 · Letter · Legal · Tabloid | A4 |
| landscape | true / false | false |
| margin | any CSS length | 1cm |
| print_background | true / false | true |
| scale | 0.1 to 2.0 | 1.0 |
| page_ranges | "1-3, 5" | all pages |
| prefer_css_page_size | true / false (use @page CSS) | false |
| media | print / screen | |
| timeout_ms | 1000 to 60000 | 30000 |
| wait_until | load · domcontentloaded · networkidle0 · networkidle2 | networkidle0 |
| wait_for | CSS selector to wait for | none |
| wait_ms | extra delay, up to 10000 | 0 |
Reliable by default
The render waits for web fonts and images before drawing, so text never freezes in a fallback face and pictures are never half-loaded. Page-break rules like break-inside: avoid are honored under print emulation, which keeps long tables from splitting mid-row. When something does go wrong you get a specific message, not an opaque 500: a slow page returns a timeout you can raise with timeout_ms, an unreachable URL says so, and a renderer at capacity returns a 503 you can safely retry.
Usage & limits
Every successful render returns your usage in response headers: X-PDFPipe-Usage, X-PDFPipe-Limit, and X-PDFPipe-Plan. When the monthly limit is reached the API returns 402.
AI agents (MCP)
PDFPipe ships an MCP server so an AI agent can generate a document in one tool call. Point any MCP client at pdfpipe-mcp-server with your PDFPIPE_API_KEY and the generate_pdf tool becomes available.