apyhub
Back
▣ FILE MANIPULATION · IMAGE PROCESSING

Image Resize API: Resize Images to Exact Dimensions

Hosted on ApyHub

What it does

The Image Resize API resizes images to the exact width and height you need. Upload an image or send its URL, set the dimensions in pixels, and get the resized image back as the file itself or as a signed link you can store or share.

Use it to create thumbnails, product image variants, social media and email images, or to make user uploads a consistent size before storing them. Set preserve_format to keep the original file format, and auto_orientation to rotate photos correctly using the orientation saved by the camera, so phone photos don't come out sideways.

Need a specific area of the image instead of the whole picture? Use the Crop Images API.

You can start on ApyHub's free tier with no card required.

▣ ENDPOINT 01 / 04
POST
Resize image (multipart upload, download file)
https://api.eu.apyhub.com/apyhub/resize-image/multi-part/download

QUICKSTART

GUIDE

Quickstart

Download a resized version of an image by sending the source file and required dimensions as multipart form data.

curl -X POST "https://api.eu.apyhub.com/apyhub/resize-image/multi-part/download?width=800&height=600" \
  -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 downloaded resized image.

...binary image data...
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*

About this endpoint

What it does

Resizes an uploaded image using multipart form data and returns the resized file as binary output. The resize dimensions are provided as query parameters, with optional controls for output naming, format preservation, and auto-orientation.

Query Parameter(s)

AttributeTypeDescription
widthIntegerResize width in pixels. Minimum: 1.
heightIntegerResize height in pixels. Minimum: 1.
outputStringOutput name.
preserve_formatBooleanWhether to preserve the original image format.
auto_orientationBooleanWhether to auto-orient the image.

Request Body

ParameterTypeDescription
imageBinaryImage file to resize. Binary upload.

Response

Returns a binary file response containing the resized image. The output schema is a single binary string, so there is no JSON wrapper or response fields to map.

Notes

This endpoint returns the resized image as a file rather than JSON, so callers should handle the response as binary data.

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

▣ ENDPOINT 02 / 04
POST
Resize image (multipart upload, signed URL)
https://api.eu.apyhub.com/apyhub/resize-image/multi-part/link

QUICKSTART

GUIDE

Quickstart

Resize an image from a linked file by sending the image file plus the required width and height as multipart form fields.

curl -X POST "https://api.eu.apyhub.com/apyhub/resize-image/multi-part/link?width=800&height=600" \
  -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 the resulting file URL.

{
  "data": "https://example.com/resized-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*

About this endpoint

What it does

Resizes an uploaded image and returns a signed URL for the generated result. The request sends the source image as multipart form data and passes resizing options through query parameters.

Query Parameter(s)

AttributeTypeDescription
widthIntegerTarget width in pixels. Minimum: 1.
heightIntegerTarget height in pixels. Minimum: 1.
outputStringOutput identifier. Example: my-invite.
preserve_formatBooleanWhether to keep the original image format.
auto_orientationBooleanWhether to apply automatic orientation handling.

Request Body

ParameterTypeDescription
imageBinaryImage file to upload as binary multipart form data.

Response

Returns a JSON object with a data string field containing a URI for the resized image output.

ParameterTypeDescription
dataStringSigned URL returned by the service. This field is a URI.

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

▣ ENDPOINT 03 / 04
POST
Resize image (fetch by URL, download file)
https://api.eu.apyhub.com/apyhub/resize-image/url/download

QUICKSTART

GUIDE

Quickstart

Resize an image from a URL using the required width and height query parameters, and send the source URL in the JSON body.

curl -X POST "https://api.eu.apyhub.com/apyhub/resize-image/url/download?width=800&height=600" \
  -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 resized image as binary.

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*
Resize URL mode — provide url.

About this endpoint

What it does

Resizes an image fetched from a source URL and returns the resized file as binary data. You provide the image URL in the request body and specify the target width and height as query parameters.

Query Parameter(s)

AttributeTypeDescription
widthIntegerTarget image width. Minimum: 1.
heightIntegerTarget image height. Minimum: 1.
outputStringOutput name.
preserve_formatBooleanPreserves the source image format when set.
auto_orientationBooleanApplies automatic orientation handling when set.

Request Body

ParameterTypeDescription
urlStringSource image URL. Format: URI.

Response

Returns a binary file containing the resized image.

ParameterTypeDescription
binaryStringBinary response body representing the resized image file.
▣ ENDPOINT 04 / 04
POST
Resize image (fetch by URL, signed URL)
https://api.eu.apyhub.com/apyhub/resize-image/url/link

QUICKSTART

GUIDE

Quickstart

Resize an image from a URL by sending the source URL in the JSON body and the target dimensions as query parameters.

curl -X POST "https://api.eu.apyhub.com/apyhub/resize-image/url/link?width=800&height=600" \
  -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 URI for the resized image.

{
  "data": "https://..."
}
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*
Resize URL mode — provide url.

About this endpoint

What it does

Resizes an image fetched from a URL or signed URL and returns the resized image as a URI in the data field. The target size is controlled by the width and height query parameters.

Query Parameter(s)

AttributeTypeDescription
widthIntegerOutput image width. Minimum: 1.
heightIntegerOutput image height. Minimum: 1.
outputStringOutput name.
preserve_formatBooleanPreserve the original image format.
auto_orientationBooleanAutomatically apply image orientation metadata.

Request Body

ParameterTypeDescription
urlStringImage URL to resize. Must be a valid URI.

Response

Returns a JSON object with a data string field formatted as a URI. This field contains the URI of the resized image. The success response is an object with one top-level field: data (string).

ParameterTypeDescription
dataStringURI of the resized image.
▣ 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.