apyhub
FILE MANIPULATION · IMAGE PROCESSING

Image Compressor

What it does

Image Compressor reduces the size of raster images without changing your workflow. Send either a publicly accessible image URL or an uploaded image file, and choose a compression_percentage between 1 and 100. You can also set preserve_format to keep the original format, or provide an output name for the compressed file.

Use the URL-based endpoints when the image already lives online, or the multipart endpoints when you need to upload the file directly. The service supports JPEG, PNG, WebP, GIF, TIFF, and BMP inputs. Depending on the endpoint you choose, you either get the compressed file back as binary data or a time-limited pre-signed URL in a data field.

This is a good fit for reducing image payloads in content pipelines, preparing uploads for faster delivery, or shrinking assets before storing them in your own system. If you need a downloadable result, use the /download endpoints. If you want a temporary link you can pass around, use the /link endpoints.

▣ ENDPOINT 01 / 04
POST
Compress image (fetch by URL, download file)
https://api.eu.apyverse.com/apyhub/compress-images/url/download

QUICKSTART

GUIDE

Quickstart

Compress an image from a public URL and download the result.

curl -X POST "https://api.eu.apyverse.com/apyhub/compress-images/url/download?compression_percentage=75" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.jpg"}'

What you'll get back

Returns the compressed image as a binary response.

TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Request body for URL-mode compression endpoints. Send as `application/json`. The `url` field is required and must be a publicly accessible image URL. All compression options (`compression_percentage`, `preserve_format`, `output`) are passed as query parameters — not in this body.
Publicly accessible URL of the raster image to compress. Supported formats — JPEG, PNG, WebP, GIF, TIFF, BMP. Hosts without a recognised scheme (`http`, `https`, `ftp`, `sftp`) receive an `https://` prefix automatically.

About this endpoint

What it does

Compresses a raster image fetched from a publicly accessible URL and returns the compressed file as binary data. The source image URL is sent in the request body, while compression options are passed as query parameters.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename.
preserve_formatBooleanNoWhether to preserve the input image format. Default: false.
compression_percentageIntegerYesCompression percentage. Minimum: 1, maximum: 100.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublicly accessible URL of the raster image to compress. Supported formats: JPEG, PNG, WebP, GIF, TIFF, BMP. URLs with a missing recognized scheme are prefixed with https:// automatically.

Response

Returns a binary file containing the compressed image. The response body is a raw binary stream rather than a JSON object.

ParameterTypeMandatoryDescription

Query parameters

Name
Type
Description
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
DEFAULT false
compression_percentageREQUIRED
integer

Body

Name
Type
Description
bodyREQUIRED
object
Request body for URL-mode compression endpoints. Send as `application/json`. The `url` field is required and must be a publicly accessible image URL. All compression options (`compression_percentage`, `preserve_format`, `output`) are passed as query parameters — not in this body.
▣ ENDPOINT 02 / 04
POST
Compress image (fetch by URL, return signed URL)
https://api.eu.apyverse.com/apyhub/compress-images/url/link

QUICKSTART

GUIDE

Quickstart

Compress an image from a public URL and get back a time-limited download link.

curl -X POST "https://api.eu.apyverse.com/apyhub/compress-images/url/link?compression_percentage=75" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.jpg"}'

What you'll get back

Returns a JSON object with a data string field containing a time-limited pre-signed URL for the compressed image.

{
  "data": "https://storage.example.com/compress/my-compressed.png?X-Amz-Signature=def456&X-Amz-Expires=3600"
}
TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Request body for URL-mode compression endpoints. Send as `application/json`. The `url` field is required and must be a publicly accessible image URL. All compression options (`compression_percentage`, `preserve_format`, `output`) are passed as query parameters — not in this body.
Publicly accessible URL of the raster image to compress. Supported formats — JPEG, PNG, WebP, GIF, TIFF, BMP. Hosts without a recognised scheme (`http`, `https`, `ftp`, `sftp`) receive an `https://` prefix automatically.

About this endpoint

What it does

Compresses a raster image fetched from a public URL and returns a time-limited signed URL to the compressed file.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename to use for the compressed image.
preserve_formatBooleanNoDefaults to false.
compression_percentageIntegerYesCompression level as a percentage. Minimum 1, maximum 100.

Request Body

ParameterTypeMandatoryDescription
urlStringYesPublicly accessible URL of the raster image to compress. Supported formats: JPEG, PNG, WebP, GIF, TIFF, BMP. Must be a URI. Hosts without a recognised scheme (http, https, ftp, sftp) receive an https:// prefix automatically.

