Convert HTML and URLs to PDF, PNG, and other formats with our simple REST API.
All API requests require authentication using an API key. Include your key in the X-API-Key header.
X-API-Key: sk_your_api_key/convert/pdf/convert/png/convert/jpeg/convert/webp/logs| Parameter | Type | Description |
|---|---|---|
source* | string | URL or raw HTML content (required) |
format | string | Page format: A4, Letter, Legal, etc. |
landscape | boolean | Use landscape orientation |
margin | object | Page margins: {top, right, bottom, left} |
header | object | Header HTML: {source, height} |
footer | object | Footer HTML: {source, height} |
css | string | Custom CSS to inject |
javascript | string | Custom JavaScript to inject |
delay | number | Delay before rendering (ms) |
timeout | number | Max rendering time (seconds) |
sandbox | boolean | Sandbox mode (no credits used) |
encode | boolean | Return base64 instead of binary |
curl -X POST https://api.pixeltopdf.com/convert/pdf \
-H "X-API-Key: sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"source": "https://example.com"}' \
--output document.pdfRate limits depend on your plan:
| Code | Description |
|---|---|
400 | Bad request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
402 | Payment required - No credits remaining |
429 | Too many requests - Rate limit exceeded |
500 | Internal server error - Please retry |
Can't find what you're looking for? Reach out to our support team.
Open Playground