MegaPDF API Documentation

Powerful PDF processing capabilities for your applications

View on GitHub
Conversion API
Convert PDFs to and from various formats including Word, Excel, JPG, and more.
View Documentation
Manipulation API
Merge, split, compress, rotate and modify PDFs with simple API calls.
View Documentation
Security API
Add password protection, remove restrictions, and secure your PDF documents.
View Documentation
Editing API
Add signatures, watermarks, page numbers, and more to PDF documents.
View Documentation
OCR API
Extract text from scanned documents and create searchable PDFs with OCR.
View Documentation
Getting Started
Learn the basics of integrating our API, authentication, and handling responses.
View Documentation
API Overview
The MegaPDF API provides powerful PDF processing capabilities for developers

The MegaPDF API enables you to convert, manipulate, secure, and process PDF documents through simple HTTP requests. Our REST API supports a wide range of operations from basic conversions to advanced text extraction, editing, and security features.

Base URL

https://mega-pdf.com/api

Authentication

All API requests require authentication with an API key. You can include your API key in either the x-api-key header or as a query parameter in your requests.

Response Format

All API responses include a success boolean indicating if the request was successful, along with other relevant data. When processing files, a fileUrl will be provided to download the result.

// Example success response
{
  "success": true,
  "message": "PDF processed successfully",
  "fileUrl": "/api/file?folder=compressions&filename=abc123.pdf",
  "filename": "abc123.pdf"
}

// Example error response
{
  "success": false,
  "error": "No PDF file provided"
}