About this endpoint
What it does
Compresses an image fetched from a public URL and returns the compressed file as binary data. You provide the source image URL in the request body and control compression with query parameters.
Query Parameter(s)
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| output | String | No | Output file name. |
| preserve_format | Boolean | No | Defaults to false. |
| compression_percentage | Integer | Yes | Compression level as a percentage between 1 and 100. |
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| url | String | Yes | Publicly accessible URL of the raster image to compress. Supported formats: JPEG, PNG, WebP, GIF, TIFF, BMP. If the URL does not start with a recognised scheme (http, https, ftp, sftp), https:// is prefixed automatically. |
Response
Returns binary file data for the compressed image.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| binary | String | Yes | Binary content of the compressed image file. |