apyhub
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)
http://localhost:8080/apyhub/generate-thumbnail/multi-part/link
QUICKSTARTGUIDE

Quickstart

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

curl -X POST "http://localhost:8080/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)

AttributeTypeMandatoryDescription
widthIntegerYesThumbnail width in pixels. Minimum: 1.
heightIntegerYesThumbnail height in pixels. Minimum: 1.
outputStringNoOutput name.
preserve_formatBooleanNoWhether to preserve the original image format.
auto_orientationBooleanNoWhether to apply automatic orientation handling.

Request Body

ParameterTypeMandatoryDescription
imageStringNoImage 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.

ParameterTypeMandatoryDescription
dataStringN/AURI for the generated thumbnail. Format: uri.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

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 02 / 04
POST
Generate thumbnail (URL fetch, download)
http://localhost:8080/apyhub/generate-thumbnail/url/download
QUICKSTARTGUIDE

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 "http://localhost:8080/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)

AttributeTypeMandatoryDescription
widthIntegerYesThumbnail width. Minimum value: 1.
heightIntegerYesThumbnail height. Minimum value: 1.
outputStringNoOutput name.
preserve_formatBooleanNoWhether to keep the original image format.
auto_orientationBooleanNoWhether to auto-rotate the image based on its orientation metadata.

Request Body

ParameterTypeMandatoryDescription
urlStringYesSource 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.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

Body

Name
Type
Description
bodyREQUIRED
object
Thumbnail URL fetch — `url`; dimensions come from query `width` × `height`.
▣ ENDPOINT 03 / 04
POST
Generate thumbnail (URL fetch, signed URL)
http://localhost:8080/apyhub/generate-thumbnail/url/link
QUICKSTARTGUIDE

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 "http://localhost:8080/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)

AttributeTypeMandatoryDescription
widthIntegerYesThumbnail width. Minimum: 1.
heightIntegerYesThumbnail height. Minimum: 1.
outputStringNoOutput name.
preserve_formatBooleanNoWhether to preserve the source image format.
auto_orientationBooleanNoWhether to apply automatic orientation correction.

Request Body

ParameterTypeMandatoryDescription
urlStringYesSource image URL to fetch. Format: URI.

Response

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

ParameterTypeMandatoryDescription
dataStringNoURI of the generated thumbnail.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

Body

Name
Type
Description
bodyREQUIRED
object
Thumbnail URL fetch — `url`; dimensions come from query `width` × `height`.
▣ ENDPOINT 04 / 04
POST
Generate thumbnail (multipart, download)
http://localhost:8080/apyhub/generate-thumbnail/multi-part/download
QUICKSTARTGUIDE

Quickstart

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

curl -X POST "http://localhost:8080/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)

AttributeTypeMandatoryDescription
widthIntegerYesThumbnail width in pixels. Minimum: 1.
heightIntegerYesThumbnail height in pixels. Minimum: 1.
outputStringNoOutput filename or name hint. Example: my-invite.
preserve_formatBooleanNoWhen true, preserves the original image format.
auto_orientationBooleanNoWhen true, applies automatic orientation handling.

Request Body

ParameterTypeMandatoryDescription
imageStringNoThe 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.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

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.