One endpoint, one credit per conversion. Send raw HTML or a public URL and receive a Chromium-rendered PDF back in the response body. Base URL: https://pdf-hub.net/api/v1
Pass your key in the Authorization header (or X-API-Key). Keys are created from your dashboard and start with ph_live_.
Authorization: Bearer ph_live_xxxxxxxxxxxxxxxxxxxx
Renders source — raw HTML, or a URL if the string starts with http(s):// — and returns the PDF binary (application/pdf). The X-Credits-Remaining response header tells you your balance.
curl -X POST https://pdf-hub.net/api/v1/convert \
-H "Authorization: Bearer ph_live_…" \
-H "Content-Type: application/json" \
-d '{"source": "https://example.com", "format": "A4", "landscape": false}' \
--output example.pdfcurl -X POST https://pdf-hub.net/api/v1/convert \
-H "Authorization: Bearer ph_live_…" \
-H "Content-Type: application/json" \
-d '{"source": "<html><body><h1>Invoice #881</h1></body></html>", "filename": "invoice-881.pdf"}' \
--output invoice-881.pdf| Field | Type | Default | Description |
|---|---|---|---|
source | string | required | Raw HTML markup, or a public http(s) URL. Max 2 MB. |
format | string | A4 | A3, A4, A5, Letter, Legal or Tabloid. |
landscape | bool | false | Landscape orientation. |
margin | string | 20px | Uniform page margin, e.g. 10mm, 0px. |
print_background | bool | true | Render CSS backgrounds. |
delay | int | 0 | Extra wait in ms (max 10000) for JS-heavy pages. |
filename | string | document.pdf | Name set in the Content-Disposition header. |
Check the balance on the key you call with.
curl https://pdf-hub.net/api/v1/credits \
-H "Authorization: Bearer ph_live_…"
{"credits": 4988, "key": "ph_live_a1b2c3…"}| Status | Code | Meaning |
|---|---|---|
401 | invalid_api_key | Missing, revoked or unknown key. |
402 | quota_exceeded | Monthly plan limit reached — upgrade from the dashboard. |
422 | conversion_failed | The page could not be rendered. Not charged. |
429 | — | Rate limit exceeded (120 requests/minute). |
One successful conversion = one unit of your monthly quota; failed conversions are refunded automatically. Quotas reset each month. Plans: Free (250/mo for $0/mo), Starter (5,000/mo for $9/mo), Business (25,000/mo for $29/mo), Scale (100,000/mo for $99/mo).