Bestseller
Image Processing Image Optimization File Compression
Image Compress
Compress and optimize images with customizable quality, dimensions, and format conversion. Supports both file upload and URL-based image processing with intelligent compression algorithms.
Data & API Features
Support both file upload and URL-based image processing;
Intelligent compression with customizable quality (1-95);
Flexible dimension control with target size and max size options;
Automatic aspect ratio preservation during resizing;
Format conversion support (JPEG, PNG, etc.);
Optimized compression algorithms for maximum file size reduction;
Support for large images up to 10MB;
Full API support for HTTPS (TLS v1.0 / v1.1 / v1.2 / v1.3);
Fully compatible with Apple ATS;
Nationwide multi-node CDN deployment;
Ultra-fast response, API interface load balancing built with multiple servers;
Perfect for web optimization, mobile apps, and content management systems.

Annual Subscription
$49$99
Try it for free!
Sign In Sign in to get a trial key and test all APIs.
Secure payment by Stripe
API Document
HTTP Protocol:HTTPS
HTTP Method:POST
HTTP Endpoint:https://api.gugudata.io/v1/image/image-compress
Response Type:application/json; charset=utf-8
DEMO Endpoint:https://api.gugudata.io/v1/image/image-compress/demo
Live Demo:Try Interactive Demo
Full API Docs:developers.gugudata.io
API Request Parameters
| Name | Type | Is Required | Default Value | Remark |
|---|---|---|---|---|
| appkey | string | true | YOUR_APPKEY | API key obtained after payment, can be passed as query parameter or in form data |
| file | file | false | N/A | Image file to compress (JPEG, PNG, etc.). Either file or image_url must be provided, but not both |
| image_url | string | false | N/A | URL of the image to compress. Either file or image_url must be provided, but not both |
| targetWidth | integer | false | N/A | Target width in pixels. Image will be resized to this width while maintaining aspect ratio |
| targetHeight | integer | false | N/A | Target height in pixels. Image will be resized to this height while maintaining aspect ratio |
| maxWidth | integer | false | N/A | Maximum width in pixels. Image will be resized if it exceeds this width, maintaining aspect ratio |
| maxHeight | integer | false | N/A | Maximum height in pixels. Image will be resized if it exceeds this height, maintaining aspect ratio |
| quality | integer | false | 85 | Compression quality (1-95). Higher values mean better quality but larger file size. Default is 85 |
| format | string | false | N/A | Output format (JPEG, PNG, etc.). If not specified, original format is preserved |
API Response Parameters
| Name | Type | Remark |
|---|---|---|
| image | binary | Compressed image file stream (JPEG, PNG, etc.) with appropriate Content-Type header |
API Response Status Codes
| Status Code | Explanation of Status Code | Remarks |
|---|---|---|
| 200 | API responding normally | For business status codes, see below under API Custom Status Codes. |
| 400 | Parameter error | |
| 402 | APPKEY error | Please check if the APPKEY provided is the one obtained from the developer center. |
| 403 | Account overdue | Please pay attention to the E-mail reminders regarding order expiration. |
| 429 | Request rate limited | Requests cannot exceed 5 times per second. The CDN layer intelligently determines based on the frequency of IP requests. General high-frequency requests do not trigger this status code. |
| 500 | API response error |



