PDF Generation API Documentation

This API provides endpoints to generate PDF documents from web URLs.

Generate PDF from URL

Generates a PDF document from a publicly accessible URL provided in the request body.

POST /

Authentication

TypeLocationNameDescription
API KeyHeaderX-API-KeyYour provisioned API key must be included.

Request Body

The request body must be a JSON object containing the URL to be converted:

{
  "url": "https://www.example.com"
}
FieldTypeRequiredDescription
urlstringYesThe fully qualified URL (including http:// or https://) of the webpage to convert into a PDF.

Success Response (200 OK)

HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="generated_document.pdf"
Content-Length

Body: The binary data of the generated PDF file.

Error Responses

Status CodeReasonExample Body
401 Unauthorized API key missing, invalid, expired, or request limit exceeded.
{ "error": "Reason description" }
422 Unprocessable Entity Request body missing url, or URL is invalid/empty.
{ "error": "Missing or invalid URL..." }
500 Internal Server Error PDF generation failed (e.g., Puppeteer error, timeout) or other server issue.
{ "error": "Failed to process request..." }