API Documentation
Everything you need to integrate QuickPDF into your application.
Introduction
QuickPDF is a simple REST API that converts web pages to PDF files and screenshots. Send a URL, get back a file. It handles browser management, scaling, and optimization so you don't have to.
Content-Type and Content-Disposition headers.Authentication
All API requests require an API key. Include it in the x-api-key header:
x-api-key: your_api_key_here
Get your free API key from the Dashboard.
Rate Limits
| Plan | Requests/Month | Concurrent | Rate |
|---|---|---|---|
| Free | 50 | 1 | 5/min |
| Starter ($19/mo) | 1,000 | 3 | 30/min |
| Pro ($49/mo) | 10,000 | 10 | 120/min |
| Enterprise ($199/mo) | 100,000 | 50 | 600/min |
Rate limit info is included in response headers:
X-RateLimit-Limitโ Your monthly limitX-RateLimit-Remainingโ Requests remainingX-RateLimit-Resetโ Unix timestamp when limits resetX-RateLimit-Planโ Your current plan
Error Handling
All errors return JSON in a consistent format:
{
"error": true,
"message": "Human-readable error description",
"code": "ERROR_CODE"
}
| Code | Meaning |
|---|---|
| 400 | Bad request โ check your parameters |
| 401 | Missing or invalid API key |
| 413 | Generated file too large |
| 429 | Rate limit exceeded โ slow down |
| 500 | Server error โ try again or contact support |
Generate PDF
/api/v1/pdf
Convert a URL to a PDF. Returns the PDF binary directly.
Request Body
{
"url": "https://example.com",
"options": {
"format": "A4",
"landscape": false,
"margin": { "top": "1cm", "bottom": "1cm", "left": "1cm", "right": "1cm" },
"printBackground": true,
"waitTime": 2000,
"css": "body { font-size: 12pt; }",
"js": "document.title = 'PDF';"
}
}
Try It
๐งช Test PDF Generation
Take Screenshot
/api/v1/screenshot
Capture a screenshot of a URL. Returns an image file.
Request Body
{
"url": "https://example.com",
"options": {
"width": 1280,
"height": 720,
"fullPage": false,
"format": "png",
"quality": 80,
"waitTime": 2000
}
}
Async PDF Generation
/api/v1/pdf/async
Queue a PDF job for complex pages. Get a job ID back, poll for completion or use webhooks.
{
"url": "https://complex-page.com",
"options": { "format": "A4" },
"webhook_url": "https://yourapp.com/webhook"
}
Response (202 Accepted)
{
"jobId": "uuid-here",
"status": "queued",
"message": "PDF generation queued",
"statusUrl": "/api/v1/pdf/async/uuid-here"
}
Check Job Status
/api/v1/pdf/async/:jobId
Poll this endpoint to check if your async PDF is ready.
Response
{
"jobId": "uuid-here",
"status": "completed",
"url": "https://example.com",
"downloadUrl": "/api/v1/pdf/download/uuid-here",
"createdAt": "2026-03-16T12:00:00Z",
"completedAt": "2026-03-16T12:00:03Z"
}
Status values: queued โ processing โ completed | failed
Download Async PDF
/api/v1/pdf/download/:jobId
Download the PDF file from a completed async job. Returns the PDF binary.
Usage Stats
/api/v1/usage
Get your current usage and plan details.
{
"plan": "starter",
"requestsUsed": 450,
"requestsLimit": 1000,
"remaining": 550,
"resetDate": "2026-04-01T00:00:00Z",
"percentage": 45
}
PDF Options
| Option | Type | Default | Description |
|---|---|---|---|
format | string | A4 | Page size: A0-A6, Letter, Legal, Tabloid |
landscape | boolean | false | Page orientation |
margin | object | 0 | { top, right, bottom, left } in cm/in/px |
printBackground | boolean | true | Print CSS backgrounds |
waitTime | number | 2000 | Ms to wait before capture (0-10000) |
css | string | - | Custom CSS to inject |
js | string | - | Custom JavaScript to execute |
headerTemplate | string | - | HTML template for page header |
footerTemplate | string | - | HTML template for page footer |
Screenshot Options
| Option | Type | Default | Description |
|---|---|---|---|
width | number | 1280 | Viewport width (100-3840) |
height | number | 720 | Viewport height (100-2160) |
fullPage | boolean | false | Capture full scrollable page |
format | string | png | Image format: png, jpeg, webp |
quality | number | 80 | JPEG/WebP quality (1-100) |
waitTime | number | 2000 | Ms to wait before capture |
Code Examples
# Generate PDF
curl -X POST https://api.quickpdf.io/api/v1/pdf \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
-o output.pdf
# Take screenshot
curl -X POST https://api.quickpdf.io/api/v1/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "options": {"fullPage": true}}' \
-o screenshot.png
# Check usage
curl https://api.quickpdf.io/api/v1/usage \
-H "x-api-key: YOUR_API_KEY"
// Install: npm install snappdf
const QuickPDF = require('snappdf');
const fs = require('fs');
const client = new QuickPDF('YOUR_API_KEY');
// Generate PDF
const pdf = await client.pdf('https://example.com');
fs.writeFileSync('output.pdf', pdf.buffer);
// Async PDF with webhook
const job = await client.pdfAsync(
'https://complex-page.com',
{ format: 'A4' },
'https://yourapp.com/webhook'
);
console.log('Job ID:', job.jobId);
// Check status
const status = await client.getJob(job.jobId);
console.log('Status:', status.status);
# Install: pip install snappdf
from snappdf import QuickPDF
client = QuickPDF('YOUR_API_KEY')
# Generate PDF
pdf = client.pdf('https://example.com')
with open('output.pdf', 'wb') as f:
f.write(pdf)
# Screenshot
screenshot = client.screenshot('https://example.com', {
'fullPage': True,
'format': 'png'
})
with open('screenshot.png', 'wb') as f:
f.write(screenshot)
# Check usage
usage = client.usage()
print(f"Used: {usage['requestsUsed']}/{usage['requestsLimit']}")
<?php
$apiKey = 'YOUR_API_KEY';
$url = 'https://example.com';
$ch = curl_init('https://api.quickpdf.io/api/v1/pdf');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: ' . $apiKey,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['url' => $url]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$pdf = curl_exec($ch);
curl_close($ch);
file_put_contents('output.pdf', $pdf);
echo "PDF saved!";
?>
package main
import (
"bytes"
"encoding/json"
"io"
"net/http"
"os"
)
func main() {
body, _ := json.Marshal(map[string]string{
"url": "https://example.com",
})
req, _ := http.NewRequest("POST",
"https://api.quickpdf.io/api/v1/pdf",
bytes.NewBuffer(body))
req.Header.Set("x-api-key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
file, _ := os.Create("output.pdf")
defer file.Close()
io.Copy(file, resp.Body)
}
SDKs
Official client libraries:
# Node.js
npm install snappdf
# Python
pip install snappdf
# PHP
composer require snappdf/sdk
# Ruby
gem install snappdf
Plans & Pricing
| Plan | Price | Requests | Features |
|---|---|---|---|
| Free | $0 | 50/mo | Basic PDF & Screenshot |
| Starter | $19/mo | 1,000/mo | Custom CSS/JS, priority |
| Pro | $49/mo | 10,000/mo | Webhooks, async, custom branding |
| Enterprise | $199/mo | 100,000/mo | SLA, dedicated support |
Upgrade anytime from your Dashboard.
Webhooks
Pro and Enterprise plans support webhooks for async PDF generation. When your PDF is ready, we'll POST to your URL:
{
"event": "pdf.completed",
"jobId": "uuid-here",
"status": "completed",
"url": "https://example.com",
"downloadUrl": "/api/v1/pdf/download/uuid-here",
"createdAt": "2026-03-16T12:00:00Z",
"completedAt": "2026-03-16T12:00:03Z"
}
Events: pdf.completed, pdf.failed