apyhub
FILE CONVERSION · FILE MANIPULATION

Generate File Preview API

What it does

File Preview Generator creates PNG previews from a file you upload or a file at a remote URL. Send a file or a url, and get back either a downloadable PNG or a signed data link to it. You can also pass an optional width query value to control the preview size.

Use it when you need a quick visual representation of documents, images, videos, or archives without building rendering logic yourself. The upload-based endpoints support streamed download or a signed link response, while the URL-based endpoints let you preview assets already hosted elsewhere.

File Preview Generator is useful for document browsers, file management dashboards, review queues, and systems that need thumbnails before a user opens the original file. It is a straightforward way to generate preview images for remote assets or files already in your request pipeline.

The API returns only what the endpoint schema defines: a binary PNG download or a JSON object containing the preview URL. That keeps integration simple whether you want to store the image, serve it directly, or hand off a signed link to another service.

▣ ENDPOINT 01 / 04
POST
Generate PNG preview from remote file URL and return signed link (FC-04)
https://api.eu.apyverse.com/apyhub/generate-file-preview/url/link

QUICKSTART

GUIDE

Quickstart

Generate a preview link for a file by sending its URL in the request body.

curl -X POST "https://api.eu.apyverse.com/apyhub/generate-file-preview/url/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.pdf"}'

What you'll get back

Returns a JSON object with a data string field containing the generated preview URL.

{
  "data": "https://..."
}
TRY ITLIVE · 300 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*

About this endpoint

What it does

Generates a PNG preview from a remote file URL and returns a signed link to the generated preview. The request body supplies the source file URL, and the response returns the preview URL in data.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerNoPreview width in pixels. Minimum: 0.

Request Body

ParameterTypeMandatoryDescription
urlStringYesRemote file URL to preview. Format: URI.

Response

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

ParameterTypeMandatoryDescription
dataStringYesSigned URI for the generated PNG preview.

Query parameters

Name
Type
Description
widthOPTIONAL
integer

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 04
POST
Generate PNG preview from uploaded file and stream download (FC-04)
https://api.eu.apyverse.com/apyhub/generate-file-preview/file/download

QUICKSTART

GUIDE

Quickstart

Upload a file to generate a downloadable preview.

curl -X POST "https://api.eu.apyverse.com/apyhub/generate-file-preview/file/download" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file"

What you'll get back

Returns a binary file stream (string with format: binary), not a JSON object. The response is the generated downloadable file content.

(binary file download)
TRY ITLIVE · 300 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*
Supported document, image, video, or archive file.

About this endpoint

What it does

Generates a PNG preview from an uploaded file and returns the result as a binary download. The request sends a file in the body, and an optional width query parameter can be used to control the preview width.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerNoPreview width. Must be greater than or equal to 0.

Request Body

ParameterTypeMandatoryDescription
fileStringYesSupported document, image, video, or archive file. Binary upload.

Response

Returns a binary response containing the generated PNG preview file. The output schema is a binary string, so the success payload is the downloaded preview content rather than a JSON object.

ParameterTypeMandatoryDescription
(binary body)StringYesPNG preview file content returned as binary data.

Query parameters

Name
Type
Description
widthOPTIONAL
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 03 / 04
POST
Generate PNG preview from uploaded file and return signed link (FC-04)
https://api.eu.apyverse.com/apyhub/generate-file-preview/file/link

QUICKSTART

GUIDE

Quickstart

Upload a file to generate a preview link.

curl -X POST "https://api.eu.apyverse.com/apyhub/generate-file-preview/file/link" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file"

What you'll get back

Returns a JSON object with a data string field containing the generated preview URL.

{
  "data": "https://example.com/preview/abc123"
}
TRY ITLIVE · 300 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 PNG preview for an uploaded file and returns a signed link to the generated preview. The request uploads a file, and the response contains a URI string in data.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerNoPreview width in pixels. Must be greater than or equal to 0.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe uploaded file to generate a preview from. Binary file upload.

Response

Returns a JSON object with a required data string field formatted as a URI. This data value is the signed link to the generated preview.

AttributeTypeMandatoryDescription
dataStringYesSigned preview link as a URI.

Query parameters

Name
Type
Description
widthOPTIONAL
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
Generate PNG preview from remote file URL and stream download (FC-04)
https://api.eu.apyverse.com/apyhub/generate-file-preview/url/download

QUICKSTART

GUIDE

Quickstart

Generate a preview from a file URL by sending the source URL in the JSON body.

curl -X POST "https://api.eu.apyverse.com/apyhub/generate-file-preview/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.pdf"}'

What you'll get back

Returns a binary file response.

TRY ITLIVE · 300 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*

About this endpoint

What it does

Generates a PNG preview from a remote file URL and returns the result as a streamed binary download.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerNoPreview width in pixels. Must be an integer greater than or equal to 0.

Request Body

ParameterTypeMandatoryDescription
urlStringYesRemote file URL to generate the preview from. Must be a URI.

Response

Returns a binary response containing the generated PNG preview stream. The output schema is a top-level binary string, so there is no JSON wrapper or named JSON fields in the success payload.

Query parameters

Name
Type
Description
widthOPTIONAL
integer

Body

Name
Type
Description
bodyREQUIRED
object
▣ 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.