Generate publication-grade PDF documents from HTML, URLs, and web apps with CSS paged media.
Transform web pages, dashboards, invoices, and reports into publication-grade vector PDF documents. Supports custom page sizes (A4, Letter, Legal), print background graphics, margins, and page numbering.
Because this endpoint utilizes full headless Chromium rendering, dynamic JavaScript and single-page apps (SPAs) are executed completely before conversion:
Chromium initializes, fetches the URL, executes client JavaScript, resolves DOM mutations, and generates output.
Returned instantly from Valkey/Redis cache with header X-Lender-Cache: HIT (15-minute TTL).
curl -X POST https://api.headless-lender.com/api/v1/pdf \
-H "Content-Type: application/json" \
-d '{
"url": "https://blog.cloudflare.com",
"options": {
"format": "A4",
"printBackground": true
}
}' --output document.pdfNo Authorization header required. Simply send a JSON POST request. Perfect for quick prototypes, small scripts, and low-volume scraping.
Sign up in 10s with no credit card required. Unlocks 1,000 free monthly requests, 600 browser minutes (10 hours), 120 req/min burst limits, and cache-bypass controls.
| Access Mode | Monthly Quota | Cloud Browser Time | Burst Limit | Credit Card | Action |
|---|---|---|---|---|---|
| Public Anonymous | Daily IP Allowance | 5-min trial sandbox | 10 req/min | None | Instant (No Setup) |
| Free Account (Highest Quota) | 1,000 Req / Month | 600 Mins (10 Hours) | 120 req/min | Zero ($0 forever) | Claim Free Key → |
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | required | — | Target webpage URL to convert into PDF. |
| options.format | 'A4' | 'Letter' | 'Legal' | 'A3' | optional | 'A4' | Standard paper sheet dimensions. |
| options.landscape | boolean | optional | false | Orient pages in landscape mode. |
| options.printBackground | boolean | optional | true | Print background colors, CSS gradients, and images. |
| options.scale | number (0.1 - 2.0) | optional | 1.0 | Web page rendering zoom scale. |
| options.margin | { top, right, bottom, left } | optional | — | Custom margins in mm or px (e.g. 10mm). |
Binary stream of application/pdf