API Documentation
Complete reference for the Alterna PDF REST API. All endpoints, parameters, and code examples.
https://app.alternapdf.comAuth: X-API-Key headerVersion: 2.5.1Quick Start
curl -X POST "https://app.alternapdf.com/api/v1/convert/text-to-pdf" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Hello from the Alterna PDF API!"}' \
--output hello.pdfAll endpoints require an X-API-Key header. Get your key at dashboard.alternapdf.com.
Document Conversion
/api/v1/convert/html-to-pdfConvert HTML content or a live URL into a PDF with full CSS support.
/api/v1/convert/text-to-pdfConvert plain text into a formatted PDF with typography controls.
/api/v1/convert/markdown-to-pdfConvert Markdown into polished PDFs with themes and syntax highlighting.
/api/v1/convert/json-to-pdfTransform JSON data into structured PDF reports with table formatting.
/api/v1/pdf/from-templateGenerate PDFs from stored templates with dynamic variable substitution.
Data Extraction
/api/v1/convert/pdf-to-textExtract text with multiple modes. Auto-OCR for scanned documents.
/api/v1/convert/pdf-to-htmlConvert PDFs into clean, structured HTML preserving layout.
/api/v1/convert/pdf-to-markdownConvert PDFs into Markdown with heading, table, and code detection.
/api/v1/convert/pdf-to-imageRender PDF pages as PNG, JPEG, or WebP images.
/api/v1/extract/pdf-imagesExtract all embedded images from a PDF as a ZIP archive.
PDF Manipulation
/api/v1/pdf/mergeCombine multiple PDFs into a single document.
/api/v1/pdf/splitSplit by pages, ranges, or fixed-size chunks.
/api/v1/pdf/watermarkAdd text watermarks with dynamic variables and page targeting.
/api/v1/pdf/remove-passwordRemove or change PDF password protection.
Analysis & Compliance
OCR
/api/v1/ocr/extract/simpleFast, free text extraction. Up to 20 pages sync.
/api/v1/ocr/extract/advancedNeural network OCR with word-level bounding boxes. Up to 10 pages sync.
/api/v1/ocr/extract/visionHighest accuracy. Handwriting, complex layouts, forms. Up to 3 pages sync.
Rate Limits
Every response includes rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Max requests per minute |
X-RateLimit-Remaining | Requests remaining |
X-RateLimit-Reset | Unix timestamp for reset |
X-Credits-Remaining | Credits left on account |
Error Codes
Errors return JSON with a detail field:
| Code | Meaning |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 402 | Insufficient Credits |
| 413 | Payload Too Large |
| 422 | Validation Error |
| 429 | Rate Limit Exceeded |
| 500 | Internal Server Error |
Interactive API Explorer
Try endpoints directly in your browser with the Swagger UI or ReDoc interface.