Examples

Integration examples

Each snippet POSTs an HTML document to /v1/render with your X-API-Key and writes the resulting PDF to disk. Swap in your own key from the dashboard.

Render a PDF

Pick your language — the request shape is identical everywhere.

curl -X POST "https://api.featherpress.dev/v1/render" \
  -H "X-API-Key: rk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"input_type": "html", "content": "<h1>Hello, world!</h1>"}' \
  --output hello.pdf

Validate before rendering

Check a document against the supported CSS subset without spending a conversion.

curl
curl -X POST "https://api.featherpress.dev/v1/validate" \
  -H "X-API-Key: rk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"content": "<div style=\"background: var(--brand)\">Hi</div>"}'

# 200 OK
# {
#   "ok": false,
#   "findings": [
#     {
#       "rule": "css-var-unsupported",
#       "severity": "error",
#       "message": "CSS custom property var() is not resolved; the property is silently dropped.",
#       "suggestion": "Inline the literal value instead of var(--x).",
#       "snippet": "background: var(--brand)"
#     }
#   ]
# }