# compresspdf: Compress PDF – Reduce PDF File Size

> compresspdf (Compress PDF – Reduce PDF File Size) is a 1001fx API function in the group Files & PDF: POST https://api.1001fx.com/files/compresspdf, 3 credits per call. It works as a ready-made module in Make or as a plain HTTP call.

Makes a PDF smaller by downsampling images and removing duplicates (Ghostscript). If the result would be larger, the original is returned. The original size and the new size are in the headers x-fx-original-size and x-fx-compressed-size.

- Group: Files & PDF
- Endpoint: `POST https://api.1001fx.com/files/compresspdf`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: multipart/form-data
- Credits: 3 credits per call
- Ready-made in: Make
- Docs: https://1001fx.com/functions/compresspdf

## Parameters

- `file` (file, optional) – File: The PDF. Either file or fileUrl.
- `fileUrl` (string, optional) – File URL: Public URL of the PDF. Either file or fileUrl.
- `level` (enum, optional, one of `screen`, `ebook`, `printer`, `prepress`, default `ebook`) – Level: screen: smallest (72 dpi images), ebook: small (150 dpi, default), printer: 300 dpi, prepress: highest quality.

## Example: Compress PDF – Reduce PDF File Size

```bash
curl -X POST 'https://api.1001fx.com/files/compresspdf' \
  -H 'X-API-KEY: YOURSECRETAPIKEY'
```
