API Documentation
Integrate PDF Master tools into your applications with our REST API.
Getting Started
The PDF Master API allows you to programmatically access all PDF tools available on the platform. To get started, you'll need an API key.
1. Get Your API Key
Generate an API key from your API Keys page. You'll receive:
- API Key: Used to identify your account (e.g.,
pm_abc123...) - API Secret: Used for authentication (keep this secure!)
2. Authentication
Include your API key in the request header:
Or use both key and secret for enhanced security:
3. Base URL
Rate Limits
API rate limits protect the service from abuse and ensure fair usage for all users. Limits are based on your subscription plan:
Burst Limits (Short-term)
These limits prevent sudden spikes in API usage:
| Plan | Per Minute | Per Hour |
|---|---|---|
| Free | 5 requests | 30 requests |
| Pro | 30 requests | 200 requests |
| Ultra | 100 requests | 1,000 requests |
Quota Limits (Long-term)
These limits define your total API usage allowance:
| Plan | Daily Limit | Monthly Limit |
|---|---|---|
| Free | 50 requests | 500 requests |
| Pro | 100 requests | 3,000 requests |
| Ultra | 500 requests | 15,000 requests |
Rate Limit Headers
Every API response includes headers showing your current limit status:
Rate Limit Exceeded
When you exceed any rate limit, you'll receive a 429 Too Many Requests response:
The Retry-After header indicates how many seconds to wait before making another request.
API Endpoints
PDF Operations
Merge multiple PDF files into a single document.
Request Body (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
files[] |
file | required | PDF files to merge (minimum 2) |
output_name |
string | optional | Output filename (default: merged.pdf) |
Example Request (cURL)
Note: Download links expire after 1 hour.
Split a PDF into multiple files by page ranges.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to split |
pages | string | required | Page ranges (e.g., "1-3,5,7-10") |
Example Request (cURL)
Note: Download links expire after 1 hour.
Add a text watermark to all pages of a PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file |
text | string | required | Watermark text |
opacity | float | optional | 0.0 to 1.0 (default: 0.3) |
angle | int | optional | Rotation angle (default: 45) |
font_size | int | optional | Font size (default: 48) |
color | string | optional | Hex color (default: #cccccc) |
Example Request (cURL)
Note: Download links expire after 1 hour.
Compress a PDF file to reduce file size.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to compress |
quality | string | optional | low, medium, or high (default: medium) |
Example Request (cURL)
Note: Download links expire after 1 hour.
Update PDF document metadata (title, author, etc.).
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file |
title | string | optional | Document title |
author | string | optional | Author name |
subject | string | optional | Subject |
keywords | string | optional | Keywords |
Example Request (cURL)
Note: Download links expire after 1 hour.
Add page numbers to a PDF document.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file |
position | string | optional | bottom-center, bottom-left, bottom-right, etc. |
format | string | optional | Format string (default: "Page {n} of {total}") |
start_page | int | optional | Starting page number (default: 1) |
Example Request (cURL)
Note: Download links expire after 1 hour.
Generate a PDF from text content.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | required | Text content for the PDF |
title | string | optional | Document title (default: "Generated Document") |
page_size | string | optional | Page size: A4, Letter, etc. (default: A4) |
orientation | string | optional | P or L (default: P) |
font_size | int | optional | Font size (default: 12) |
Example Request (cURL)
Note: Download links expire after 1 hour.
Reorder and rotate PDF pages.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to reorder |
order | string | required | Page order (e.g., "3,1,2,4") |
rotation | int | optional | Rotation angle: 0, 90, 180, or 270 (default: 0) |
Example Request (cURL)
Note: Download links expire after 1 hour.
Convert PDF pages to image files.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to convert |
format | string | optional | Image format: png, jpg, jpeg (default: png) |
dpi | int | optional | Resolution in DPI, 72-300 (default: 150) |
Note: Returns array of image download URLs, one per page.
Example Request (cURL)
Note: Returns array of image download URLs, one per page. Download links expire after 1 hour.
Advanced PDF Operations
Advanced PDF compression using Ghostscript with multiple quality presets for maximum file size reduction.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to compress |
quality | string | optional | screen (lowest), ebook (medium), printer (high), prepress (highest quality). Default: ebook |
Example Request (cURL)
Note: Provides superior compression compared to standard compress. Download links expire after 1 hour.
Convert PDF to PDF/A format for long-term archival and compliance with archiving standards.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to convert |
Example Request (cURL)
Note: Converts to PDF/A-1b standard. Download links expire after 1 hour.
Convert a color PDF to grayscale (black and white). Useful for printing or reducing file size.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to convert |
Example Request (cURL)
Note: Download links expire after 1 hour.
Attempt to repair corrupted or damaged PDF files by rebuilding the document structure.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to repair |
Example Request (cURL)
Note: Not all corrupted PDFs can be repaired. Download links expire after 1 hour.
Flatten PDF layers and annotations, making form fields non-editable and merging all layers into a single layer.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to flatten |
Example Request (cURL)
Note: Useful for finalizing filled forms. Download links expire after 1 hour.
Optimize PDF for fast web viewing (linearization). Enables progressive loading for web browsers.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to optimize |
Example Request (cURL)
Note: Creates a linearized PDF for faster first-page display. Download links expire after 1 hour.
Add password protection to a PDF file. Encrypt the PDF with user and owner passwords, and control permissions like printing, copying, and modification.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | PDF file to protect |
user_password | string | required | Password required to open/view the PDF |
owner_password | string | optional | Password for full access (print, edit, etc.). Defaults to user_password if not specified. |
permissions | array | optional | JSON array of allowed permissions: print, copy, modify, annotate. Empty array means all permissions denied. |
Example Request (cURL)
Response
Note: The protected PDF will require the user password to open. The owner password grants full editing permissions. Download links expire after 1 hour.
Conversion Operations
Convert a Word document (.doc, .docx) to PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | Word document to convert |
Example Request (cURL)
Note: Download links expire after 1 hour.
Convert images to a PDF document.
| Parameter | Type | Required | Description |
|---|---|---|---|
images[] | file | required | Image files (JPG, PNG, GIF, WebP) |
page_size | string | optional | Page size (A4, Letter, etc.) |
orientation | string | optional | portrait or landscape |
Example Request (cURL)
Note: Download links expire after 1 hour.
Convert HTML content to PDF. Supports single page or multi-page PDF generation.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | required* | HTML content for single page conversion |
html_pages | array | optional | JSON array of HTML strings OR array of {html, title} objects for multi-page PDF |
css | string | optional | CSS styles to apply to all pages |
page_size | string | optional | A4, Letter, Legal, A3 (default: A4) |
orientation | string | optional | portrait or landscape (default: portrait) |
margin_top | int | optional | Top margin in mm (default: 16) |
margin_bottom | int | optional | Bottom margin in mm (default: 16) |
margin_left | int | optional | Left margin in mm (default: 15) |
margin_right | int | optional | Right margin in mm (default: 15) |
* Either html OR html_pages is required.
Example: Single Page
Example: Multi-Page PDF
Response
Note: Download links expire after 1 hour. The page_count field shows the number of pages in the generated PDF.
Convert Excel spreadsheet (.xls, .xlsx) to PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | Excel file to convert (.xls or .xlsx) |
Example Request (cURL)
Note: Download links expire after 1 hour.
Convert ODT (OpenDocument Text) document to PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | ODT file to convert |
Example Request (cURL)
Note: Download links expire after 1 hour.
Convert RTF (Rich Text Format) document to PDF.
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | required | RTF file to convert |
Example Request (cURL)
Note: Download links expire after 1 hour.
Generate barcodes or QR codes in PDF format. Supports single codes, batch creation (multiple codes), and overlay on existing PDFs.
Basic Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data | string | required* | Single barcode data OR newline-separated batch data. Use "data|label" format for custom labels. |
batch_data | array | optional | JSON array of {data, label} objects for batch mode |
type | string | optional | QRCODE, C128, C39, EAN13, EAN8, UPCA, UPCE, I25, CODABAR (default: QRCODE) |
width | int | optional | Barcode width in mm, 20-180 (default: 60) |
height | int | optional | Barcode height in mm, 20-180 (default: 60) |
repeat_count | int | optional | Duplicate single barcode this many times, 1-50 (default: 1). Use with layout options for grid placement. |
Layout Options (for batch mode)
| Parameter | Type | Required | Description |
|---|---|---|---|
layout | string | optional | grid, inline, or single (default: grid) |
columns | int | optional | Number of columns for grid layout, 1-6 (default: 3) |
spacing | int | optional | Spacing between barcodes in mm, 2-30 (default: 10) |
show_labels | bool | optional | Show labels under barcodes (default: true) |
page_size | string | optional | A4, LETTER, A3, A5 (default: A4) |
orientation | string | optional | portrait or landscape (default: portrait) |
PDF Overlay Options
| Parameter | Type | Required | Description |
|---|---|---|---|
pdf | file | optional | Existing PDF to overlay barcodes on |
overlay_position | string | optional | top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right (default: top-right) |
overlay_page | string | optional | all, first, last, or page range like "1,3,5-10" (default: all) |
overlay_x | int | optional | Custom X position in mm (overrides overlay_position) |
overlay_y | int | optional | Custom Y position in mm (overrides overlay_position) |
Example: Single Barcode
Example: Repeated Barcodes (12 copies in 4-column grid)
Example: Batch Barcodes (newline-separated)
Example: Overlay on Existing PDF
Response
Note: Download links expire after 1 hour. The barcode_count field shows how many barcodes were generated.
Download a processed file using the token from the API response.
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | required | Download token from API response (URL parameter) |
Example Request (cURL)
Note: Download links expire after 1 hour and are single-use only.
Utility Tools
Generate a professional invoice PDF with customizable templates, items, taxes, and discounts.
| Parameter | Type | Required | Description |
|---|---|---|---|
company_name | string | required | Your company/business name |
client_name | string | required | Client/buyer name |
items | array | required | JSON array of {description, quantity, price} objects |
template | string | optional | Template: modern, classic, minimal, corporate (default: modern) |
currency | string | optional | Currency code: USD, EUR, GBP, ZAR, etc. (default: USD) |
company_address | string | optional | Company address |
company_email | string | optional | Company email |
company_phone | string | optional | Company phone |
company_tax_id | string | optional | Tax ID / VAT number |
client_address | string | optional | Client address |
client_email | string | optional | Client email |
invoice_number | string | optional | Invoice number (auto-generated if not provided) |
invoice_date | string | optional | Invoice date (YYYY-MM-DD) |
due_date | string | optional | Payment due date (YYYY-MM-DD) |
tax_rate | float | optional | Tax percentage 0-100 |
discount_type | string | optional | "percentage" or "fixed" |
discount_value | float | optional | Discount value |
notes | string | optional | Additional notes |
payment_terms | string | optional | Payment terms |
bank_details | string | optional | Bank details for payment |
Example Request (cURL)
Note: Download links expire after 1 hour.
Generate a weather forecast PDF report for any location worldwide.
| Parameter | Type | Required | Description |
|---|---|---|---|
latitude | float | required | Location latitude (-90 to 90) |
longitude | float | required | Location longitude (-180 to 180) |
location_name | string | optional | Display name for the location |
units | string | optional | "metric" or "imperial" (default: metric) |
days | int | optional | Forecast days 1-14 (default: 7) |
Example Request (cURL)
Note: Weather data provided by Open-Meteo. Download links expire after 1 hour.
Generate a movie information PDF report using TMDB (The Movie Database).
| Parameter | Type | Required | Description |
|---|---|---|---|
movie_id | int | required | TMDB movie ID |
include_cast | bool | optional | Include cast information (default: true) |
include_reviews | bool | optional | Include reviews (default: false) |
Example Request (cURL)
Note: Movie data provided by TMDB. Download links expire after 1 hour.
Response Format
All successful API responses return:
Note: All download links expire after 1 hour. The expires_at field in the response indicates when the download link will expire.
Error Handling
The API uses standard HTTP status codes:
| Status Code | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
403 | Forbidden - API access not enabled |
429 | Too Many Requests - Rate limit exceeded |
500 | Server Error |