apyhub
Back

Compress PDF File API

What it does

PDF Compressor reduces the size of a PDF by taking a binary PDF upload and returning a compressed binary PDF file. Send a PDF up to 20 MB, get a smaller PDF back.

Use PDF Compressor when you need to cut download time, reduce email attachment size, or store documents more efficiently without changing your workflow around PDFs. The endpoint is straightforward: POST the file to /compress, and the response is the compressed PDF as binary content.

Because the service accepts only a PDF file in the request body and returns binary output, it fits cleanly into document pipelines, upload services, and backend jobs that need to shrink files before sharing or archiving. It is useful anywhere PDF size matters more than converting the document into another format.

If you are building a document management flow, a support portal, or an internal archive tool, PDF Compressor gives you a direct way to reduce PDF file size before delivery or retention.

POST
Compress a PDF
https://api.eu.apyhub.com/freedailypro/compress-pdf-file/compress

QUICKSTART

GUIDE

Quickstart

Upload a PDF to compress it.

curl -X POST "https://api.eu.apyhub.com/freedailypro/compress-pdf-file/compress" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.pdf"

What you'll get back

Returns a binary file (string with format: "binary"), which is the compressed PDF content.

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The PDF. Up to 20 MB.

About this endpoint

What it does

Compresses a PDF file that you upload and returns the compressed PDF as a binary file in the response.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe PDF file to compress. Up to 20 MB.

Response

Returns a binary file in the response body — the compressed PDF. The success response is a binary stream, not a JSON object.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.