---
title: Generate File Preview API
slug: generate-png-preview
url: https://apyhub.com/apyhub/service/generate-png-preview
provider: ApyHub
categories: [File Conversion, File Manipulation, Image Processing]
tags: [png-preview, file-preview, thumbnail-generation, document-preview, url-to-image]
auth: api_key
---

# Generate File Preview API

Generate PNG previews from uploaded files or remote URLs. Stream the image or return a signed link, with optional width control.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `/generate/preview/file` | What it does Generates a PNG preview from an uploaded file and returns the resulting image as a bin… | 300 |
| POST | `/generate/preview/file/url` | What it does Generates a PNG preview from an uploaded file and returns a signed link to the generat… | 300 |
| POST | `/generate/preview/url/file` | What it does Generates a PNG preview from a remote file URL and returns the result as a streamed bi… | 300 |
| POST | `/generate/preview/url` | What it does Generates a PNG preview from a remote file URL and returns a signed link to the result… | 300 |

## About

## What it does
PNG Preview Generator turns an uploaded file or a remote file URL into a PNG preview. Send a `file` in the request body, or send a `url`, and you can get the result either as a streamed PNG download or as a signed `data` link. You can also pass an optional `width` query parameter to control the preview size.

Use PNG Preview Generator when you need a consistent image representation of files before a user opens them. It supports document, image, video, and archive files on the upload path, which makes it useful for file managers, content dashboards, review queues, and share flows where you want a quick visual preview instead of the original file.

The service exposes two request patterns: `/file/*` for uploaded binaries and `/url/*` for remote assets. For download responses, the API returns binary PNG data. For link responses, it returns an object with a `data` field containing a URI. That gives you flexibility to either stream the preview directly or store and fetch it later.

If your application needs thumbnails or previews for mixed file types, PNG Preview Generator gives you a single output format that is easy to display, cache, and pass between services.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/generate-png-preview
