apyhub
FILE CONVERSION · FILE MANIPULATION

Generate GIF from Video Job API

Hosted on ApyHub

What it does

Video to GIF Converter turns a video into an animated GIF job you can poll for completion. Send either a public video_url or a multipart video file, then optionally set size, speed, duration, and start_time to control the clip you want to extract.

The submission endpoints return a job_id immediately, so you can track the conversion asynchronously with GET /jobs/:job_id. When the job finishes successfully, the status response includes a url pointing to the generated GIF. While the job is pending, or if it failed, the response also includes a human-readable message.

Use Video to GIF Converter when you need a short preview from a longer clip, a looping animation for product pages, or a lightweight asset for chats and docs. duration is capped at 20 seconds, speed accepts values from -10 to 10 for slow motion or fast forward, and size expects a WIDTHxHEIGHT value such as 320x240.

This flow is straightforward for backend automation: submit the source video, store the returned job_id, and fetch the output GIF URL once processing completes.

▣ ENDPOINT 01 / 03
POST
Submit video-to-GIF job
http://localhost:8080/apyhub/generate-gif-from-video/url-to-json
QUICKSTARTGUIDE

Quickstart

Submit a video URL to start an async GIF generation job.

curl -X POST "http://localhost:8080/apyhub/generate-gif-from-video/url-to-json" \
  -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 top-level job_id string — a UUID you can use for status polling.

{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
TRY ITLIVE · 400 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 WIDTHxHEIGHT (even integers, e.g. 320x240).
Integer -10…10; negative = slow motion, positive = fast forward, 0 = normal.
Clip length in seconds; capped at 20. Default 2.
Publicly accessible URL of the video to convert. Mandatory.
Seek offset in seconds. Default 0.

About this endpoint

What it does

Submits a video-to-GIF conversion job using a source video URL and returns a job identifier immediately. Use that job ID to poll the corresponding job status endpoint until the GIF is ready.

Query Parameter(s)

AttributeTypeMandatoryDescription
persistentBooleanNoOptional flag passed in the query string.

Request Body

ParameterTypeMandatoryDescription
video_urlStringYesPublicly accessible URL of the video to convert. Must be a URI.
sizeStringNoOutput dimensions as WIDTHxHEIGHT using even integers, for example 320x240.
speedStringNoInteger from -10 to 10; negative values slow the clip down, positive values speed it up, and 0 keeps normal speed.
durationStringNoClip length in seconds. Capped at 20. Default is 2.
start_timeStringNoSeek offset in seconds. Default is 0.

Response

Returns a JSON object with a top-level job_id string field — a UUID job identifier for status polling. The endpoint returns immediately after a successful async job submission.

ParameterTypeMandatoryDescription
job_idStringYesJob identifier for status polling. Must be a UUID.

Notes

This endpoint kicks off an async job and returns immediately with a job identifier; the actual work runs in the background. Pair this call with the corresponding job_check endpoint — poll that until the status reaches a terminal state to retrieve the result. Extract the job_id field from the response to continue polling.

Query parameters

Name
Type
Description
persistentOPTIONAL
boolean

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 03
POST
Submit video-to-GIF job
http://localhost:8080/apyhub/generate-gif-from-video/file-to-json
QUICKSTARTGUIDE

Quickstart

Upload a video to start a GIF-generation job and get back a job ID for polling.

curl -X POST "http://localhost:8080/apyhub/generate-gif-from-video/file-to-json?persistent=false" \
  -H "apy-token: $APY_TOKEN" \
  -F "video=@/path/to/video.mp4"

What you'll get back

Returns a JSON object with a required job_id string field. The job_id is the async job identifier you can use for status polling.

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}
TRY ITLIVE · 400 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 WIDTHxHEIGHT (even integers, e.g. 320x240).
Integer -10…10; negative = slow motion, positive = fast forward, 0 = normal.
The video file to convert. Mandatory.
Clip length in seconds; capped at 20. Default 2.
Seek offset in seconds. Default 0.

About this endpoint

What it does

Submits a video file to start an async job that generates a GIF from the uploaded video. The request accepts multipart form data and returns a job identifier immediately so you can poll for completion later.

Query Parameter(s)

AttributeTypeMandatoryDescription
persistentBooleanNoWhether the job result should be kept persistently.

Request Body

ParameterTypeMandatoryDescription
videoStringYesThe video file to convert. Binary file upload.
sizeStringNoOutput dimensions as WIDTHxHEIGHT with even integers, for example 320x240.
speedStringNoInteger from -10 to 10; negative values slow the video down, positive values speed it up, and 0 is normal speed.
durationStringNoClip length in seconds. Maximum 20. Default is 2.
start_timeStringNoSeek offset in seconds. Default is 0.

Response

Returns a JSON object with a required job_id string field formatted as a UUID. This is the job identifier you use for status polling.

ParameterTypeMandatoryDescription
job_idStringYesJob identifier for status polling.

Notes

This endpoint kicks off an async job and returns immediately with a job identifier; the actual work runs in the background. Pair this call with the corresponding job_check endpoint — poll that until the status reaches a terminal state to retrieve the result. Extract the job_id field from the response.

Query parameters

Name
Type
Description
persistentOPTIONAL
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 03 / 03
GET
Check GIF conversion job status
http://localhost:8080/apyhub/generate-gif-from-video/jobs/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of a GIF generation job by its job_id.

curl -X GET "http://localhost:8080/apyhub/generate-gif-from-video/jobs/:job_id/$JOB_ID" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with a data object. data may include job_id (string), status (pending, successful, or failed), message (string status detail), and url (string URL to the output GIF when the job is successful).

{
  "data": {
    "job_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "successful",
    "url": "https://assets.apyhub.com/samples/output.gif"
  }
}
TRY ITLIVE · 5 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.

About this endpoint

What it does

Checks the status of a GIF conversion job by job ID and returns the job’s current state in a JSON object. When the job is successful, the response can include the output GIF URL.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesJob identifier in UUID format.

Response

Returns a JSON object with a data object field. The data object can include job_id (string UUID), status (string enum), url (string URI), and message (string), depending on the job state.

AttributeTypeMandatoryDescription
dataObjectYesContainer for the job status payload.
data.job_idStringNoJob identifier in UUID format.
data.statusENUMNoJob status. Allowed values: pending, successful, failed. pending while submitted or processing; successful when output is ready; failed when the worker marked the job failed.
data.urlStringNoPresigned or CDN URL to the output GIF. Present when status is successful. URI format.
data.messageStringNoHuman-readable status detail. Present on pending or failed responses.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ 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.