Integrate powerful image compression into your applications
Our API allows you to compress and convert images programmatically. No API key required for basic usage.
Base URL:
https://compressorimage.com/apiCompress and convert a single image.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | Image file (max 10MB) |
| format | String | No | jpeg, png, webp, avif (default: webp) |
| quality | Number | No | 1-100 (default: 85) |
| width | Number | No | Target width in pixels |
| height | Number | No | Target height in pixels |
curl -X POST https://compressorimage.com/api/compress \
-F "file=@image.jpg" \
-F "format=webp" \
-F "quality=85" \
-o compressed.webpCompress multiple images at once. Returns a ZIP file containing all compressed images.
| Parameter | Type | Description |
|---|---|---|
| files | File[] | Array of images (max 20) |
| format | String | Output format for all images |
| quality | Number | Quality setting for all images |
curl -X POST https://compressorimage.com/api/batch-compress \
-F "files=@image1.jpg" \
-F "files=@image2.png" \
-F "format=webp" \
-F "quality=85" \
-o compressed.zipTo ensure fair usage, we implement the following rate limits:
Need higher limits? Contact us about our premium API plans.
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('format', 'webp');
formData.append('quality', '85');
const response = await fetch('/api/compress', {
method: 'POST',
body: formData
});
const blob = await response.blob();
const url = URL.createObjectURL(blob);import requests
files = {'file': open('image.jpg', 'rb')}
data = {'format': 'webp', 'quality': '85'}
response = requests.post(
'https://compressorimage.com/api/compress',
files=files,
data=data
)
with open('compressed.webp', 'wb') as f:
f.write(response.content)