The PDF API built by the team behind iLovePDF
Merge, compress, convert, OCR and summarize PDFs with a few lines of code. One REST API, 24 production-ready tools and the same processing engine trusted by millions of iLovePDF users every day.
2,500 free credits every month. No credit card required.
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('merge');
$task->addFile('contract.pdf');
$task->addFile('annex.pdf');
// Process and download the result
$task->execute();
$task->download();
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('pdfocr');
$task->addFile('scan.pdf');
// Process and download the result
$task->execute();
$task->download();
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('compress');
$task->addFile('invoice.pdf');
// Process and download the result
$task->execute();
$task->download();
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('protect');
$task->addFile('report.pdf');
$task->setPassword('s3cret-password');
// Process and download the result
$task->execute();
$task->download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('merge');
await task.start();
await task.addFile('https://example.com/contract.pdf');
await task.addFile('https://example.com/annex.pdf');
await task.process();
const data = await task.download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('pdfocr');
await task.start();
await task.addFile('https://example.com/scan.pdf');
await task.process({ ocr_languages: ['eng'] });
const data = await task.download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('compress');
await task.start();
await task.addFile('https://example.com/invoice.pdf');
await task.process();
const data = await task.download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('protect');
await task.start();
await task.addFile('https://example.com/report.pdf');
await task.process({ password: 's3cret-password' });
const data = await task.download();
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<MergeTask>();
task.AddFile("contract.pdf");
task.AddFile("annex.pdf");
task.Process();
task.DownloadFile("output");
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<PdfocrTask>();
task.AddFile("scan.pdf");
task.Process();
task.DownloadFile("output");
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<CompressTask>();
task.AddFile("invoice.pdf");
task.Process();
task.DownloadFile("output");
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<ProtectTask>();
task.AddFile("report.pdf");
task.Process(new ProtectParams("s3cret-password"));
task.DownloadFile("output");
api = Ilovepdf::Ilovepdf.new('project_public_id', 'project_secret_key')
task = api.new_task :merge
task.add_file 'contract.pdf'
task.add_file 'annex.pdf'
task.execute
task.download
# OCR isn't available in the Ruby library yet.
# Call the REST API directly: see the cURL tab.
api = Ilovepdf::Ilovepdf.new('project_public_id', 'project_secret_key')
task = api.new_task :compress
task.add_file 'invoice.pdf'
task.execute
task.download
api = Ilovepdf::Ilovepdf.new('project_public_id', 'project_secret_key')
task = api.new_task :protect
task.add_file 'report.pdf'
task.password = 's3cret-password'
task.execute
task.download
from ilovepdf import MergeTask
task = MergeTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("contract.pdf")
task.add_file("annex.pdf")
task.execute()
task.download("output")
from ilovepdf import PdfOcrTask
task = PdfOcrTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("scan.pdf")
task.execute()
task.download("output")
from ilovepdf import CompressTask
task = CompressTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("invoice.pdf")
task.execute()
task.download("output")
from ilovepdf import ProtectTask
task = ProtectTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("report.pdf")
task.password = "s3cret-password"
task.execute()
task.download("output")
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/merge
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@contract.pdf https://$SERVER/v1/upload
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@annex.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"merge","files":[{"server_filename":"'$FILE1'","filename":"contract.pdf"},{"server_filename":"'$FILE2'","filename":"annex.pdf"}]}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/pdfocr
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@scan.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"pdfocr","files":[{"server_filename":"'$FILE1'","filename":"scan.pdf"}],"ocr_languages":["eng"]}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/compress
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@invoice.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"compress","files":[{"server_filename":"'$FILE1'","filename":"invoice.pdf"}]}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/protect
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@report.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"protect","files":[{"server_filename":"'$FILE1'","filename":"report.pdf"}],"password":"s3cret-password"}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
Every PDF tool your product needs, in one API
Stop stitching together single-purpose services. Organize, optimize, convert, secure and understand documents through one consistent endpoint structure.
Merge PDF
Combine multiple PDFs into a single file in the order you choose.
Split PDF
Split by ranges or extract every page into its own PDF.
Smart Split
Split documents automatically based on their content and structure.
Organize PDF
Reorder, rotate and delete pages, or add blank pages, in one call.
Office to PDF
Convert Word, Excel and PowerPoint files into accurate PDFs.
HTML to PDF
Turn any web page into a PDF.
Image to PDF
Convert JPG, PNG and TIFF images into PDF.
PDF to JPG
Export each page as an image or extract embedded images.
PDF to PDF/A
Convert documents to ISO-standardized PDF/A for long-term archiving.
Validate PDF/A
Check whether a document complies with a PDF/A conformance level.
Extract text
Pull document text into a plain TXT file.
Rotate PDF
Rotate pages in 90-degree steps, file by file.
Page numbers
Add page numbers with your own position, format and style.
Watermark
Stamp text or image watermarks with full control over position and opacity.
Edit PDF
Add text, images and shapes programmatically.
Detect PDF Forms
Detect and create fillable form fields in scanned or flattened PDFs.
Automate document workflows end to end
Chain tools, process files in bulk and get notified the moment results are ready, without building PDF infrastructure yourself.
Learn more →Chain tasks without re-uploading
Connect one task to the next and run multi-step workflows, such as OCR, compress and protect, on the same files.
Webhooks for asynchronous processing
Receive a callback when a task completes or fails, so your application never waits on an open connection.
Flexible file input
Upload files directly, in chunks for large documents, or point the API to a public URL.
Turn PDFs into data your AI can use
Make documents readable for search, analytics and language models with OCR, structured extraction and AI tools built into the same API.
Learn more →LLM-ready Markdown
Convert PDFs to Markdown that keeps headings, lists and tables, ideal for RAG and agent workflows.
OCR for scanned files
Make image-based documents searchable before you extract, summarize or archive them.
AI summaries
Condense long reports and contracts into concise summaries, with length you control.
From file to result in four API calls
A simple, predictable task flow that works the same way for every tool.
Start
Create a task for any tool and get your assigned processing server.
GET /start/{tool}/{region}Upload
Send files from your system or from a URL.
POST /uploadProcess
Apply the tool and its options to one or many files.
POST /processDownload
Retrieve a single file or a ZIP with every output.
GET /download/{task}A developer-first PDF API
Clear endpoints, official SDKs and documentation that gets you to your first processed file in minutes. Authenticate with your project keys and ship.
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('merge');
$task->addFile('contract.pdf');
$task->addFile('annex.pdf');
// Process and download the result
$task->execute();
$task->download();
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('pdfocr');
$task->addFile('scan.pdf');
// Process and download the result
$task->execute();
$task->download();
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('compress');
$task->addFile('invoice.pdf');
// Process and download the result
$task->execute();
$task->download();
$ilovepdf = new Ilovepdf('project_public_id', 'project_secret_key');
// Create a task for any of the PDF tools
$task = $ilovepdf->newTask('protect');
$task->addFile('report.pdf');
$task->setPassword('s3cret-password');
// Process and download the result
$task->execute();
$task->download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('merge');
await task.start();
await task.addFile('https://example.com/contract.pdf');
await task.addFile('https://example.com/annex.pdf');
await task.process();
const data = await task.download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('pdfocr');
await task.start();
await task.addFile('https://example.com/scan.pdf');
await task.process({ ocr_languages: ['eng'] });
const data = await task.download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('compress');
await task.start();
await task.addFile('https://example.com/invoice.pdf');
await task.process();
const data = await task.download();
const ILovePDFApi = require('@ilovepdf/ilovepdf-nodejs');
const instance = new ILovePDFApi('project_public_id', 'project_secret_key');
const task = instance.newTask('protect');
await task.start();
await task.addFile('https://example.com/report.pdf');
await task.process({ password: 's3cret-password' });
const data = await task.download();
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<MergeTask>();
task.AddFile("contract.pdf");
task.AddFile("annex.pdf");
task.Process();
task.DownloadFile("output");
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<PdfocrTask>();
task.AddFile("scan.pdf");
task.Process();
task.DownloadFile("output");
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<CompressTask>();
task.AddFile("invoice.pdf");
task.Process();
task.DownloadFile("output");
var api = new iLovePdfApi("project_public_id", "project_secret_key");
var task = api.CreateTask<ProtectTask>();
task.AddFile("report.pdf");
task.Process(new ProtectParams("s3cret-password"));
task.DownloadFile("output");
api = Ilovepdf::Ilovepdf.new('project_public_id', 'project_secret_key')
task = api.new_task :merge
task.add_file 'contract.pdf'
task.add_file 'annex.pdf'
task.execute
task.download
# OCR isn't available in the Ruby library yet.
# Call the REST API directly: see the cURL tab.
api = Ilovepdf::Ilovepdf.new('project_public_id', 'project_secret_key')
task = api.new_task :compress
task.add_file 'invoice.pdf'
task.execute
task.download
api = Ilovepdf::Ilovepdf.new('project_public_id', 'project_secret_key')
task = api.new_task :protect
task.add_file 'report.pdf'
task.password = 's3cret-password'
task.execute
task.download
from ilovepdf import MergeTask
task = MergeTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("contract.pdf")
task.add_file("annex.pdf")
task.execute()
task.download("output")
from ilovepdf import PdfOcrTask
task = PdfOcrTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("scan.pdf")
task.execute()
task.download("output")
from ilovepdf import CompressTask
task = CompressTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("invoice.pdf")
task.execute()
task.download("output")
from ilovepdf import ProtectTask
task = ProtectTask(public_key="project_public_id", secret_key="project_secret_key")
task.add_file("report.pdf")
task.password = "s3cret-password"
task.execute()
task.download("output")
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/merge
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@contract.pdf https://$SERVER/v1/upload
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@annex.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"merge","files":[{"server_filename":"'$FILE1'","filename":"contract.pdf"},{"server_filename":"'$FILE2'","filename":"annex.pdf"}]}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/pdfocr
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@scan.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"pdfocr","files":[{"server_filename":"'$FILE1'","filename":"scan.pdf"}],"ocr_languages":["eng"]}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/compress
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@invoice.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"compress","files":[{"server_filename":"'$FILE1'","filename":"invoice.pdf"}]}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
# 1. Start a task: returns the assigned server and the task ID
curl -H "Authorization: Bearer $TOKEN" https://api.ilovepdf.com/v1/start/protect
# 2. Upload each file to the assigned server: returns server_filename
curl -H "Authorization: Bearer $TOKEN" -F task=$TASK -F file=@report.pdf https://$SERVER/v1/upload
# 3. Process
curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" https://$SERVER/v1/process \
-d '{"task":"'$TASK'","tool":"protect","files":[{"server_filename":"'$FILE1'","filename":"report.pdf"}],"password":"s3cret-password"}'
# 4. Download the result
curl -H "Authorization: Bearer $TOKEN" -o result.pdf https://$SERVER/v1/download/$TASK
Connect PDF processing to the tools you already use
Not every workflow needs code. Use iLoveAPI inside your automation platforms and CMS to process documents as part of existing processes.
Trigger PDF tasks from thousands of apps.
Build visual document workflows with drag and drop.
Compress and watermark PDFs directly from your media library.
Enterprise-grade security by default
Your documents are processed securely and never kept longer than needed.
ISO/IEC 27001:2022 certified
Our information security management system is audited against the international standard.
GDPR compliant
A European company operating under one of the strictest data protection frameworks in the world.
2 audits per year
Internal and external security audits, every year.
Automatic file deletion
Files are deleted automatically within hours of processing, or instantly with a single API call.
No data mining
Your files are only processed: never analyzed, sold or used for advertising.
Secure authentication
Signed JWT tokens with domain and IP filtering for client-side use.
Process documents close to your users
Choose the region where your files are processed to reduce latency and meet data residency requirements.
Built on the same infrastructure that runs iLovePDF for millions of users.
Built for every document-heavy workflow
Merge case files, apply watermarks and archive contracts in PDF/A.
OCR invoices and receipts and compress them for storage.
Convert coursework to PDF and add page numbers and protection at scale.
Offer PDF features inside your product without building a PDF engine.
Convert document libraries to Markdown for search and RAG.
Turn scanned forms into fillable PDFs and route them automatically.
Start free, scale as you grow
Get 2,500 free credits every month. When you need more, choose a monthly subscription or prepaid credits that never expire. You only pay for successfully processed files.
- Every PDF tool except the AI ones (AI tools need a paid plan)
- Official SDKs and full API reference
- No credit card required
- 20% off with yearly billing
- Prepaid credits that never expire
- Custom volumes for enterprise
Why choose the iLoveAPI PDF REST API
Proven at global scale
The same technology powers iLovePDF, one of the most widely used PDF platforms in the world, processing millions of documents every day.
Built by PDF specialists
Developed by a team focused on PDF technology since 2010 and an active member of the PDF Association.
One API for the whole document lifecycle
From conversion to AI-powered extraction, every tool shares the same workflow, authentication and billing.
Support from real engineers
Get direct help from the team that builds the API, not a generic help desk.
Build on a PDF API you can trust
- 2,500 free credits every month
- Pay only for processed files
- ISO 27001 certified and GDPR compliant
What is the iLoveAPI PDF REST API?
A cloud REST API that lets developers add PDF processing to any application. It includes 24 tools to merge, split, compress, convert, OCR, edit, protect and summarize PDFs, using the same technology as iLovePDF.
Is there a free plan?
Yes. Every account gets 2,500 free credits per month, with no credit card required. Free credits cover every PDF tool except the AI ones (Smart Split, AI Summarize, Detect PDF Forms, PDF to Markdown, Translate).
How does pricing work?
Tools consume credits per file, per page or per task depending on the tool. You can buy a monthly or yearly subscription, prepaid packages that never expire, or both. Only successfully processed files are charged.
Which programming languages are supported?
Official SDKs are available for PHP, Node.js, .NET, Ruby and Python. Because it is a REST API, you can call it from any language that can make HTTPS requests.
How secure is my data?
iLoveAPI is ISO/IEC 27001:2022 certified and GDPR compliant. Files are transferred over HTTPS and are deleted automatically after processing. You can also delete a task and its files immediately through the API.
Where are files processed?
You can choose the processing region: EU, US, Canada, France, Germany, Poland, India or Singapore.
Can I run multiple tools on the same file?
Yes. Chain tasks to apply several tools in sequence without uploading the files again.
Can I process files asynchronously?
Yes. Add a webhook to your request and iLoveAPI will notify your server when the task completes or fails.
Can I use the API without writing code?
Yes. iLoveAPI integrates with Zapier, Make and WordPress.
Is iLoveAPI suitable for AI and LLM workflows?
Yes. PDF to Markdown, OCR, text extraction and AI Summarize turn documents into structured content that language models and search systems can use.