apyhub
FILE CONVERSION · FILE MANIPULATION

Compress Video File API

Hosted on ApyHub

What it does

Video Compressor reduces the size of a video file by re-encoding it at a chosen compression percentage. Send a video and get back either a compressed file or a time-limited download link, depending on the endpoint you use.

Use video for direct uploads or video_url when the source already lives at a public URL. Both flows accept compression_percentage, with values from 0 to 100; higher values produce smaller files at lower quality. Supported upload formats include .mp4, .mkv, .avi, .mov, .flv, .3gp, and .webm.

Choose the download endpoint when you want the compressed video returned as binary data immediately. Choose the link endpoint when you want a signed URL in the data field that your app can fetch later. That makes Video Compressor useful for storage optimization, email attachment trimming, upload-size limits, and preparing video assets for downstream delivery.

Keep the control surface simple: one input video, one compression setting, and one compressed output. If you are building media workflows, this is the kind of tool you can drop in before storage, sharing, or publishing steps without adding custom transcoding logic.

▣ ENDPOINT 01 / 04
POST
Compress video (upload → download)
http://localhost:8080/apyhub/compress-video/multi-part/download
QUICKSTARTGUIDE

Quickstart

Upload a video file to get back the compressed video binary.

curl -X POST "http://localhost:8080/apyhub/compress-video/multi-part/download" \
  -H "apy-token: $APY_TOKEN" \
  -F "video=@/path/to/video.mp4" \
  -F "compression_percentage=50"

What you'll get back

Returns a binary containing the compressed video file.

TRY ITLIVE · 550 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*
Video file (.mp4 .mkv .avi .mov .flv .3gp .webm)
Compression strength 0–100 (higher = smaller file, lower quality).

About this endpoint

What it does

Uploads a video file and returns the compressed video as a binary file in the response. You can optionally control the compression strength with compression_percentage.

Request Body

ParameterTypeMandatoryDescription
videoStringYesVideo file (.mp4, .mkv, .avi, .mov, .flv, .3gp, .webm).
compression_percentageIntegerNoCompression strength from 0 to 100. Higher values produce a smaller file with lower quality. Default: 50.

Response

Returns a binary file as the response body — the compressed video output. The output schema is a binary string, so there is no JSON wrapper or named response field.

ParameterTypeMandatoryDescription
binary response bodyStringYesCompressed video file returned as raw binary data.

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
Compress video (URL → download)
http://localhost:8080/apyhub/compress-video/url/download
QUICKSTARTGUIDE

Quickstart

Compress a video from a public URL by sending the source video_url in the JSON body.

curl -X POST "http://localhost:8080/apyhub/compress-video/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"video_url":"https://assets.apyhub.com/samples/sample.mp4", "compression_percentage":"50"}'

What you'll get back

Returns a binary file that contain the compressed video content.

TRY ITLIVE · 550 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*
Compression strength 0–100 as a string or number.

About this endpoint

What it does

Compresses a video from a provided URL and returns the compressed file as binary content for download.

Request Body

ParameterTypeMandatoryDescription
video_urlStringYesVideo URL to compress. Must be a URI.
compression_percentageStringNoCompression strength from 0 to 100, provided as a string or number. Default: 50.

Response

Returns binary file content in the success response. The output schema is a string with binary format, so the endpoint responds with the compressed video data itself rather than a JSON object.

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.