Response

Returns a JSON object with a data string field containing a time-limited pre-signed URL to the stored compressed image. The URL is always present on a 200 response.

ParameterTypeMandatoryDescription
dataStringYesTime-limited pre-signed URL to the stored compressed image. Download or forward the file before the URL expires.

Query parameters

Name
Type
Description
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
DEFAULT false
compression_percentageREQUIRED
integer

Body

Name
Type
Description
bodyREQUIRED
object
Request body for URL-mode compression endpoints. Send as `application/json`. The `url` field is required and must be a publicly accessible image URL. All compression options (`compression_percentage`, `preserve_format`, `output`) are passed as query parameters — not in this body.
▣ ENDPOINT 03 / 04
POST
Compress image (multipart upload, download file)
https://api.eu.apyverse.com/apyhub/compress-images/multi-part/download

QUICKSTART

GUIDE

Quickstart

Upload one image and get back a compressed file.

curl -X POST "https://api.eu.apyverse.com/apyhub/compress-images/multi-part/download?compression_percentage=75" \
  -H "apy-token: $APY_TOKEN" \
  -F "image=@/path/to/image.jpg"

What you'll get back

Returns a binary file (string with format: binary) containing the compressed image data. Save the response to a file when you run the command.

curl -X POST "https://api.eu.apyverse.com/apyhub/compress-images/multi-part/download?compression_percentage=75" \
  -H "apy-token: $APY_TOKEN" \
  -F "image=@/path/to/image.jpg" \
  --output compressed-image.jpg
TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Raster image file to compress. Supported formats — JPEG, PNG, WebP, GIF, TIFF, BMP.

About this endpoint

What it does

Compresses an uploaded raster image and returns the compressed file as a binary download. The request sends the source image in multipart form data, along with query parameters that control the output name, whether to preserve the original format, and the compression percentage.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput filename. Example: my-compressed.
preserve_formatBooleanNoWhether to keep the original image format. Default: false.
compression_percentageIntegerYesCompression level as a percentage. Minimum: 1, maximum: 100. Example: 75.

Request Body

ParameterTypeMandatoryDescription
imageStringYesRaster image file to compress. Supported formats: JPEG, PNG, WebP, GIF, TIFF, BMP. Binary file upload.

Response

Returns a binary file download containing the compressed image. The success response body is a single binary payload, not a JSON object.

ParameterTypeMandatoryDescription
response bodyStringYesBinary compressed image file returned by the endpoint.

Query parameters

Name
Type
Description
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
DEFAULT false
compression_percentageREQUIRED
integer

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 04 / 04
POST
Compress image (multipart upload, return signed URL)
https://api.eu.apyverse.com/apyhub/compress-images/multi-part/link

QUICKSTART

GUIDE

Quickstart

Upload one image file and set the compression percentage to get back a pre-signed download URL for the compressed image.

curl -X POST "https://api.eu.apyverse.com/apyhub/compress-images/multi-part/link?compression_percentage=75" \
  -H "apy-token: $APY_TOKEN" \
  -F "image=@/path/to/image.jpg"

What you'll get back

Returns a JSON object with a data string field containing a time-limited pre-signed URL to the compressed image.

{
  "data": "https://storage.example.com/compress/my-compressed.jpg?X-Amz-Signature=abc123&X-Amz-Expires=3600"
}
TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Raster image file to compress. Supported formats — JPEG, PNG, WebP, GIF, TIFF, BMP.

About this endpoint

What it does

Compresses a raster image uploaded as multipart form data and returns a signed URL for the compressed file. The compression level is controlled by compression_percentage, and the response contains a time-limited URL to download the result.

Query Parameter(s)

AttributeTypeMandatoryDescription
outputStringNoOutput name for the compressed file.
preserve_formatBooleanNoDefault: false.
compression_percentageIntegerYesCompression percentage.<br>Allowed range: 1 to 100.

Request Body

ParameterTypeMandatoryDescription
imageStringYesRaster image file to compress. Supported formats: JPEG, PNG, WebP, GIF, TIFF, BMP.

Response

Returns a JSON object with a data string field containing a time-limited pre-signed URL to the stored compressed image. The URL is always present on a 200 response.

ParameterTypeMandatoryDescription
dataStringYesTime-limited pre-signed URL to the stored compressed image. Always present on a 200 response. Download or forward the file before the URL expires.

Query parameters

Name
Type
Description
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
DEFAULT false
compression_percentageREQUIRED
integer

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.