---
title: Generate GIF from Video Job API
slug: generate-gif-from-video
url: https://apyhub.com/apyhub/service/generate-gif-from-video
provider: ApyHub
categories: [Media Kit]
tags: [video-conversion, gif-generation, media-processing, async-jobs, video-to-gif]
auth: api_key
version: 1.1
service_type: job
endpoints: 3
atoms: 5-400
mcp: true
alias: job-gif-from-video
---

# Generate GIF from Video Job API

Turn MP4, MOV, WebM and other videos into animated GIFs from a file or URL. Pick the clip, size and speed, and get the GIF back in the same request.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/generate-gif-from-video/url-to-json` | What it does Submits a video-to-GIF conversion job using a source video URL and returns a job ident… | 400 |
| POST | `https://api.eu.apyhub.com/apyhub/generate-gif-from-video/file-to-json` | What it does Submits a video file to start an async job that generates a GIF from the uploaded vide… | 400 |
| GET | `https://api.eu.apyhub.com/apyhub/generate-gif-from-video/jobs/:job_id` | What it does Checks the status of a GIF conversion job by job ID and returns the job’s current stat… | 5 |

## Endpoint reference

### Submit video-to-GIF job 

`POST https://api.eu.apyhub.com/apyhub/generate-gif-from-video/url-to-json` · 400 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Output dimensions WIDTHxHEIGHT (even integers, e.g. 320x240). |
| `speed` | body | string | no | Integer -10…10; negative = slow motion, positive = fast forward, 0 = normal. |
| `duration` | body | string | no | Clip length in seconds; capped at 20. Default 2. |
| `video_url` | body | string (uri) | yes | Publicly accessible URL of the video to convert. Mandatory. Example: `https://assets.apyhub.com/samples/sample.mp4`. |
| `start_time` | body | string | no | Seek offset in seconds. Default 0. |
| `persistent` | query | boolean | no |  |

#### Quickstart

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

```bash
curl -X POST "https://api.eu.apyhub.com/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.

```json
{
  "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

### Submit video-to-GIF job

`POST https://api.eu.apyhub.com/apyhub/generate-gif-from-video/file-to-json` · 400 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Output dimensions WIDTHxHEIGHT (even integers, e.g. 320x240). |
| `speed` | body | string | no | Integer -10…10; negative = slow motion, positive = fast forward, 0 = normal. |
| `video` | body | string (binary) | yes | The video file to convert. Mandatory. |
| `duration` | body | string | no | Clip length in seconds; capped at 20. Default 2. |
| `start_time` | body | string | no | Seek offset in seconds. Default 0. |
| `persistent` | query | boolean | no |  |

#### Quickstart

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

```bash
curl -X POST "https://api.eu.apyhub.com/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.

```json
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000"
}
```

### Check GIF conversion job status

`GET https://api.eu.apyhub.com/apyhub/generate-gif-from-video/jobs/:job_id` · 5 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `job_id` | path | string (uuid) | yes |  |

#### Quickstart

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

```bash
curl -X GET "https://api.eu.apyhub.com/apyhub/generate-gif-from-video/jobs/: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`).

```json
{
  "data": {
    "job_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "successful",
    "url": "https://assets.apyhub.com/samples/output.gif"
  }
}
```

## About

## What it does

The Generate GIF from Video Job API converts a video, such as an MP4, into an animated GIF as a background job. Submit the video, get a `job_id` back straight away, and fetch the finished GIF when it is ready. Your application never has to hold a request open while the video is processed.

It works in three steps:

1. **Submit the video.** Send a public `video_url` to `/url-to-json`, or upload the file to `/file-to-json` (up to 100 MB). Both return a `job_id`.
2. **Poll the job.** Call `GET /jobs/:job_id` no more than once per second. The `status` is `pending` while the GIF is being made, then `successful` or `failed`, with a `message` explaining any failure.
3. **Download the GIF.** When the status is `successful`, the response includes a `url` to the finished GIF.

You control which part of the video becomes the GIF. Set `start_time` to the second where the clip should begin and `duration` to its length, from the default of 2 seconds up to 20. Use `size` to resize the output, for example `480x270` (both numbers must be even), and `speed` to slow the clip down with values down to `-10` or speed it up with values up to `10`.

The job pattern suits work that runs outside a user request: converting uploads in a background worker, processing a batch of videos from a queue, or generating GIFs from serverless functions with short time limits. Common results include product demo loops, social media previews, animated snippets for docs and emails, and short reactions cut from longer videos.

If you would rather get the GIF back in the same request, use the [Video to GIF API](https://apyhub.com/apyhub/service/generate-gif). For a still image from a video instead of an animation, use the [Generate Video Thumbnail Job API](https://apyhub.com/apyhub/service/generate-video-thumbnail-job), and to brand your videos, see the [Generate Watermark for Videos Job API](https://apyhub.com/apyhub/service/generate-video-watermark).

You can try it right here in the playground. Start for free with 5 API calls a day, no card required, and convert your own video before you commit.

The API is also available through [ApyHub MCP](https://apyhub.com/mcp), so AI agents can turn a video into a GIF directly as part of a larger workflow.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

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