Developer Api and Pro subscription with premium features will be available soon!

API & WordPress Plugin

Integrate SmartPNG compression into your applications and WordPress sites.

WordPress Plugin

Seamlessly compress images directly within your WordPress dashboard.

  • checkAutomatic image compression
  • checkBulk compression for existing images
  • checkWordPress media library integration
  • checkBackup original images
  • checkEasy installation and setup
Calculate Your Price
1K25K50K
1 Γ— 1000 compressionsUS$9.00 each

Total Price$9.00 USD
Get Api Key
$9.00
for 1,000 compressions

Developer API Documentation

Integrate SmartPNG compression into your applications with our REST API

Base URL
https://integration.smartpng.com/api
Authentication

All API requests require an API key. Include your API key in the request body or as a form parameter.

Get your API key from the Dashboard
1. Validate API Key

Check if your API key is valid and get remaining credits.

Endpoint
POST /validate
Request Body
{
  "api_key": "your_api_key_here"
}
Response
{
  "valid": true,
  "user_id": "user_id",
  "credits_remaining": 1000,
  "can_compress": true,
  "max_image_size": 52428800
}
2. Compress Image (Immediate)

Upload and compress an image immediately. Best for small to medium images.

Endpoint
POST /compress
Content-Type
multipart/form-data
Form Parameters
ParameterTypeRequiredDescription
api_keystringYesYour API key
filefileYesImage file (PNG, JPEG, WebP)
compression_levelfloatNoCompression quality (0.0-1.0, default: 0.7)
background_processingbooleanNoUse background queue (default: false)
Response (Immediate Processing)
{
  "success": true,
  "job_id": "unique_job_id",
  "status": "completed",
  "message": "Image compressed successfully",
  "compressed_data": "base64_encoded_image",
  "original_size": 1048576,
  "compressed_size": 524288,
  "compression_ratio": 50.0
}
Response (Background Processing)
{
  "success": true,
  "job_id": "unique_job_id",
  "status": "queued",
  "message": "Image uploaded and queued for background processing"
}
3. Check Job Status

Check the status of a background compression job and retrieve the result.

Endpoint
GET /job-status/{job_id}?api_key=your_api_key
Response (Completed)
{
  "job_id": "unique_job_id",
  "status": "completed",
  "filename": "image.png",
  "original_size": 1048576,
  "compressed_size": 524288,
  "compression_ratio": 50.0,
  "compressed_url": "blob_storage_url",
  "compressed_data": "base64_encoded_image",
  "created_at": "2025-01-15T10:30:00Z"
}
Response (Failed)
{
  "job_id": "unique_job_id",
  "status": "failed",
  "filename": "image.png",
  "error_message": "Compression failed: Invalid image format",
  "created_at": "2025-01-15T10:30:00Z"
}
Error Codes
Status CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
413Payload Too Large - Image exceeds 50MB
429Too Many Requests - Insufficient credits
500Internal Server Error
Example: cURL Request
curl -X POST https://integration.smartpng.com/api/compress \
  -F "api_key=your_api_key_here" \
  -F "file=@/path/to/image.png" \
  -F "compression_level=0.8" \
  -F "background_processing=false"
Limits
  • Maximum file size: 50 MB
  • Supported formats: PNG, JPEG, WebP
  • Credit cost: 1 credit per compression
  • Compression quality range: 0.0 - 1.0 (higher = better quality)