Logo
POST /api/pdf/file/compress

Compress PDF API

Send a PDF URL and get back a lighter file — images resampled for the screen, text and vector graphics kept sharp. Made for email attachments, uploads and storage bills.

  • Free plan
  • No credit card

Request

curl -X POST https://apdf.io/api/pdf/file/compress \
  -H "Authorization: Bearer TOKEN" \
  -d file="FILE_URL"

Lighter files.
Same document.

Compression goes after the heavy images, not the content. If there is nothing to gain, your file comes back unchanged.

scanned-contract.pdf example
size_original 25 MB
size_compressed 3 MB
−88%
What happens to your PDF
Photos and color scans
Resampled to 150 dpi
Text
Stays text, sharp and selectable
Vector graphics
Stay vector, as sharp as before
No real saving
You get the original back
The response
Both sizes, to log the saving

Small enough to send.

Heavy PDFs bounce, stall and pile up in storage. Compress them on the way out or on the way in.

Under the attachment limit

Shrink the reports your app emails before they hit your mail provider's attachment limit and bounce.

Lower storage bills

Compress user uploads before they land in your bucket, so every stored copy and every backup costs less.

Faster on mobile

Serve lighter PDFs to customers on slow connections, so the document opens instead of loading forever.

Phone scans and photos

Bring receipts and paperwork captured at full camera resolution down to a size that fits the rest of your files.

Compress from anywhere.

Shrink files right where they already live. One account and one monthly allowance behind every route.

Your code

One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.

POST /api/pdf/file/compress
Open the endpoint docs
Zapier

Pick the action in any Zap and map files from earlier steps. No code and no servers to run.

Compress PDF
Use it in Zapier
n8n

Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.

Compress PDF
Use it in n8n
AI agents

Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.

compress-pdf-file
See what agents can do

1,000 compressions
a month. Free.

Start on the free plan and move up only when your volume does — up to 1,000,000 operations a month on Business.

  • One call is one operation, however many pages.
  • Only calls that do the work are counted.
  • Hard limits, so no surprise overage charges.
Plan PDF operations / month
Hobby Free
$0 / month
1,000
Pro
$39–$99 / month
20,000 – 60,000
Business
$149–$899 / month
100,000 – 1,000,000

Compressing PDFs, answered

It depends on what is inside. PDFs full of photos or scans shrink the most, while files that are mostly text are already small and change little. The response tells you both sizes.
Text and vector graphics print as sharp as before. Color and grayscale images are resampled to 150 dpi, which looks crisp on screen but can look soft in high-quality print, so keep the original for print jobs.
Compression always runs in the background. Check the job on the job status endpoint, or pass a webhook_url and the result is posted to you when it is ready.
As a URL: Apdf downloads the file, up to 100 MB. In Zapier and n8n you can map the file from an earlier step instead.
The result contains a download URL that stays valid for 60 minutes. Store the file on your side if you need it longer.
After the API call

Your code made the PDF.
Then it went dark.

Opened, read, re-read, dropped on page 4 — you never see any of it. Share the PDFs you generate through Apdf recipient links, and every signal becomes something you can act on: ping Slack, update the CRM, let an agent follow up. Same account, same API token, one more call.

Your PDF, after sending Live
document:loaded CFO
page:read p4 · 38s
link:clicked pricing

API · Webhook · MCP

Make your next PDF
a lighter one.