Back to Tool
📄
PDF Compressor API
Compress PDF files via API with quality optimization
Endpoint
POST
/api/v1/pdf-compressorAuthentication
Include your API key in the request header:
X-API-Key: your_api_key_hereGet your API key from the Dashboard
Request Body
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
| file | Yes | PDF file to compress | |
| quality | string | No | Compression quality: "low", "medium", or "high" (default: "medium") |
Response
| Field | Type | Description |
|---|---|---|
| success | boolean | Whether the compression was successful |
| originalSize | number | Original file size in bytes |
| compressedSize | number | Compressed file size in bytes |
| compressionRatio | number | Compression ratio as percentage |
| pageCount | number | Number of pages in the PDF |
| string | Base64 encoded compressed PDF with data URL prefix |
Code Examples
curl -X POST https://tools.shubhambadgujar.com/api/v1/pdf-compressor \
-H "X-API-Key: your_api_key" \
-F "pdf=@/path/to/document.pdf" \
-F "quality=medium"Rate Limits
- • 100 requests per minute
- • 10,000 requests per day
- • Max request size: 10MB
Need Help?
Contact us at support@shubhambadgujar.com