API Documentation

Everything you need to integrate QuickPDF into your application.

Base URL: https://api.quickpdf.io/api/v1

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.

๐Ÿ’ก Quick tip: All responses that return files include proper Content-Type and Content-Disposition headers.

Authentication

All API requests require an API key. Include it in the x-api-key header:

Header
x-api-key: your_api_key_here

Get your free API key from the Dashboard.

Rate Limits

PlanRequests/MonthConcurrentRate
Free5015/min
Starter ($19/mo)1,000330/min
Pro ($49/mo)10,00010120/min
Enterprise ($199/mo)100,00050600/min

Rate limit info is included in response headers:

  • X-RateLimit-Limit โ€” Your monthly limit
  • X-RateLimit-Remaining โ€” Requests remaining
  • X-RateLimit-Reset โ€” Unix timestamp when limits reset
  • X-RateLimit-Plan โ€” Your current plan

Error Handling

All errors return JSON in a consistent format:

Error Response
{
  "error": true,
  "message": "Human-readable error description",
  "code": "ERROR_CODE"
}
CodeMeaning
400Bad request โ€” check your parameters
401Missing or invalid API key
413Generated file too large
429Rate limit exceeded โ€” slow down
500Server error โ€” try again or contact support

Generate PDF

POST /api/v1/pdf

Convert a URL to a PDF. Returns the PDF binary directly.

Request Body

JSON
{
  "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

Result will appear here...

Take Screenshot

POST /api/v1/screenshot

Capture a screenshot of a URL. Returns an image file.

Request Body

JSON
{
  "url": "https://example.com",
  "options": {
    "width": 1280,
    "height": 720,
    "fullPage": false,
    "format": "png",
    "quality": 80,
    "waitTime": 2000
  }
}

Async PDF Generation

POST /api/v1/pdf/async

Queue a PDF job for complex pages. Get a job ID back, poll for completion or use webhooks.

JSON
{
  "url": "https://complex-page.com",
  "options": { "format": "A4" },
  "webhook_url": "https://yourapp.com/webhook"
}

Response (202 Accepted)

JSON
{
  "jobId": "uuid-here",
  "status": "queued",
  "message": "PDF generation queued",
  "statusUrl": "/api/v1/pdf/async/uuid-here"
}

Check Job Status

GET /api/v1/pdf/async/:jobId

Poll this endpoint to check if your async PDF is ready.

Response

JSON
{
  "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

GET /api/v1/pdf/download/:jobId

Download the PDF file from a completed async job. Returns the PDF binary.

Usage Stats

GET /api/v1/usage

Get your current usage and plan details.

Response
{
  "plan": "starter",
  "requestsUsed": 450,
  "requestsLimit": 1000,
  "remaining": 550,
  "resetDate": "2026-04-01T00:00:00Z",
  "percentage": 45
}

PDF Options

OptionTypeDefaultDescription
formatstringA4Page size: A0-A6, Letter, Legal, Tabloid
landscapebooleanfalsePage orientation
marginobject0{ top, right, bottom, left } in cm/in/px
printBackgroundbooleantruePrint CSS backgrounds
waitTimenumber2000Ms to wait before capture (0-10000)
cssstring-Custom CSS to inject
jsstring-Custom JavaScript to execute
headerTemplatestring-HTML template for page header
footerTemplatestring-HTML template for page footer

Screenshot Options

OptionTypeDefaultDescription
widthnumber1280Viewport width (100-3840)
heightnumber720Viewport height (100-2160)
fullPagebooleanfalseCapture full scrollable page
formatstringpngImage format: png, jpeg, webp
qualitynumber80JPEG/WebP quality (1-100)
waitTimenumber2000Ms to wait before capture

Code Examples

cURL
# 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"
Node.js
// 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);
Python
# 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
<?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!";
?>
Go
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:

Install
# Node.js
npm install snappdf

# Python
pip install snappdf

# PHP
composer require snappdf/sdk

# Ruby
gem install snappdf

Plans & Pricing

PlanPriceRequestsFeatures
Free$050/moBasic PDF & Screenshot
Starter$19/mo1,000/moCustom CSS/JS, priority
Pro$49/mo10,000/moWebhooks, async, custom branding
Enterprise$199/mo100,000/moSLA, 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:

Webhook Payload
{
  "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

โš ๏ธ Your webhook endpoint should respond with a 2xx status within 10 seconds.