Compress PDF API

Our API is 100% free to use – no fees, no subscriptions.

Reduce the file size of your PDFs using our API. Optimize documents for faster sharing and storage, while retaining sharp text and clear images. Perfect for minimizing large files, improving performance, and saving storage space effortlessly.


Benefits of our PDF Compress API

Reduce the file size of your PDFs without sacrificing quality using our efficient PDF Compress API. Customize compression settings to optimize your documents for faster sharing and storage, all while keeping text crisp and images clear. This solution is perfect for streamlining workflows, improving performance, and ensuring your files remain professionally formatted and easy to manage.

Read our API documentation to learn how to compress PDFs.

No-Code PDF Compression

Integrate our PDF API with Zapier Webhooks to automate your PDF compression workflows effortlessly. Whether you're reducing file sizes for easier sharing or faster uploads, you can trigger PDF compression from hundreds of apps supported by Zapier. Automatically optimize your documents while preserving quality, saving bandwidth and eliminating manual resizing efforts.

Multi-language Code Example

curl -X POST https://apdf.io/api/pdf/file/compress \
  -H "Authorization: Bearer TOKEN" \
  -d file="FILE_URL"
const data = new FormData();
data.append('file', 'FILE_URL');

fetch('https://apdf.io/api/pdf/file/compress', {
    headers: {'Authorization': 'Bearer TOKEN'},
    method: 'POST',
    body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;

$client = new Client();
$response = $client->post(
    'https://apdf.io/api/pdf/file/compress', [
    'headers' => [
        'Authorization' => 'Bearer TOKEN'
    ],
    'form_params' => [
        'file' => 'FILE_URL'
    ]
]);

$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'

response = RestClient.post(
  'https://apdf.io/api/pdf/file/compress',
  {
    'file' => 'FILE_URL'
  },
  {
    Authorization: "Bearer TOKEN"
  }
)

puts response.body
import requests

response = requests.post(
    'https://apdf.io/api/pdf/file/compress',
    headers = {
        'Authorization': 'Bearer TOKEN'
    },
    data = {
        'file': 'FILE_URL'
    }
)

print(response.text)
import (
  "fmt"
  "github.com/go-resty/resty/v2"
)

func main() {
  client := resty.New()
  data := map[string]string{
    "file": "FILE_URL"
  }

  resp, _ := client.R().
    SetFormData(data).
    SetHeader("Authorization", "Bearer TOKEN").
    Post("https://apdf.io/api/pdf/file/compress")

  fmt.Println(resp.String())
}
import okhttp3.*;

class Pdf {
  public static void main(String[] args) throws Exception {
    OkHttpClient client = new OkHttpClient();
    FormBody formBody = new FormBody.Builder()
      .add("file", "FILE_URL")
      .build();

    Request request = new Request.Builder()
      .url("https://apdf.io/api/pdf/file/compress")
      .addHeader("Authorization", "Bearer TOKEN")
      .post(formBody)
      .build();

    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
  }
}

Start using our API today — no trial needed!
Get Started for Free