---
title: Trim Video Clip API
slug: trim-video
url: https://apyhub.com/apyhub/service/trim-video
provider: ApyHub
categories: [File Conversion, File Manipulation]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 4
atoms: 550
mcp: true
alias: video-thumbnail
---

# Trim Video Clip API

Trim a short clip from an uploaded video or a remote video URL. Returns binary output or a signed link for previews, samples, and social cuts.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/trim-video/file/download` | What it does Trims a segment from an uploaded video file and streams the resulting download back as… | 550 |
| POST | `https://api.eu.apyhub.com/apyhub/trim-video/file/link` | What it does Trims a short clip from an uploaded video and returns a signed URL to the generated fi… | 550 |
| POST | `https://api.eu.apyhub.com/apyhub/trim-video/url/download` | What it does Trims a video clip from a remote URL and streams the resulting file as a binary downlo… | 550 |
| POST | `https://api.eu.apyhub.com/apyhub/trim-video/url/link` | What it does Creates a trimmed video clip from a remote video URL and returns a signed URI for the… | 550 |

## Endpoint reference

### Trim video clip from upload and stream download

`POST https://api.eu.apyhub.com/apyhub/trim-video/file/download` · 550 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Output scale WxH with even width and height. Omit to keep source dimensions. Example: `640x360`. |
| `video` | body | string (binary) | yes | Video file (.mp4 .mkv .avi .mov .flv .3gp .webm). Max 500 MiB. |
| `duration` | body | integer | no | Default: `2`. Example: `4`. |
| `start_time` | body | integer | no | Default: `0`. Example: `5`. |

#### Quickstart

Upload a video and get back the trimmed clip as a binary file.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/trim-video/file/download" \
  -H "apy-token: $APY_TOKEN" \
  -F "video=@/path/to/video.mp4"
```

#### What you'll get back

Returns a binary file response (`string` with `format: binary`), not JSON.

```text
(binary video clip)
```

### Trim video clip from upload and return signed link

`POST https://api.eu.apyhub.com/apyhub/trim-video/file/link` · 550 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Example: `480x270`. |
| `video` | body | string (binary) | yes |  |
| `duration` | body | integer | no | Default: `2`. |
| `start_time` | body | integer | no | Default: `0`. |

#### Quickstart

Upload a video file to trim a clip and get back a signed link.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/trim-video/file/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 URI to the generated video clip.

```json
{
  "data": "https://storage.example.com/video-clips/clip.mp4?sig=abc"
}
```

### Trim video clip from remote URL and stream download

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Example: `640x360`. |
| `duration` | body | string | no | Default: `2`. Example: `4`. |
| `video_url` | body | string (uri) | yes | Example: `https://assets.apyhub.com/samples/sample.mp4`. |
| `start_time` | body | string | no | Default: `0`. Example: `5`. |

#### Quickstart

Send a video URL to trim a clip from the video.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/trim-video/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 the trimmed video clip as a binary file response.

```bash
(binary file)
```

### Trim video clip from remote URL and return signed link

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

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `size` | body | string | no | Example: `640x360`. |
| `duration` | body | string | no | Default: `2`. Example: `4`. |
| `video_url` | body | string (uri) | yes | Example: `https://assets.apyhub.com/samples/sample.mp4`. |
| `start_time` | body | string | no | Default: `0`. Example: `5`. |

#### Quickstart

Trim a clip from a video URL by sending the video link in the request body.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/trim-video/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 URI for the trimmed video clip.

```json
{
  "data": "https://storage.example.com/video-clips/clip.mp4?sig=abc"
}
```

## About

## What it does
Video Clip Trimmer cuts a short clip from a video file or a remote video URL and returns the clip as either a streamed download or a signed link. Send a source video, choose a start time and duration, and optionally set the output size to control the clip dimensions.

Use the file-based endpoints when you already have the video in hand, or the URL-based endpoints when the source lives elsewhere. For uploaded videos, the service accepts a binary video file in .mp4, .mkv, .avi, .mov, .flv, .3gp, or .webm format up to 500 MiB. For remote sources, provide a video_url. In both cases, you can set start_time, duration, and size.

The response depends on the endpoint you choose: stream the clip back as binary data, or receive a JSON object with a data field containing a signed URI. That makes it useful for generating previews in content workflows, embedding short samples in product pages, or extracting a specific segment from longer footage without handling video processing yourself.

The output is a video clip, not a still image. If you need a single frame, use the Generate Thumbnail from Video Job API instead.

If you need a compact video snippet from an upload or a hosted asset, Video Clip Trimmer keeps the interface simple and the output predictable.

## 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/trim-video
