Quick Start

Get up and running with PDF Toolkit API in under a minute.

Quick Start

Get started with the PDF Toolkit API in minutes.

1. Get Your API Key

Sign up and subscribe at RapidAPI to get your API key.

2. Make Your First Request

curl

curl -X POST "https://pdf.toolkitapi.io/v1/pdf/compress" \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://toolkitapi.io/sample.pdf"}'

Python

import httpx

response = httpx.post(
    "https://pdf.toolkitapi.io/v1/pdf/compress",
    headers={"X-API-Key": "YOUR_KEY"},
    json={"url": "https://toolkitapi.io/sample.pdf"},
)
print(response.json())

JavaScript

const response = await fetch(
  "https://pdf.toolkitapi.io/v1/pdf/compress",
  {
    method: "POST",
    headers: {
      "X-API-Key": "YOUR_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ url: "https://toolkitapi.io/sample.pdf" }),
  }
);
const data = await response.json();
console.log(data);

3. Explore the Response

{
  "object_name": "compressed_abc123.pdf",
  "original_size_bytes": 2048000,
  "compressed_size_bytes": 512000,
  "compression_ratio": 0.75
}

4. Next Steps