apyhub
FILE CONVERSION · FILE MANIPULATION

Generate GIF from Video API

Hosted on ApyHub

What it does

GIF Generator turns a source video into a GIF and gives you either the file stream or a signed download link. Send a local video upload or a publicly accessible video URL, then control the clip with start time, duration, playback speed, and output size.

Use the uploaded-video endpoints when your file is already in your app, or the URL endpoints when the source lives elsewhere. The input supports .mp4, .mkv, .avi, .mov, .flv, .3gp, and .webm files, plus remote video URLs. You can trim from a specific start time, cap the clip length at up to 20 seconds, and resize the output with a WxH dimension string such as 320x240.

The streamed-download endpoints return the GIF binary directly. The signed-link endpoints return a data field containing a time-limited URI for later download. That makes GIF Generator useful for social previews, product demos, chat snippets, and any workflow where you need a short looping animation from an existing video source.

If you need a quick video-to-GIF conversion step in a pipeline, this service keeps the inputs simple and the output format predictable.

▣ ENDPOINT 01 / 04
POST
Generate GIF from uploaded video and stream download
http://localhost:8080/apyhub/generate-gif/multi-part/download
QUICKSTARTGUIDE

Quickstart

Upload a video to generate a GIF from it.

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

What you'll get back

Returns a binary file (string with format: binary) — the generated GIF 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.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
Output dimensions WxH. Omit to keep original size.
Playback speed. 0 = normal; positive = faster (1/n PTS); negative = slower (abs(n) PTS).
Video file (.mp4 .mkv .avi .mov .flv .3gp .webm).
Clip length in seconds (capped at 20).
Seek offset in seconds.

About this endpoint

What it does

Generates a GIF from an uploaded video file and returns the result as a streamed binary response. The request accepts the source video and optional conversion settings such as output size, playback speed, clip duration, and start time.

Request Body

ParameterTypeMandatoryDescription
videoStringYesVideo file upload. Accepted formats: .mp4, .mkv, .avi, .mov, .flv, .3gp, .webm.
sizeStringNoOutput dimensions in WxH format. Omit to keep the original size. Example: 320x240.
speedIntegerNoPlayback speed. Default: 0.<br>Allowed range: -10 to 10.<br>0 = normal speed; positive values are faster; negative values are slower.
durationIntegerNoClip length in seconds. Default: 2.<br>Allowed range: 1 to 20.<br>The length is capped at 20 seconds.
start_timeIntegerNoSeek offset in seconds. Default: 0.<br>Minimum: 0.

Response

Returns a binary stream containing the generated GIF file.

ParameterTypeMandatoryDescription
binaryStringYesGIF file content returned as a streamed binary response.

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 GIF from uploaded video and return signed link
http://localhost:8080/apyhub/generate-gif/multi-part/link
QUICKSTARTGUIDE

Quickstart

Convert a video file into a GIF by uploading the video and providing the minimum required multipart fields.

curl -X POST "http://localhost:8080/apyhub/generate-gif/multi-part/link" \
  -H "apy-token: $APY_TOKEN" \
  -F "video=@/path/to/video.mp4"

What you'll get back

Returns a JSON object with a data string field containing a time-limited signed download URL.

{
  "data": "https://storage.example.com/gif/output.gif?sig=abc"
}
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*
Output dimensions WxH. Omit to keep original size.
Playback speed. 0 = normal; positive = faster (1/n PTS); negative = slower (abs(n) PTS).
Video file (.mp4 .mkv .avi .mov .flv .3gp .webm).
Clip length in seconds (capped at 20).
Seek offset in seconds.

About this endpoint

What it does

Creates a GIF from an uploaded video file and returns a time-limited signed URL to download the generated file.

Request Body

ParameterTypeMandatoryDescription
videoStringYesVideo file to convert. Binary upload. Supported formats: .mp4, .mkv, .avi, .mov, .flv, .3gp, .webm.
sizeStringNoOutput dimensions in WxH format. Omit to keep the original size.
speedIntegerNoPlayback speed. Default is 0 (normal). Allowed range: -10 to 10. Positive values make playback faster (1/n PTS); negative values make it slower (abs(n) PTS).
durationIntegerNoClip length in seconds. Default is 2. Allowed range: 1 to 20; values are capped at 20.
start_timeIntegerNoSeek offset in seconds. Default is 0. Minimum: 0.

Response

Returns a JSON object with a data string field containing a signed URI for downloading the generated GIF.

ParameterTypeMandatoryDescription
dataStringYesTime-limited signed URL for download.

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 GIF from remote video URL and stream download
http://localhost:8080/apyhub/generate-gif/url/download
QUICKSTARTGUIDE

Quickstart

Convert a public MP4 URL into a GIF using the source video URL.

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

What you'll get back

Returns a binary file (string with format: binary) containing the generated GIF.

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*
Output dimensions WxH. Omit to keep original size.
Playback speed. 0 = normal; positive = faster; negative = slower.
Clip length in seconds (capped at 20).
Publicly accessible URL of the source video.
Seek offset in seconds.

About this endpoint

What it does

Generates a GIF from a remotely hosted video file and returns it as a streamed binary download. The request body supplies the source video URL and optional conversion settings such as output size, playback speed, clip duration, and start time.

Request Body

ParameterTypeMandatoryDescription
video_urlStringYesPublicly accessible URL of the source video.
sizeStringNoOutput dimensions in WxH format. Omit to keep the original size.
speedStringNoPlayback speed. 0 = normal; positive values = faster; negative values = slower. Default: 0.
durationStringNoClip length in seconds. Default: 2; capped at 20.
start_timeStringNoSeek offset in seconds. Default: 0.

Response

Returns a streamed binary file containing the generated GIF. The success response body is a binary download, with no JSON wrapper or top-level fields declared in the output schema.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 04 / 04
POST
Generate GIF from remote video URL and return signed link
http://localhost:8080/apyhub/generate-gif/url/link
QUICKSTARTGUIDE

Quickstart

Convert a public video URL into a GIF with the minimum required input.

curl -X POST "http://localhost:8080/apyhub/generate-gif/url/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"video_url":"https://assets.apyhub.com/samples/sample.mp4"}'

What you'll get back

Returns a JSON object with a data string field containing a time-limited signed URL for the generated GIF.

{
  "data": "https://storage.example.com/gif/output.gif?sig=abc"
}
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*
Output dimensions WxH. Omit to keep original size.
Playback speed. 0 = normal; positive = faster; negative = slower.
Clip length in seconds (capped at 20).
Publicly accessible URL of the source video.
Seek offset in seconds.

About this endpoint

What it does

Generates a GIF from a publicly accessible remote video URL and returns a signed download link to the created GIF.

Request Body

ParameterTypeMandatoryDescription
video_urlStringYesPublicly accessible URL of the source video. Must be a URI.
sizeStringNoOutput dimensions in WxH format. Omit to keep the original size.
speedStringNoPlayback speed. Default: 0.<br>0 = normal<br>positive values = faster<br>negative values = slower
durationStringNoClip length in seconds. Default: 2. Capped at 20.
start_timeStringNoSeek offset in seconds. Default: 0.

Response

Returns a JSON object with a data string field containing a time-limited signed URL for downloading the generated GIF.

ParameterTypeMandatoryDescription
dataStringYesTime-limited signed URL for download. Must be a URI.

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.