PDFPipe

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
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.pdf
JavaScript / Node
const 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);
Python
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
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.pdf

Endpoints

Method & pathAuthPurpose
POST /v1/pdfBearer keyRender HTML or a URL to PDF (metered)
POST /v1/demononePlayground render, rate-limited per IP per day
GET /healthnoneLiveness check

PDF options

OptionValuesDefault
formatA4 · A3 · A5 · Letter · Legal · TabloidA4
landscapetrue / falsefalse
marginany CSS length1cm
print_backgroundtrue / falsetrue
scale0.1 to 2.01.0
page_ranges"1-3, 5"all pages
prefer_css_page_sizetrue / false (use @page CSS)false
mediaprint / screenprint
timeout_ms1000 to 6000030000
wait_untilload · domcontentloaded · networkidle0 · networkidle2networkidle0
wait_forCSS selector to wait fornone
wait_msextra delay, up to 100000

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.