apyhub
Back
▣ FILE MANIPULATION

Generate Image Thumbnails API

Hosted on ApyHub

What it does

Thumbnail Generator creates a thumbnail from an uploaded image or a remote image URL. Send image in a multipart request or url in the JSON body, and set width and height in the query string to control the output size.

Use output when you want a named file, and preserve_format if you need to keep the original image format. auto_orientation helps correct images with orientation metadata before the thumbnail is generated. The service supports both direct downloads and signed URL responses, so you can fit it into batch jobs or browser-driven workflows.

The response is intentionally simple. Depending on the endpoint, you either get binary thumbnail data or a JSON object with a data URI. That makes it easy to plug into upload flows, CMS pipelines, product galleries, or user-generated content moderation screens where you need a smaller preview version fast.

If you are resizing images for listings, previews, or email attachments, Thumbnail Generator gives you a consistent way to turn a source image into a smaller, usable thumbnail without adding image processing logic to your app.

▣ ENDPOINT 01 / 04
POST
Generate thumbnail (multipart, signed URL)
https://api.eu.apyhub.com/apyhub/generate-thumbnail/multi-part/link

QUICKSTART

GUIDE

Quickstart

Generate a thumbnail from an image URL with the required dimensions.

curl -X POST "https://api.eu.apyhub.com/apyhub/generate-thumbnail/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 generated thumbnail URL.

{
  "data": "https://example.com/thumbnail.png"
}
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

Generates a thumbnail from an uploaded image file and returns a JSON object containing a data URI string for the generated result.

Query Parameter(s)

AttributeTypeDescription
widthIntegerThumbnail width in pixels. Minimum: 1.
heightIntegerThumbnail height in pixels. Minimum: 1.
outputStringOutput name.
preserve_formatBooleanWhether to preserve the original image format.
auto_orientationBooleanWhether to apply automatic orientation handling.

Request Body

ParameterTypeDescription
imageBinaryImage file to upload. Format: binary.

Response

Returns a JSON object with a data string field formatted as a URI. This field contains the generated thumbnail location or reference.

ParameterTypeDescription
dataStringURI for the generated thumbnail. Format: uri.

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
Generate thumbnail (URL fetch, download)
https://api.eu.apyhub.com/apyhub/generate-thumbnail/url/download

QUICKSTART

GUIDE

Quickstart

Download a thumbnail from a URL by sending the image URL in the JSON body and the required width and height as query parameters.

curl -X POST "https://api.eu.apyhub.com/apyhub/generate-thumbnail/url/download?width=200&height=200" \
  -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 thumbnail as a binary response body (string with format: binary), not JSON.

<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.
body*
Thumbnail URL fetch — url; dimensions come from query width × height.

About this endpoint

What it does

Downloads an image from a URL and generates a thumbnail using the width and height query parameters.

Query Parameter(s)

AttributeTypeDescription
widthIntegerThumbnail width. Minimum value: 1.
heightIntegerThumbnail height. Minimum value: 1.
outputStringOutput name.
preserve_formatBooleanWhether to keep the original image format.
auto_orientationBooleanWhether to auto-rotate the image based on its orientation metadata.

Request Body

ParameterTypeDescription
urlStringSource image URL. Format: URI.

Response

Returns a binary file containing the generated thumbnail. The success response is a raw binary payload, not a JSON object.

▣ ENDPOINT 03 / 04
POST
Generate thumbnail (URL fetch, signed URL)
https://api.eu.apyhub.com/apyhub/generate-thumbnail/url/link

QUICKSTART

GUIDE

Quickstart

Generate a thumbnail from a source image URL by passing the image URL in the JSON body and the thumbnail size as query parameters.

curl -X POST "https://api.eu.apyhub.com/apyhub/generate-thumbnail/url/link?width=300&height=200" \
  -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 to the generated thumbnail.

{
  "data": "https://example.com/thumbnail.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.
body*
Thumbnail URL fetch — url; dimensions come from query width × height.

About this endpoint

What it does

Generates a thumbnail from a source image URL. The request sends the image URL in the body and uses query parameters to control the thumbnail dimensions and optional output behavior.

Query Parameter(s)

AttributeTypeDescription
widthIntegerThumbnail width. Minimum: 1.
heightIntegerThumbnail height. Minimum: 1.
outputStringOutput name.
preserve_formatBooleanWhether to preserve the source image format.
auto_orientationBooleanWhether to apply automatic orientation correction.

Request Body

ParameterTypeDescription
urlStringSource image URL to fetch. Format: URI.

Response

Returns a JSON object with a data string field containing a URI for the generated thumbnail.

ParameterTypeDescription
dataStringURI of the generated thumbnail.
▣ ENDPOINT 04 / 04
POST
Generate thumbnail (multipart, download)
https://api.eu.apyhub.com/apyhub/generate-thumbnail/multi-part/download

QUICKSTART

GUIDE

Quickstart

Download a thumbnail image from a source image by providing its URL and the required size.

curl -X POST "https://api.eu.apyhub.com/apyhub/generate-thumbnail/multi-part/download?width=300&height=200" \
  -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 generated thumbnail image.

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

Generates a thumbnail from an uploaded image and returns the resulting file as binary data. The request takes an image upload in the multipart body and uses query parameters to control the thumbnail dimensions and optional output behavior.

Query Parameter(s)

AttributeTypeDescription
widthIntegerThumbnail width in pixels. Minimum: 1.
heightIntegerThumbnail height in pixels. Minimum: 1.
outputStringOutput filename or name hint. Example: my-invite.
preserve_formatBooleanWhen true, preserves the original image format.
auto_orientationBooleanWhen true, applies automatic orientation handling.

Request Body

ParameterTypeDescription
imageBinaryThe image file to convert to a thumbnail. Binary upload.

Response

Returns a binary file response with the generated thumbnail image.

Notes

The response schema is string with format: binary, so the endpoint returns the thumbnail as raw file content rather than a JSON 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.