---
title: "Video to GIF API: Convert Video Clips to Animated GIFs"
slug: generate-gif
url: https://apyhub.com/apyhub/service/generate-gif
provider: ApyHub
categories: [Media Kit]
tags: [gif-conversion, video-to-gif, video-processing, file-conversion, file-manipulation]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 4
atoms: 550
mcp: true
alias: gif-from-video
---

# Video to GIF API: Convert Video Clips to Animated GIFs

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. Try it free.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/generate-gif/multi-part/download` | What it does Generates a GIF from an uploaded video file and returns the result as a streamed binar… | 550 |
| POST | `https://api.eu.apyhub.com/apyhub/generate-gif/multi-part/link` | What it does Creates a GIF from an uploaded video file and returns a time-limited signed URL to dow… | 550 |
| POST | `https://api.eu.apyhub.com/apyhub/generate-gif/url/download` | What it does Generates a GIF from a remotely hosted video file and returns it as a streamed binary… | 550 |
| POST | `https://api.eu.apyhub.com/apyhub/generate-gif/url/link` | What it does Generates a GIF from a publicly accessible remote video URL and returns a signed downl… | 550 |

## Endpoint reference

### Generate GIF from uploaded video and stream download

`POST https://api.eu.apyhub.com/apyhub/generate-gif/multi-part/download` · 550 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Output dimensions WxH. Omit to keep original size. Example: `320x240`. |
| `speed` | body | integer | no | Playback speed. 0 = normal; positive = faster (1/n PTS); negative = slower (abs(n) PTS). Default: `0`. |
| `video` | body | string (binary) | yes | Video file (.mp4 .mkv .avi .mov .flv .3gp .webm). |
| `duration` | body | integer | no | Clip length in seconds (capped at 20). Default: `2`. |
| `start_time` | body | integer | no | Seek offset in seconds. Default: `0`. |

#### Quickstart

Upload a video to generate a GIF from it.

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

### Generate GIF from uploaded video and return signed link

`POST https://api.eu.apyhub.com/apyhub/generate-gif/multi-part/link` · 550 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Output dimensions WxH. Omit to keep original size. Example: `320x240`. |
| `speed` | body | integer | no | Playback speed. 0 = normal; positive = faster (1/n PTS); negative = slower (abs(n) PTS). Default: `0`. |
| `video` | body | string (binary) | yes | Video file (.mp4 .mkv .avi .mov .flv .3gp .webm). |
| `duration` | body | integer | no | Clip length in seconds (capped at 20). Default: `2`. |
| `start_time` | body | integer | no | Seek offset in seconds. Default: `0`. |

#### Quickstart

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

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

```json
{
  "data": "https://storage.example.com/gif/output.gif?sig=abc"
}
```

### Generate GIF from remote video URL and stream download

`POST https://api.eu.apyhub.com/apyhub/generate-gif/url/download` · 550 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Output dimensions WxH. Omit to keep original size. Example: `320x240`. |
| `speed` | body | string | no | Playback speed. 0 = normal; positive = faster; negative = slower. Default: `0`. |
| `duration` | body | string | no | Clip length in seconds (capped at 20). Default: `2`. |
| `video_url` | body | string (uri) | yes | Publicly accessible URL of the source video. Example: `https://assets.apyhub.com/samples/sample.mp4`. |
| `start_time` | body | string | no | Seek offset in seconds. Default: `0`. |

#### Quickstart

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

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

### Generate GIF from remote video URL and return signed link

`POST https://api.eu.apyhub.com/apyhub/generate-gif/url/link` · 550 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Output dimensions WxH. Omit to keep original size. Example: `320x240`. |
| `speed` | body | string | no | Playback speed. 0 = normal; positive = faster; negative = slower. Default: `0`. |
| `duration` | body | string | no | Clip length in seconds (capped at 20). Default: `2`. |
| `video_url` | body | string (uri) | yes | Publicly accessible URL of the source video. Example: `https://assets.apyhub.com/samples/sample.mp4`. |
| `start_time` | body | string | no | Seek offset in seconds. Default: `0`. |

#### Quickstart

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

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

```json
{
  "data": "https://storage.example.com/gif/output.gif?sig=abc"
}
```

## About

## What it does

The Video to GIF API converts MP4, MOV, WebM and other video files into animated GIFs in a single request. Upload a video or send the URL of one hosted elsewhere, and get the GIF back straight away, either as a file download or as a signed link.

It accepts `.mp4`, `.mov`, `.webm`, `.mkv`, `.avi`, `.flv` and `.3gp` files up to 100 MB. There are four endpoints, so you can pick the input and output that fit your code: upload a file or send a `video_url`, and choose `/download` to get the GIF file in the response or `/link` to get a time-limited signed URL to it.

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`, or leave it out to keep the original size. Use `speed` to slow the clip down with values down to `-10` or speed it up with values up to `10`.

Common uses include product demo loops for landing pages, social media previews, animated snippets for documentation and emails, and short reactions cut from longer videos.

If you are converting many videos or running inside a background worker, use the [Generate GIF from Video Job API](https://apyhub.com/apyhub/service/generate-gif-from-video), which returns a job ID straight away and lets you fetch the GIF when it is ready. For a still image from a video instead of an animation, use the [Video Thumbnail API](https://apyhub.com/apyhub/service/generate-video-thumbnail).

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
