# YouTube Clipping API

> Cut a long YouTube video into 1 to 8 captioned vertical clips with one API call, with optional hook overlay and split-screen gameplay.

- Canonical page: https://www.autofeed.ai/video-api/youtube-clips
- API reference: https://www.autofeed.ai/docs/api
- Publisher: AutoFeed.ai (https://www.autofeed.ai)

Send a YouTube link. AutoFeed picks the strongest moments, cuts them into captioned clips with an optional hook and split-screen, and returns a list of files.

- 1 to 8 clips per job
- Captions, an optional hook overlay and optional split-screen gameplay
- Aspect ratios 9:16, 16:9, 1:1
- Returns clipUrls, a list, instead of a single url

## Example request

Costs 6,500 credits, the same as in the dashboard.

```bash
curl -X POST https://www.autofeed.ai/api/v1/videos \
  -H "Authorization: Bearer $AUTOFEED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "yt_clips",
    "input": {
      "youtubeUrl": "https://www.youtube.com/watch?v=aqz-KE-bpKQ",
      "clipCount": 5,
      "enableHook": true,
      "format": "9:16"
    },
    "webhookUrl": "https://example.com/webhooks/autofeed",
    "idempotencyKey": "order-1042-youtube-clips"
  }'
```

202 Accepted:

```json
{
  "id": "1c9d6c3e-1f5b-4d2e-9c31-2b8b0f0f9a11",
  "type": "yt_clips",
  "status": "processing",
  "costInCredits": 6500,
  "createdAt": "2026-11-02T12:00:00.000Z"
}
```

`video.completed` webhook body:

```json
{
  "id": "1c9d6c3e-1f5b-4d2e-9c31-2b8b0f0f9a11",
  "type": "yt_clips",
  "status": "completed",
  "error": null,
  "costInCredits": 6500,
  "createdAt": "2026-11-02T12:00:00.000Z",
  "completedAt": "2026-11-02T12:03:41.000Z",
  "url": null,
  "clipUrls": [
    "https://.../1c9d6c3e-1f5b-4d2e-9c31-2b8b0f0f9a11/clip-1.mp4",
    "https://.../1c9d6c3e-1f5b-4d2e-9c31-2b8b0f0f9a11/clip-2.mp4",
    "https://.../1c9d6c3e-1f5b-4d2e-9c31-2b8b0f0f9a11/clip-3.mp4",
    "https://.../1c9d6c3e-1f5b-4d2e-9c31-2b8b0f0f9a11/clip-4.mp4",
    "https://.../1c9d6c3e-1f5b-4d2e-9c31-2b8b0f0f9a11/clip-5.mp4"
  ]
}
```

## Input fields

| Field | Type | Default | Notes |
|---|---|---|---|
| `youtubeUrl` (required) | string (max 2048) | - | Required. A public YouTube video URL. |
| `clipCount` | integer 1-8 | 5 | Price-bearing: each clip adds credits. |
| `captionStyle` | one of 14 values | "YouTuber" |  |
| `customCaptions` | object | - |  |
| `format` | "9:16" \| "16:9" \| "1:1" | "9:16" |  |
| `enableHook` | boolean | true |  |
| `hookSeconds` | number 2-10 \| "full" | 5 | How long the hook overlay stays up, or "full" for the whole clip. |
| `hookStyle` | object | preset |  |
| `swapPanels` | boolean | true |  |
| `clipDuration` | "Under 30 seconds" \| "30 to 45 seconds" \| "45 to 60 seconds" \| "60 to 90 seconds" | "30 to 45 seconds" |  |
| `captionSize` | "Small" \| "Medium" \| "Large" | "Medium" |  |
| `captionPosition` | "Top" \| "Center" \| "Bottom" | "Bottom" |  |
| `videoFit` | "Cover (crop to fill)" \| "Contain (show full video)" | "Contain (show full video)" |  |
| `splitScreen` | boolean | false |  |
| `splitScreenBackground` | "Random" \| "Minecraft" \| "GTA V" \| "Subway Surfers" \| "Fortnite" \| "Satisfying" | "Random" | A gameplay pool for split screen, or the random option to pick one per clip. |

Included with Ultimate. Rendered files are kept for 14 days.

## Frequently asked questions

### Why is url null on a finished clipping job?

Because one job makes several videos. A finished yt_clips generation carries the files in clipUrls and leaves url null, so a client that only reads url must handle this type separately.

### Does the price depend on the video length?

No. Like the dashboard, the API prices a clipping job against a fixed 30-minute estimate plus a per-clip charge, so the cost is known before the video is fetched.

### How is a clipping job billed?

From the same credit balance as the dashboard, at the same price per video. The cost is in the 202 response before any work starts, and a failed render refunds it.
