AIIPWorld

PDF API

Send HTML or a public URL and get back a PDF. Rendering runs in headless Chromium in isolated containers, so what you see in a modern browser is what ends up in the file.

What it does

Example: HTML to PDF with header and footer

Set AIIPWORLD_API_KEY to a key from your dashboard. The request below produced the example output further down.

curl -X POST https://api.aiipworld.com/v1/render \
  -H "Authorization: Bearer $AIIPWORLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html":"<!doctype html>\n<html><head><meta charset=\"utf-8\"><style>\nbody { font-family: Helvetica, Arial, sans-serif; }\nh1 { border-bottom: 2px solid #2f4bff; }\n</style></head><body>\n<h1>Quarterly report</h1>\n<p>Rendered by headless Chromium through the AIIPWorld API.</p>\n</body></html>","output":"pdf","options":{"format":"A4","margin":{"top":"20mm","bottom":"20mm","left":"15mm","right":"15mm"},"display_header_footer":true,"header_template":"<div style=\"font-size:9px;width:100%;text-align:center;color:#666\">Quarterly report</div>","footer_template":"<div style=\"font-size:9px;width:100%;text-align:center;color:#666\">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></div>"}}'

# returns {"job_id": "...", "status": "queued"}; then poll:
curl https://api.aiipworld.com/v1/jobs/JOB_ID -H "Authorization: Bearer $AIIPWORLD_API_KEY"

Example: a URL to PDF

curl -X POST https://api.aiipworld.com/v1/render \
  -H "Authorization: Bearer $AIIPWORLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","output":"pdf","options":{"format":"A4","landscape":false}}'

# returns {"job_id": "...", "status": "queued"}; then poll:
curl https://api.aiipworld.com/v1/jobs/JOB_ID -H "Authorization: Bearer $AIIPWORLD_API_KEY"

Example output

PDF with header and page number footer (page 1)
Output of the HTML request shown below, with a header and a page-number footer. Generated by this site's own engine. Page 1 shown. Open the PDF.

Options

Options go in the options object and are passed to the engine, which rejects unknown names.

OptionWhat it does
format, width, heightPaper size (A4 by default) or a custom size.
landscape, marginOrientation and per-side margins. The default margin is 10 mm on all four sides.
print_backgroundPrint CSS backgrounds (on by default).
scale, page_rangesScale the content; print only some pages.
display_header_footer, header_template, footer_templateHTML for a header and footer on every page (up to 64 KB each).
prefer_css_page_size, tagged, outlineUse @page size from your CSS; tagged PDF; document outline.
mediaprint (default) or screen styles.
wait_until, wait_for_selector, delay_msWhen to consider the page ready; an extra delay up to 10 seconds.
javascript, headers, user_agent, viewport, base_urlTurn scripts off, send up to 20 request headers, set the user agent and window size, resolve relative URLs.

Pricing

One credit pool covers every tool and the API. A simple PDF costs 1 credit; PDFs beyond 10 pages and results beyond 5 MB cost more. Failed jobs are refunded. Credit costs are provisional until launch.

Free

$0

100 credits per month

Starter

$19 / month

2,750 credits per month

Pro

$59 / month

10,000 credits per month

Business

$149 / month

30,000 credits per month

Credit pack: $10 for 1,400 credits that do not expire. Rate limits and result retention depend on the plan: see pricing.

Questions

How does a request work?

POST /v1/render with either html or url and output set to pdf. You get a job id back, then poll GET /v1/jobs/{id} until the status is succeeded and read download_url. Jobs are asynchronous. Webhooks are not available yet.

How much does a PDF cost?

A simple render costs 1 credit. PDFs longer than 10 pages cost one more credit for each further 10 pages (or part of), and any result over 5 MB costs one more credit for each further 5 MB. Failed and timed-out jobs are refunded. These costs are provisional until launch.

Is there a free tier?

Yes. A free account includes 100 credits a month. The web tools also work without an account, within per-visitor limits.

How long are results kept?

Free API results are kept 1 day. Starter and Pro keep them 7 days, Business 30 days. The download link is a short-lived signed link; request the job again for a fresh one.

Can I make PDFs from a template and JSON data?

Not yet. The template_id field is reserved and currently returns an error. Today you send complete HTML.

Is it safe to render user-supplied HTML?

Each job runs in an isolated container with a hard timeout, and requests to private networks, localhost and cloud metadata addresses are blocked. You are still responsible for what you render; see the Acceptable Use Policy.

Are headers and footers supported?

Yes. Set display_header_footer to true and pass header_template and footer_template HTML. Page numbers use the pageNumber and totalPages classes. Leave enough top and bottom margin for them.

Related tools