PDF Compression API

Try on RapidAPI

Pricing differs from other listings: Basic is 15 free calls/mo (not 100). See pricing below.

PDF compressor, optimizer, and shrinker API. Reduce PDF file size while preserving quality. Speed, lossless, or max compression modes. Multipart upload. Email attachments, web downloads, storage. Stateless, 80MB max.

Why use this API?

Shrink PDFs for storage or transfer without losing quality.

What the API does

POST a PDF file to /optimize. Returns the optimized PDF file by default (binary). Send Accept: application/json to get size metadata only (originalSize, optimizedSize, reductionBytes, reductionPercent).

Request & response schema

·

Try it in the playground

Add your RapidAPI key and run. Key is sent only to RapidAPI.

Optional parameters (sent as query string):

File is sent to RapidAPI; not stored here.

Get code

Snippets use the same mode, query parameters, and metadata-only choices as the playground above. Pick a language and copy, or click Refresh code after changing options.

Host: pdf-compression-api1.p.rapidapi.com, POST /optimize, multipart field file. PDF binary by default; Accept: application/json for size metadata only.

Replace YOUR_RAPIDAPI_KEY and the file path. Java example requires OkHttp on the classpath.

What to expect

By default the API returns the optimized PDF (binary). Send Accept: application/json to receive JSON with originalSize, optimizedSize, reductionBytes, reductionPercent only. Use your RapidAPI key in headers. Stateless; no data stored. See RapidAPI docs for full details.

Pricing & tiers (RapidAPI)

This API uses lower monthly quotas than our typical 100 / 10k / 100k / 250k layout. Ultra and Mega include pay-as-you-go overage after the included requests.

Basic

$0/mo

15 requests/month included

No overage listed on the plan (hard cap).

Pro

$9.99/mo

500 requests/month included

No overage listed on the plan.

Mega

$30/mo

10,000 requests/month included

Overage: ~$0.02 per extra request.

Prices and quotas match the provider RapidAPI dashboard as of the last update; always confirm on the live PDF Compression API listing.

About this API

Who Should Use This API

Developers and apps optimizing PDFs for email, storage, or web.

Also Known As

PDF compressor API, PDF shrinker, PDF optimizer.

PDF Lossless Optimizer API

Make your PDF files smaller while preserving quality. This API offers three optimization modes: fast processing with minimal compression, balanced lossless compression (default), or maximum compression for smallest file sizes.

What This API Does

Upload a PDF file, and we optimize:

  • PDF structure and organization
  • Content streams and compression
  • Font and resource storage
  • Image optimization (only in maxCompression mode or when allowImageCompression=true in lossless)

**Modes:**

  • **`speed`** — Little compression, fastest processing
  • **`lossless`** (default) — Moderate compression, perfect quality preservation
  • **`maxCompression`** — Maximum compression, some quality loss (not for legal/medical documents)

Key Features

  • **Three Modes** — `speed`, `lossless`, `maxCompression`
  • **100% Lossless Option** — Use `mode=lossless` for complete quality preservation
  • **Optional Image Compression** — In lossless mode: `allowImageCompression=true`, `imageQuality` (0–100)
  • **maxCompression Controls** — `compressionLevel` (screen, ebook, printer, prepress), `imageQuality`
  • **Metadata-Only Response** — Send `Accept: application/json` to get size stats without downloading the PDF
  • **Stateless** — No data stored; max file size 80MB, 60s timeout

Use Cases

  • **Email Attachments** — Reduce PDF size for easier delivery
  • **Website Downloads** — Smaller files for faster downloads
  • **Document Storage** — Save space when archiving PDFs
  • **API Integration** — Optimize PDFs in automated workflows

Frequently Asked Questions

  • Basic includes 15 requests/month (not 100). Pro is 500/mo at $9.99. Ultra is $15/mo for 2,000 requests with about $0.03 per overage call. Mega is $30/mo for 10,000 with about $0.02 per overage. Confirm on RapidAPI.
  • No. Fully stateless.
  • 80MB.