This API provides endpoints to generate PDF documents from web URLs.
Generates a PDF document from a publicly accessible URL or raw HTML content provided in the request body.
| Type | Location | Name | Description |
|---|---|---|---|
| API Key | Header | X-API-Key | Your provisioned API key must be included. |
application/jsonThe request body must be a JSON object containing EITHER a URL OR raw HTML content:
// Option 1: Convert URL
{
"url": "https://www.example.com"
}
// Option 2: Convert HTML
{
"html": "<h1>Hello World</h1>"
}
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Conditional | The fully qualified URL (including http:// or https://) of the webpage to convert into a PDF. |
html | string | Conditional | Raw HTML content to render and convert into a PDF. |
url or html, but not both.200 OK)| Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename="generated_document.pdf" (or generated_from_html.pdf) |
Content-Length | <PDF size in bytes> |
Body: The binary data of the generated PDF file.
| Status Code | Reason | Example Body |
|---|---|---|
401 Unauthorized |
API key missing, invalid, expired, or request limit exceeded. | |
422 Unprocessable Entity |
Request body missing url/html, or invalid format. |
|
500 Internal Server Error |
PDF generation failed (e.g., Puppeteer error, timeout) or other server issue. | |