apyhub
Back

Resize Image to Custom Dimensions API

What it does

Image Resize lets you send a PNG or JPEG and get back a resized image as binary output. You provide the source file plus target width and height, and you can optionally set format to png or jpeg if you want the output converted instead of keeping the input format.

Use it when you need consistent image dimensions for product galleries, profile uploads, email templates, or thumbnails. The endpoint accepts images up to 15 MB, so it fits common application workflows without adding an image processing stack to your own service.

The response is the resized image file itself, which makes it easy to store, pass to another service, or return directly from your backend. If you are normalising user-uploaded images or generating fixed-size assets for a web app, Image Resize gives you a simple transformation step with predictable inputs and outputs.

POST
Resize an image
https://api.eu.apyhub.com/freedailypro/resize-image-to-custom-dimensions-api/image-resize

QUICKSTART

GUIDE

Quickstart

Resize an image by uploading the file plus the target width and height.

curl -X POST "https://api.eu.apyhub.com/freedailypro/resize-image-to-custom-dimensions-api/image-resize" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.jpg" \
  -F "width=800" \
  -F "height=600"

What you'll get back

Returns a binary file (string with format: binary) — the resized image data.

TRY ITLIVE · 10 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*
The image (PNG or JPEG). Up to 15 MB.
Target width in pixels
Target height in pixels
png or jpeg; default is the input format

About this endpoint

What it does

Resizes an uploaded image and returns the resized image as binary output. The request body includes the source file and target dimensions, with an optional output format.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe image file in PNG or JPEG format. Up to 15 MB.
widthNumberYesTarget width in pixels.
heightNumberYesTarget height in pixels.
formatStringNoOutput format: png or jpeg. Default is the input format.

Response

Returns a binary file containing the resized image. The success response is a binary payload, not a JSON object.

ParameterTypeDescription
binaryStringResized image data returned by the endpoint.

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.