AllPDFMagic API
REST API for PDF processing and AI document intelligence. Free Starter tier for every registered user — no credit card required.
Quick Start
Starter — Freecurl -X POST \ https://www.allpdfmagic.com/api/v1/pdf/compress \ -H "Authorization: Bearer YOUR_KEY" \ -F "file=@document.pdf" \ -o compressed.pdf
import requests
API_KEY = "apm_live_YOUR_KEY"
BASE = "https://www.allpdfmagic.com"
with open("document.pdf", "rb") as f:
res = requests.post(
f"{BASE}/api/v1/pdf/compress",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": f},
)
# Check remaining quota
remaining = res.headers.get("X-RateLimit-Remaining")
print(f"Calls remaining: {remaining}")
with open("compressed.pdf", "wb") as out:
out.write(res.content)import fs from "fs";
import FormData from "form-data";
import fetch from "node-fetch";
const KEY = "apm_live_YOUR_KEY";
const BASE = "https://www.allpdfmagic.com";
const form = new FormData();
form.append("file", fs.createReadStream("doc.pdf"));
const res = await fetch(`${BASE}/api/v1/pdf/compress`, {
method: "POST",
headers: { Authorization: `Bearer ${KEY}` },
body: form,
});
const remaining = res.headers.get("x-ratelimit-remaining");
console.log("Calls remaining:", remaining);
const buf = Buffer.from(await res.arrayBuffer());
fs.writeFileSync("compressed.pdf", buf);AI Invoice Extraction — Developer tier example:
curl -X POST \ https://www.allpdfmagic.com/api/v1/ai/extract-invoice \ -H "Authorization: Bearer YOUR_KEY" \ -F "file=@invoice.pdf" \ -F "export_format=json"
with open("invoice.pdf", "rb") as f:
res = requests.post(
f"{BASE}/api/v1/ai/extract-invoice",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": f},
data={"export_format": "json"},
)
data = res.json()
print(data["data"]["total_amount"])
print(data["data"]["vendor"]["gstin"])Authentication
All requests require a Bearer token in the Authorization header. API keys are generated from your dashboard — free for every registered user.
Get your free API key
Sign up to get 200 API calls/month at no cost. No credit card required. Upgrade when you need more.
Sandbox — Test Mode
All tiers — no quota consumedReplace /api/v1/ with /api/v1/sandbox/ to get realistic mock responses without consuming quota. Your API key is still validated — so you can test auth too.
Production
Sandbox (same key, zero quota)
Sandbox responses include
API Pricing
Starter
Free- PDF compress, merge, split, rotate
- Delete & extract pages
- Add page numbers
- PDF → TXT & PDF → PNG
- Image to PDF
- Usage & health (no quota)
- 1 API key
- Sandbox test mode
Indie
$9/mo$90/yr — save $18
- Everything in Starter
- PDF sign (text, drawn, image)
- AI summarise documents
- HTML → PDF & PDF → CSV
- 8 Office ↔ PDF conversion APIs
- 2 API keys
Developer
$29/mo$290/yr — save $58
- Everything in Indie
- PDF protect, watermark & unlock
- AI invoice extraction & OCR
- AI table extraction
- AI document Q&A (generate questions)
- 5 API keys
Business
$99/mo$990/yr — save $198
- Everything in Developer
- parse-document & parse-batch
- validate-file & validate-batch
- auto-redact PII (GDPR/DPDP)
- extract-clauses, diff-documents, cross-check
- Fraud detection & GSTR-2B reconciliation
- Bulk async processing (100 files/call)
- 5 pipeline APIs
- 10 API keys
- Priority SLA
Rate Limit Headers
Every API response includes these headers so your code can track usage in real time:
API Endpoints
56 endpointsPDF Operations
Starter — FreeCore PDF tools — free for all registered users
/api/v1/pdf/compressCompress a PDF to reduce file size
Parameters
filefilerequiredPDF to compresslevelstringlow | medium | high (default: medium)/api/v1/pdf/mergeMerge multiple PDFs into one document
Parameters
filesfile[]requiredPDFs to merge (sent in order)/api/v1/pdf/splitSplit a PDF into separate files
Parameters
filefilerequiredPDF to splitpagesstringPage ranges e.g. "1-3,5,7-9"/api/v1/pdf/rotateRotate pages in a PDF
Parameters
filefilerequiredPDF to rotatedegreesinteger90 | 180 | 270 (default: 90)/api/v1/pdf/delete-pagesRemove specific pages from a PDF
Parameters
filefilerequiredPDF to editpagesstringrequiredPages to remove e.g. "1,3-5,8"/api/v1/pdf/extract-pagesExtract specific pages into a new PDF
Parameters
filefilerequiredPDF to extract frompagesstringrequiredPages to keep e.g. "2-4,7"/api/v1/pdf/add-page-numbersAdd page numbers to a PDF
Parameters
filefilerequiredPDF to numberpositionstringbottom-center | bottom-left | bottom-right | top-center (default: bottom-center)start_numberintegerStarting page number (default: 1)formatstring"{n}" | "Page {n}" | "{n} of {total}" (default: "{n}")/api/v1/convert/image-to-pdfConvert JPG / PNG / WebP images to PDF
Parameters
filesfile[]requiredImage files (add multiple for multi-page)/api/v1/convert/pdf-to-txtExtract all text from a PDF — instant, zero cost, no AI
Parameters
filefilerequiredPDF file/api/v1/convert/pdf-to-pngConvert each PDF page to a PNG image
Parameters
filefilerequiredPDF filedpiintegerResolution in DPI (default: 150)Signatures & Signing
Indie — $9/moAdd text, drawn, or image signatures to PDFs — Indie tier
/api/v1/pdf/signAdd a signature to a PDF — text typed, drawn (base64), or uploaded image
Parameters
filefilerequiredPDF to signsignature_typestringtext | base64 | image (default: text)textstringSignature text (when signature_type=text)signature_datastringBase64-encoded PNG of drawn signature (when signature_type=base64)signature_filefilePNG/JPG signature image (when signature_type=image)pageinteger0-indexed page number to sign (default: last page)xintegerX position in points (default: 100)yintegerY position in points (default: 100)widthintegerSignature width in points (default: 200)heightintegerSignature height in points (default: 100)AI Summarisation
Indie — $9/moInstant AI-powered document summaries — Indie tier
/api/v1/ai/summarizeGenerate an AI summary of any document with key points extracted
Parameters
filefilerequiredPDF documentmax_lengthintegerMax words in summary (default: 500)Format Conversions
Indie — $9/moConvert between PDF and Office / CSV formats — Indie tier and above
/api/v1/convert/html-to-pdfRender HTML to PDF — upload file or supply a public URL
Parameters
filefileHTML file (.html / .htm)urlstringPublic URL to render (use file OR url)/api/v1/convert/pdf-to-csvExtract tables from PDF and return as CSV
Parameters
filefilerequiredPDF with tables/api/v1/convert/pdf-to-wordConvert PDF to editable Word document (.docx)
Parameters
filefilerequiredPDF file/api/v1/convert/pdf-to-excelExtract tables from PDF to Excel (.xlsx)
Parameters
filefilerequiredPDF file/api/v1/convert/pdf-to-jpgConvert each PDF page to a JPG image
Parameters
filefilerequiredPDF filedpiintegerResolution in DPI (default: 150)/api/v1/convert/word-to-pdfConvert Word document (.docx / .doc) to PDF
Parameters
filefilerequired.docx or .doc file/api/v1/convert/excel-to-pdfConvert Excel spreadsheet (.xlsx) to PDF
Parameters
filefilerequired.xlsx or .xls file/api/v1/convert/ppt-to-pdfConvert PowerPoint (.pptx) to PDF
Parameters
filefilerequired.pptx or .ppt filePDF Security & Editing
Developer — $29/moPassword protection, watermarking, and unlock — Developer tier
/api/v1/pdf/protectPassword-protect a PDF and set permissions
Parameters
filefilerequiredPDF to protectpasswordstringrequiredPassword to set on the PDFpermissionsstringJSON array: ["print","copy","annotate","fill_forms"] — default: read-only/api/v1/pdf/watermarkAdd text or image watermark to a PDF
Parameters
filefilerequiredPDF to watermarktextstringWatermark text (use text OR image_file)image_filefileWatermark image PNG/JPGopacityfloat0.0–1.0 (default: 0.3)positionstringcenter | diagonal | top-left | top-right | bottom-left | bottom-right (default: diagonal)pagesstringall (default) or e.g. "1,3-5"/api/v1/pdf/unlockRemove password protection from a PDF
Parameters
filefilerequiredPassword-protected PDFpasswordstringOwner/user password if known (tried first)AI Document Intelligence
Developer — $29/moAI-powered data extraction, OCR, table extraction, and document Q&A
/api/v1/ai/extract-invoiceExtract structured data from invoices — vendor, amounts, GSTIN, line items
Parameters
filefilerequiredInvoice PDFexport_formatstringjson | csv | excel | quickbooks | xeroinclude_line_itemsbooleanExtract line items (default: true)/api/v1/ai/ocrExtract text from scanned PDFs and images using OCR
Parameters
filefilerequiredScanned PDF or image/api/v1/ai/extract-tablesExtract tables from PDF to structured JSON or Excel
Parameters
filefilerequiredPDF with tablespagesstringPage numbers to process/api/v1/ai/questionsGenerate comprehension questions from a document — for quizzes, onboarding, document review
Parameters
filefilerequiredPDF documentnum_questionsintegerNumber of questions (default: 5, max: 20)difficultystringeasy | medium | hard (default: medium)focus_areastringFree-text hint e.g. "financial figures"Enterprise Workflows
Business — $99/moDocument intelligence workflows for fintech, legal, and accounting teams
/api/v1/workflows/parse-documentParse any document to structured JSON — entities, amounts, dates, tables
Parameters
filefilerequiredPDF, Excel, Word, or imageextract_entitiesbooleanExtract dates, amounts (default: true)include_tablesbooleanInclude table data (default: true)/api/v1/workflows/parse-batchParse up to 100 documents in one call
Parameters
filesfile[]requiredUp to 100 files/api/v1/workflows/validate-fileValidate a document against compliance rules — GST, bank upload, vendor onboarding, insurance
Parameters
filefilerequiredDocument to validateformat_typestringgst | bank_upload | vendor_onboarding | insurance_claim/api/v1/workflows/validate-batchValidate multiple documents in one call — same format_types as validate-file
Parameters
filesfile[]requiredUp to 100 filesformat_typestringgst | bank_upload | vendor_onboarding | insurance_claim/api/v1/workflows/auto-redactAutomatically detect and redact PII — GDPR / DPDP compliant
Parameters
filefilerequiredPDF filepii_typesstringpan,aadhaar,ssn,email,phone,bank_account,credit_card/api/v1/workflows/extract-clausesExtract clauses, obligations, deadlines, and risk levels from contracts
Parameters
filefilerequiredContract or policy PDFdocument_typestringcontract | policy | terms (default: contract)/api/v1/workflows/detect-duplicatesDetect duplicate and near-duplicate documents across a set of files
Parameters
filesfile[]required2 or more files to comparesimilarity_thresholdfloat0–1 (default: 0.95)/api/v1/workflows/diff-documentsCompare two document versions and extract a structured change log
Parameters
old_versionfilerequiredPrevious versionnew_versionfilerequiredNew version/api/v1/workflows/cross-checkCross-check two documents for consistency — e.g. Invoice vs Purchase Order
Parameters
filesfile[]requiredTwo files to comparecomparison_typestringinvoice_po | vendor_verification | auto/api/v1/workflows/process-bank-statementAnalyse a bank statement — transactions, categories, Tally-ready export
Parameters
filefilerequiredBank statement PDFcurrencystringinr_gst | usd | gbp | eur/api/v1/workflows/reconcile-documentsReconcile purchase records with GSTR-2B to identify ITC discrepancies
Parameters
filefilerequiredPurchase register or GSTR-2B PDFreconciliation_typestringgstr_2b | gstr_3b/api/v1/workflows/detect-fraudAI fraud detection on invoices — risk score and red flags
Parameters
filefilerequiredInvoice PDFfilesfile[]Additional files for cross-vendor check (optional)/api/v1/bulk/uploadSubmit a batch of up to 100 files for async processing
Parameters
filesfile[]requiredUp to 100 filesoperationstringrequiredcompress | merge | convert | extract-invoice/api/v1/bulk/:job_idPoll batch job status and retrieve results
Parameters
job_idpathrequiredJob ID from upload responseDocument Pipelines
Business — $99/moChained multi-workflow pipelines for complete business outcomes — Business tier
/api/v1/pipelines/trusted-dataNormalise → validate → quality-score any document in one pipeline call
Parameters
filefilerequiredPDF, Excel, Word, or imageextract_entitiesbooleanExtract entities (default: true)include_tablesbooleanInclude table data (default: true)/api/v1/pipelines/onboardingVendor onboarding pipeline — extract → verify GSTIN/PAN → risk-score → approve/reject decision
Parameters
filefilerequiredBusiness registration, GST cert, or PAN docgstinstringGSTIN override if not in documentpanstringPAN override if not in documentvendor_namestringTrading name (aids extraction accuracy)/api/v1/pipelines/risk-checkComprehensive risk pipeline — fraud score + compliance score + duplicate detection on any document
Parameters
filefilerequiredInvoice, contract, or filing PDFdocument_typestringinvoice | contract | gst_filing | bank_statement (auto-detected)/api/v1/pipelines/contract-intelContract intelligence pipeline — clause extraction + obligation mapping + risk scoring + executive summary
Parameters
filefilerequiredContract PDFcounterparty_namestringCounterparty name (aids party extraction)/api/v1/pipelines/regulatoryRegulatory compliance pipeline — detect filing type → validate fields → flag violations → ready-to-file check
Parameters
filefilerequiredRegulatory document (GST return, ITR, TDS, audit report)filing_typestringgst | itr | tds | audit | mca (auto-detected)assessment_yearstringe.g. "2024-25"Sandbox (Test Mode)
Starter — FreeSame signature as production. Returns mock data. Zero quota consumption.
/api/v1/sandbox/pdf/compressSandbox: compress — returns a test PDF
/api/v1/sandbox/pdf/signSandbox: sign — returns a test signed PDF
/api/v1/sandbox/convert/pdf-to-pngSandbox: pdf-to-png — returns mock base64 PNG images
/api/v1/sandbox/ai/extract-invoiceSandbox: extract-invoice — returns mock invoice JSON
/api/v1/sandbox/ai/questionsSandbox: questions — returns 5 mock questions
/api/v1/sandbox/workflows/parse-documentSandbox: parse-document — returns mock parsed JSON
/api/v1/sandbox/usage/checkSandbox: usage check — returns mock usage stats
Usage & Health
Starter — FreeMonitor quota and API status
/api/v1/healthAPI health check — no authentication required
/api/v1/usage/checkCheck current usage count, limit, and reset date
/api/v1/usage/statsDetailed usage statistics broken down by endpoint and day
Response Examples
{
"success": true,
"data": {
"invoice_number": "INV-2024-001",
"date": "2024-12-15",
"vendor": {
"name": "Acme Corp",
"gstin": "29AABCS1429B1ZB"
},
"total_amount": 14160.00,
"currency": "INR",
"line_items": [...]
},
"confidence": 0.97,
"responseTime": "820ms"
}{
"success": false,
"error": "Monthly limit reached (200 calls/Starter). Resets on the 1st.",
"documentation": "https://www.allpdfmagic.com/docs/api",
"upgrade": "https://www.allpdfmagic.com/pricing#api"
}
// Response headers also include:
// X-Upgrade-Url: https://www.allpdfmagic.com/pricing#api
// X-RateLimit-Limit: 200
// X-Api-Tier: starterError Codes
Webhooks
Developer+Receive real-time notifications when batch jobs complete or fraud is flagged. Configure webhook URLs in your API dashboard.
{
"event": "job.completed",
"job_id": "job_abc123xyz",
"status": "success",
"files_processed": 25,
"download_url": "https://www.allpdfmagic.com/api/dashboard/download?...",
"timestamp": "2024-12-17T10:30:00Z"
}API Playground
Try any endpoint live — no code required. Use sandbox mode to test without quota.
Sandbox mode returns realistic mock data instantly, uses zero quota, and works with any API key. Switch to Live to call the real endpoint.
Ready to integrate?
Get a free API key in seconds. 200 calls/month included forever. Test in the sandbox first, then go live.