{
  "data": {
    "id": "7MucuI4BLsegk8aKi",
    "actId": "XtdHFubJRRIccMx6c",
    "userId": "tnBVjt3CXmcUrEE3L",
    "startedAt": "2026-11-29T05:56:20.774Z",
    "finishedAt": "2026-11-29T05:57:11.512Z",
    "status": "SUCCEEDED",
    "meta": {
      "origin": "CI"
    },
    "inputSchema": "{\n  \"title\": \"Twitch Clip & Highlight MP4 Downloader\",\n  \"type\": \"object\",\n  \"schemaVersion\": 1,\n  \"properties\": {\n    \"mode\": {\n      \"title\": \"What to collect\",\n      \"type\": \"string\",\n      \"description\": \"Choose clip URLs or slugs, channel top clips, category top clips, or highlight IDs. Each mode reads its own list field below.\",\n      \"editor\": \"select\",\n      \"enum\": [\n        \"byUrls\",\n        \"byChannels\",\n        \"byCategories\",\n        \"byHighlightIds\"\n      ],\n      \"enumTitles\": [\n        \"Clip URLs or slugs\",\n        \"Top clips from channels\",\n        \"Top clips from categories\",\n        \"Highlights by ID or URL\"\n      ],\n      \"default\": \"byUrls\",\n      \"prefill\": \"byUrls\",\n      \"sectionCaption\": \"Twitch clips and highlights\",\n      \"sectionDescription\": \"Collect clips by URL, from a channel or category ranking, or resolve highlight videos. Downloads are optional; the default returns signed media URLs and metadata.\"\n    },\n    \"clipUrls\": {\n      \"title\": \"Clip URLs or slugs\",\n      \"type\": \"array\",\n      \"description\": \"Used by the clip URL mode. Paste twitch.tv/<channel>/clip/<slug>, clips.twitch.tv/<slug>, or bare slugs.\",\n      \"editor\": \"stringList\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"default\": [],\n      \"prefill\": [\n        \"https://www.twitch.tv/xqc/clip/EagerMagnificentOpossumRaccAttack-Z_1cH-jBbf9w3u7C\"\n      ]\n    },\n    \"channelLogins\": {\n      \"title\": \"Channel logins or URLs\",\n      \"type\": \"array\",\n      \"description\": \"Used by the channel mode. Twitch channel logins or channel URLs; top clips are read for the selected period and sort order.\",\n      \"editor\": \"stringList\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"default\": [],\n      \"prefill\": []\n    },\n    \"categoryNames\": {\n      \"title\": \"Category names, slugs or URLs\",\n      \"type\": \"array\",\n      \"description\": \"Used by the category mode. Examples: Just Chatting, grand-theft-auto-v, or a twitch.tv/directory/category/... URL.\",\n      \"editor\": \"stringList\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"default\": [],\n      \"prefill\": []\n    },\n    \"highlightIds\": {\n      \"title\": \"Highlight IDs or URLs\",\n      \"type\": \"array\",\n      \"description\": \"Used by the highlight mode. Numeric highlight IDs or twitch.tv/videos/<id> URLs. Past broadcasts and uploads are rejected.\",\n      \"editor\": \"stringList\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"default\": [],\n      \"prefill\": []\n    },\n    \"quality\": {\n      \"title\": \"Download quality\",\n      \"type\": \"string\",\n      \"description\": \"Source picks the best available tier. Twitch clip sources top out at 1080p without login; if the exact tier is missing, the nearest available tier is used and marked as a fallback.\",\n      \"editor\": \"select\",\n      \"enum\": [\n        \"source\",\n        \"1080\",\n        \"720\",\n        \"480\",\n        \"360\"\n      ],\n      \"enumTitles\": [\n        \"Source / best available\",\n        \"1080p\",\n        \"720p\",\n        \"480p\",\n        \"360p\"\n      ],\n      \"default\": \"source\",\n      \"prefill\": \"source\",\n      \"sectionCaption\": \"Download and output options\"\n    },\n    \"saveToKeyValueStore\": {\n      \"title\": \"Save MP4 files to the key-value store\",\n      \"type\": \"boolean\",\n      \"description\": \"Off by default: return signed source URLs and metadata only. On: download each clip or highlight as MP4 and add a public key-value-store download URL.\",\n      \"default\": false,\n      \"prefill\": false\n    },\n    \"maxFileSizeMB\": {\n      \"title\": \"Maximum file size (MB)\",\n      \"type\": \"integer\",\n      \"description\": \"Clips and highlights larger than this are not downloaded. Their metadata and signed source URL are still returned with a skipped status.\",\n      \"default\": 500,\n      \"prefill\": 500,\n      \"minimum\": 1,\n      \"maximum\": 2048\n    },\n    \"maxHighlightDurationSeconds\": {\n      \"title\": \"Maximum highlight length to download (seconds)\",\n      \"type\": \"integer\",\n      \"description\": \"Highlights longer than this are not downloaded; metadata and the signed HLS URL are still returned. Has no effect on clips.\",\n      \"default\": 600,\n      \"prefill\": 600,\n      \"minimum\": 1,\n      \"maximum\": 3600\n    },\n    \"includeThumbnail\": {\n      \"title\": \"Include thumbnail URLs\",\n      \"type\": \"boolean\",\n      \"description\": \"Add a direct thumbnail image URL to every clip and highlight record.\",\n      \"default\": true,\n      \"prefill\": true\n    },\n    \"period\": {\n      \"title\": \"Clip period\",\n      \"type\": \"string\",\n      \"description\": \"Time window for channel and category rankings. Clip URL and highlight modes ignore it.\",\n      \"editor\": \"select\",\n      \"enum\": [\n        \"LAST_DAY\",\n        \"LAST_WEEK\",\n        \"LAST_MONTH\",\n        \"ALL_TIME\"\n      ],\n      \"enumTitles\": [\n        \"Last 24 hours\",\n        \"Last 7 days\",\n        \"Last 30 days\",\n        \"All time\"\n      ],\n      \"default\": \"LAST_WEEK\",\n      \"prefill\": \"LAST_WEEK\",\n      \"sectionCaption\": \"Ranking and filters\"\n    },\n    \"sort\": {\n      \"title\": \"Ranking order\",\n      \"type\": \"string\",\n      \"description\": \"Most viewed first, or Twitch's trending order. Applies to channel and category modes.\",\n      \"editor\": \"select\",\n      \"enum\": [\n        \"VIEWS_DESC\",\n        \"TRENDING\"\n      ],\n      \"enumTitles\": [\n        \"Most viewed\",\n        \"Trending\"\n      ],\n      \"default\": \"VIEWS_DESC\",\n      \"prefill\": \"VIEWS_DESC\"\n    },\n    \"language\": {\n      \"title\": \"Broadcast language\",\n      \"type\": \"string\",\n      \"description\": \"Keep only clips in this broadcast language. Leave on (any) for no language filter.\",\n      \"editor\": \"select\",\n      \"enum\": [\n        \"\",\n        \"EN\",\n        \"ES\",\n        \"DE\",\n        \"FR\",\n        \"PT\",\n        \"RU\",\n        \"JA\",\n        \"KO\",\n        \"ZH\",\n        \"IT\",\n        \"TR\",\n        \"PL\",\n        \"AR\",\n        \"TH\",\n        \"ID\",\n        \"VI\",\n        \"NL\",\n        \"SV\",\n        \"FI\",\n        \"DA\",\n        \"NO\",\n        \"CS\",\n        \"HU\",\n        \"EL\",\n        \"RO\",\n        \"BG\",\n        \"UK\",\n        \"HE\",\n        \"MS\",\n        \"TL\",\n        \"ASL\",\n        \"OTHER\"\n      ],\n      \"enumTitles\": [\n        \"(any)\",\n        \"English (EN)\",\n        \"Spanish (ES)\",\n        \"German (DE)\",\n        \"French (FR)\",\n        \"Portuguese (PT)\",\n        \"Russian (RU)\",\n        \"Japanese (JA)\",\n        \"Korean (KO)\",\n        \"Chinese (ZH)\",\n        \"Italian (IT)\",\n        \"Turkish (TR)\",\n        \"Polish (PL)\",\n        \"Arabic (AR)\",\n        \"Thai (TH)\",\n        \"Indonesian (ID)\",\n        \"Vietnamese (VI)\",\n        \"Dutch (NL)\",\n        \"Swedish (SV)\",\n        \"Finnish (FI)\",\n        \"Danish (DA)\",\n        \"Norwegian (NO)\",\n        \"Czech (CS)\",\n        \"Hungarian (HU)\",\n        \"Greek (EL)\",\n        \"Romanian (RO)\",\n        \"Bulgarian (BG)\",\n        \"Ukrainian (UK)\",\n        \"Hebrew (HE)\",\n        \"Malay (MS)\",\n        \"Tagalog (TL)\",\n        \"American Sign Language (ASL)\",\n        \"Other\"\n      ],\n      \"default\": \"\",\n      \"prefill\": \"\"\n    },\n    \"minViews\": {\n      \"title\": \"Minimum views\",\n      \"type\": \"integer\",\n      \"description\": \"Skip clips below this view count. Set to 0 to keep every clip.\",\n      \"default\": 0,\n      \"prefill\": 0,\n      \"minimum\": 0,\n      \"maximum\": 100000000\n    },\n    \"createdAfter\": {\n      \"title\": \"Created on or after\",\n      \"type\": \"string\",\n      \"description\": \"Optional YYYY-MM-DD date. Older clips are skipped in channel and category modes.\",\n      \"editor\": \"datepicker\"\n    },\n    \"createdBefore\": {\n      \"title\": \"Created on or before\",\n      \"type\": \"string\",\n      \"description\": \"Optional YYYY-MM-DD date. Newer clips are skipped in channel and category modes.\",\n      \"editor\": \"datepicker\"\n    },\n    \"maxItems\": {\n      \"title\": \"Maximum clips or highlights\",\n      \"type\": \"integer\",\n      \"description\": \"Stop after this many successful records (1-1000). Invalid inputs still produce error rows. Twitch caps channel and category rankings at about 1,000 clips per period.\",\n      \"default\": 20,\n      \"prefill\": 1,\n      \"minimum\": 1,\n      \"maximum\": 1000\n    }\n  },\n  \"required\": []\n}",
    "readme": "# Twitch Clip & Highlight MP4 Downloader\n\nSave Twitch clips and short highlights as MP4 files, or collect their metadata and signed media URLs without downloading. Pick clips one by one, pull the top clips from whole channels or categories, and resolve highlight IDs — all without a Twitch login, API key or cookie.\n\nBuilt for editors, stream teams, community managers and archivists who need a repeatable batch, not a one-off browser button.\n\n## What you get\n\n- **One row per clip or highlight** with title, channel, clipper, category, language, views, duration, creation date and source VOD details.\n- **Signed MP4 or HLS URL** ready for your own downloader, plus its expiry time.\n- **Optional MP4 download** into the run's key-value store, with a public download URL, file name and byte size.\n- **Quality control** from source/1080p down to 360p, with an honest fallback flag when the exact tier is unavailable.\n- **Size and duration guards** so a long highlight or oversized clip never silently blows up storage or bandwidth.\n- **Clear error rows** for bad URLs, missing clips, unknown channels or categories, and non-highlight video IDs.\n\n## Modes\n\n| Mode | What it reads | Best for |\n|---|---|---|\n| Clip URLs or slugs | `clipUrls` | A known list of clips from a spreadsheet or another tool |\n| Top clips from channels | `channelLogins` | Archiving a streamer's best recent clips |\n| Top clips from categories | `categoryNames` | Finding what is popping in a game or category |\n| Highlights by ID or URL | `highlightIds` | Saving a curated highlight reel |\n\nChannel and category modes support **last 24 hours, 7 days, 30 days or all time**, **most viewed** or **trending** ordering, and client-side filters for minimum views, language and creation date. Pagination continues until `maxItems` or the source runs out.\n\n## Input\n\n| Field | Type | Default | Notes |\n|---|---|---|---|\n| `mode` | select | `byUrls` | `byUrls`, `byChannels`, `byCategories` or `byHighlightIds` |\n| `clipUrls` | string list | empty | Twitch clip URLs, `clips.twitch.tv` links, or bare slugs |\n| `channelLogins` | string list | empty | Channel logins or channel URLs |\n| `categoryNames` | string list | empty | Category names, slugs or directory URLs |\n| `highlightIds` | string list | empty | Numeric highlight IDs or `twitch.tv/videos/<id>` URLs |\n| `quality` | select | `source` | `source`, `1080`, `720`, `480`, `360` |\n| `saveToKeyValueStore` | boolean | `false` | Off = signed URLs and metadata; on = download MP4 |\n| `maxFileSizeMB` | integer | `500` | Skip downloads above this size (1–2048) |\n| `maxHighlightDurationSeconds` | integer | `600` | Skip highlights longer than this (1–3600) |\n| `includeThumbnail` | boolean | `true` | Add a thumbnail image URL to each record |\n| `period` | select | `LAST_WEEK` | Last day, week, month or all time |\n| `sort` | select | `VIEWS_DESC` | Most viewed or trending |\n| `language` | select | `(any)` | Broadcast language filter |\n| `minViews` | integer | `0` | Drop clips below this view count |\n| `createdAfter` / `createdBefore` | date | empty | Optional creation-date window |\n| `maxItems` | integer | `20` | Stop after this many successful records (1–1000) |\n\n## Output\n\n| Field | Description |\n|---|---|\n| `recordType` | `clip`, `highlight` or `error` |\n| `slug`, `clipId` | Twitch clip identifiers |\n| `highlightId` | Numeric highlight/video identifier |\n| `title`, `url`, `embedUrl` | Clip or highlight page links |\n| `channelLogin`, `channelDisplayName` | Broadcaster |\n| `creatorLogin`, `creatorDisplayName` | Clipper (clips only) |\n| `gameId`, `gameName`, `gameSlug` | Category |\n| `language`, `viewCount`, `durationSeconds`, `createdAt` | Core metadata |\n| `sourceVideoId`, `sourceVideoTitle`, `sourceVideoBroadcastType`, `sourceVideoOffsetSeconds` | Source VOD details when Twitch still exposes them |\n| `qualityRequested`, `quality`, `qualityLabel`, `resolution`, `frameRate`, `qualityFallback` | Delivered quality details |\n| `availableQualities` | Tiers that were actually available |\n| `sourceUrl`, `sourceUrlType`, `sourceUrlExpiresAt` | Signed MP4 (`mp4`) or HLS (`hls`) URL and expiry |\n| `thumbnailUrl` | Thumbnail image URL when `includeThumbnail` is on |\n| `fileSizeBytes` | Source size for clips; downloaded size when a file was saved |\n| `estimatedFileSizeBytes` | Pre-download estimate for highlights |\n| `downloadStatus` | `notRequested`, `downloaded`, `skipped` or `failed` |\n| `downloadUrl`, `fileName` | Public key-value-store link and object key |\n| `downloadSkippedReason`, `downloadError` | Why a download was skipped or failed |\n| `errorType`, `errorMessage`, `input` | Error-row details |\n\nEmpty values are omitted. Zero views and `false` booleans are kept.\n\n## Examples\n\n### Download three clips by URL\n\n```json\n{\n  \"mode\": \"byUrls\",\n  \"clipUrls\": [\n    \"https://www.twitch.tv/xqc/clip/EagerMagnificentOpossumRaccAttack-Z_1cH-jBbf9w3u7C\",\n    \"https://clips.twitch.tv/TrustworthyDeterminedSnakeSuperVinlin-3AJn_BZG9QM87A9o\"\n  ],\n  \"quality\": \"720\",\n  \"saveToKeyValueStore\": true,\n  \"maxItems\": 3\n}\n```\n\n### Collect a channel's most viewed clips from the last week\n\n```json\n{\n  \"mode\": \"byChannels\",\n  \"channelLogins\": [\"xqc\", \"summit1g\"],\n  \"period\": \"LAST_WEEK\",\n  \"sort\": \"VIEWS_DESC\",\n  \"minViews\": 500,\n  \"language\": \"EN\",\n  \"maxItems\": 50\n}\n```\n\n### Collect trending clips from a category\n\n```json\n{\n  \"mode\": \"byCategories\",\n  \"categoryNames\": [\"Just Chatting\", \"grand-theft-auto-v\"],\n  \"period\": \"LAST_DAY\",\n  \"sort\": \"TRENDING\",\n  \"maxItems\": 30\n}\n```\n\n### Save a short highlight as MP4\n\n```json\n{\n  \"mode\": \"byHighlightIds\",\n  \"highlightIds\": [\"73558265\"],\n  \"quality\": \"480\",\n  \"saveToKeyValueStore\": true,\n  \"maxHighlightDurationSeconds\": 300,\n  \"maxFileSizeMB\": 100\n}\n```\n\n## How the media options work\n\n- **Signed URL only (default).** Every record gets a `sourceUrl` that works without cookies. Clips are direct MP4 files; highlights are HLS playlists. The link expires in roughly 20 hours; `sourceUrlExpiresAt` tells you exactly when.\n- **Save to key-value store.** The actor downloads the selected quality and stores it under `twitch-clips-<slug>.mp4` or `twitch-highlights-<videoId>.mp4`. `downloadUrl` is the public link. Downloads are sequential and bandwidth-heavy, so keep `maxItems` small.\n- **Quality fallback.** If the requested tier is unavailable, the nearest available tier is delivered and `qualityFallback` is `true`. `availableQualities` lists the real options.\n- **Size guard.** Clips above `maxFileSizeMB` are not downloaded; highlights are skipped when either the duration or the estimated file size exceeds your limits. The record still carries the metadata and signed URL.\n- **Highlights only.** Past broadcasts, live streams and uploads are rejected with a clear error row. Highlights are short VODs and are converted to MP4 with remuxing, not re-encoding.\n\n## Limits\n\n- Twitch caps a channel or category clip ranking at about **1,000 clips per period**. Split by period for more, and use clip URLs for older individual clips.\n- Twitch clip media tops out at **1080p** without a logged-in session. 1440p/2160p are not available to a cookieless actor.\n- Signed URLs expire in about 20 hours; re-run the actor to mint fresh ones.\n- Downloads use the run's key-value store, which follows Apify's run-storage retention (7 days for the default unnamed store). Download or copy the files if you need them longer.\n- A deleted or region-blocked clip can disappear between the ranking request and the media request. It is returned as an error row or with `mediaStatus: unavailable`.\n- Twitch can return a transient `service error` on trending queries; the actor retries with backoff before reporting a query failure.\n\n## FAQ\n\n**Do I need a Twitch account, client ID or cookie?** No. The actor uses Twitch's public web GraphQL and public media CDN. No credentials are read or stored.\n\n**Can I get more than 1,000 clips from one channel?** Not from a single ranking. Use a shorter period or provide exact clip URLs for older clips.\n\n**Why is my highlight download skipped?** Check `downloadSkippedReason`: `maxHighlightDuration` means the highlight is longer than your limit, and `maxFileSize` means it would exceed your size budget. The signed HLS URL is still returned.\n\n**Why is the MP4 larger or smaller than the estimate?** Highlight estimates use the playlist bitrate; the final file size is measured after remuxing.\n\n**Does this download live streams or full past broadcasts?** No. It downloads clips and highlights only.\n\n## Data source and responsible use\n\nData comes from Twitch's public web endpoints. Download and use only content you own or are authorized to save, and follow Twitch's terms and the rights of streamers and clippers.\n",
    "actorDefinition": {
      "actorSpecification": 1,
      "name": "twitch-clip-highlight-mp4-downloader",
      "title": "Twitch Clip & Highlight MP4 Downloader",
      "description": "Download Twitch clips and short highlights as MP4, or return signed source URLs with full clip metadata. Batch by clip URL, channel, category or highlight ID, filter by period, views and language, and cap quality or file size.",
      "version": "1.0",
      "buildTag": "latest",
      "dockerfile": "./Dockerfile",
      "readme": "# Twitch Clip & Highlight MP4 Downloader\n\nSave Twitch clips and short highlights as MP4 files, or collect their metadata and signed media URLs without downloading. Pick clips one by one, pull the top clips from whole channels or categories, and resolve highlight IDs — all without a Twitch login, API key or cookie.\n\nBuilt for editors, stream teams, community managers and archivists who need a repeatable batch, not a one-off browser button.\n\n## What you get\n\n- **One row per clip or highlight** with title, channel, clipper, category, language, views, duration, creation date and source VOD details.\n- **Signed MP4 or HLS URL** ready for your own downloader, plus its expiry time.\n- **Optional MP4 download** into the run's key-value store, with a public download URL, file name and byte size.\n- **Quality control** from source/1080p down to 360p, with an honest fallback flag when the exact tier is unavailable.\n- **Size and duration guards** so a long highlight or oversized clip never silently blows up storage or bandwidth.\n- **Clear error rows** for bad URLs, missing clips, unknown channels or categories, and non-highlight video IDs.\n\n## Modes\n\n| Mode | What it reads | Best for |\n|---|---|---|\n| Clip URLs or slugs | `clipUrls` | A known list of clips from a spreadsheet or another tool |\n| Top clips from channels | `channelLogins` | Archiving a streamer's best recent clips |\n| Top clips from categories | `categoryNames` | Finding what is popping in a game or category |\n| Highlights by ID or URL | `highlightIds` | Saving a curated highlight reel |\n\nChannel and category modes support **last 24 hours, 7 days, 30 days or all time**, **most viewed** or **trending** ordering, and client-side filters for minimum views, language and creation date. Pagination continues until `maxItems` or the source runs out.\n\n## Input\n\n| Field | Type | Default | Notes |\n|---|---|---|---|\n| `mode` | select | `byUrls` | `byUrls`, `byChannels`, `byCategories` or `byHighlightIds` |\n| `clipUrls` | string list | empty | Twitch clip URLs, `clips.twitch.tv` links, or bare slugs |\n| `channelLogins` | string list | empty | Channel logins or channel URLs |\n| `categoryNames` | string list | empty | Category names, slugs or directory URLs |\n| `highlightIds` | string list | empty | Numeric highlight IDs or `twitch.tv/videos/<id>` URLs |\n| `quality` | select | `source` | `source`, `1080`, `720`, `480`, `360` |\n| `saveToKeyValueStore` | boolean | `false` | Off = signed URLs and metadata; on = download MP4 |\n| `maxFileSizeMB` | integer | `500` | Skip downloads above this size (1–2048) |\n| `maxHighlightDurationSeconds` | integer | `600` | Skip highlights longer than this (1–3600) |\n| `includeThumbnail` | boolean | `true` | Add a thumbnail image URL to each record |\n| `period` | select | `LAST_WEEK` | Last day, week, month or all time |\n| `sort` | select | `VIEWS_DESC` | Most viewed or trending |\n| `language` | select | `(any)` | Broadcast language filter |\n| `minViews` | integer | `0` | Drop clips below this view count |\n| `createdAfter` / `createdBefore` | date | empty | Optional creation-date window |\n| `maxItems` | integer | `20` | Stop after this many successful records (1–1000) |\n\n## Output\n\n| Field | Description |\n|---|---|\n| `recordType` | `clip`, `highlight` or `error` |\n| `slug`, `clipId` | Twitch clip identifiers |\n| `highlightId` | Numeric highlight/video identifier |\n| `title`, `url`, `embedUrl` | Clip or highlight page links |\n| `channelLogin`, `channelDisplayName` | Broadcaster |\n| `creatorLogin`, `creatorDisplayName` | Clipper (clips only) |\n| `gameId`, `gameName`, `gameSlug` | Category |\n| `language`, `viewCount`, `durationSeconds`, `createdAt` | Core metadata |\n| `sourceVideoId`, `sourceVideoTitle`, `sourceVideoBroadcastType`, `sourceVideoOffsetSeconds` | Source VOD details when Twitch still exposes them |\n| `qualityRequested`, `quality`, `qualityLabel`, `resolution`, `frameRate`, `qualityFallback` | Delivered quality details |\n| `availableQualities` | Tiers that were actually available |\n| `sourceUrl`, `sourceUrlType`, `sourceUrlExpiresAt` | Signed MP4 (`mp4`) or HLS (`hls`) URL and expiry |\n| `thumbnailUrl` | Thumbnail image URL when `includeThumbnail` is on |\n| `fileSizeBytes` | Source size for clips; downloaded size when a file was saved |\n| `estimatedFileSizeBytes` | Pre-download estimate for highlights |\n| `downloadStatus` | `notRequested`, `downloaded`, `skipped` or `failed` |\n| `downloadUrl`, `fileName` | Public key-value-store link and object key |\n| `downloadSkippedReason`, `downloadError` | Why a download was skipped or failed |\n| `errorType`, `errorMessage`, `input` | Error-row details |\n\nEmpty values are omitted. Zero views and `false` booleans are kept.\n\n## Examples\n\n### Download three clips by URL\n\n```json\n{\n  \"mode\": \"byUrls\",\n  \"clipUrls\": [\n    \"https://www.twitch.tv/xqc/clip/EagerMagnificentOpossumRaccAttack-Z_1cH-jBbf9w3u7C\",\n    \"https://clips.twitch.tv/TrustworthyDeterminedSnakeSuperVinlin-3AJn_BZG9QM87A9o\"\n  ],\n  \"quality\": \"720\",\n  \"saveToKeyValueStore\": true,\n  \"maxItems\": 3\n}\n```\n\n### Collect a channel's most viewed clips from the last week\n\n```json\n{\n  \"mode\": \"byChannels\",\n  \"channelLogins\": [\"xqc\", \"summit1g\"],\n  \"period\": \"LAST_WEEK\",\n  \"sort\": \"VIEWS_DESC\",\n  \"minViews\": 500,\n  \"language\": \"EN\",\n  \"maxItems\": 50\n}\n```\n\n### Collect trending clips from a category\n\n```json\n{\n  \"mode\": \"byCategories\",\n  \"categoryNames\": [\"Just Chatting\", \"grand-theft-auto-v\"],\n  \"period\": \"LAST_DAY\",\n  \"sort\": \"TRENDING\",\n  \"maxItems\": 30\n}\n```\n\n### Save a short highlight as MP4\n\n```json\n{\n  \"mode\": \"byHighlightIds\",\n  \"highlightIds\": [\"73558265\"],\n  \"quality\": \"480\",\n  \"saveToKeyValueStore\": true,\n  \"maxHighlightDurationSeconds\": 300,\n  \"maxFileSizeMB\": 100\n}\n```\n\n## How the media options work\n\n- **Signed URL only (default).** Every record gets a `sourceUrl` that works without cookies. Clips are direct MP4 files; highlights are HLS playlists. The link expires in roughly 20 hours; `sourceUrlExpiresAt` tells you exactly when.\n- **Save to key-value store.** The actor downloads the selected quality and stores it under `twitch-clips-<slug>.mp4` or `twitch-highlights-<videoId>.mp4`. `downloadUrl` is the public link. Downloads are sequential and bandwidth-heavy, so keep `maxItems` small.\n- **Quality fallback.** If the requested tier is unavailable, the nearest available tier is delivered and `qualityFallback` is `true`. `availableQualities` lists the real options.\n- **Size guard.** Clips above `maxFileSizeMB` are not downloaded; highlights are skipped when either the duration or the estimated file size exceeds your limits. The record still carries the metadata and signed URL.\n- **Highlights only.** Past broadcasts, live streams and uploads are rejected with a clear error row. Highlights are short VODs and are converted to MP4 with remuxing, not re-encoding.\n\n## Limits\n\n- Twitch caps a channel or category clip ranking at about **1,000 clips per period**. Split by period for more, and use clip URLs for older individual clips.\n- Twitch clip media tops out at **1080p** without a logged-in session. 1440p/2160p are not available to a cookieless actor.\n- Signed URLs expire in about 20 hours; re-run the actor to mint fresh ones.\n- Downloads use the run's key-value store, which follows Apify's run-storage retention (7 days for the default unnamed store). Download or copy the files if you need them longer.\n- A deleted or region-blocked clip can disappear between the ranking request and the media request. It is returned as an error row or with `mediaStatus: unavailable`.\n- Twitch can return a transient `service error` on trending queries; the actor retries with backoff before reporting a query failure.\n\n## FAQ\n\n**Do I need a Twitch account, client ID or cookie?** No. The actor uses Twitch's public web GraphQL and public media CDN. No credentials are read or stored.\n\n**Can I get more than 1,000 clips from one channel?** Not from a single ranking. Use a shorter period or provide exact clip URLs for older clips.\n\n**Why is my highlight download skipped?** Check `downloadSkippedReason`: `maxHighlightDuration` means the highlight is longer than your limit, and `maxFileSize` means it would exceed your size budget. The signed HLS URL is still returned.\n\n**Why is the MP4 larger or smaller than the estimate?** Highlight estimates use the playlist bitrate; the final file size is measured after remuxing.\n\n**Does this download live streams or full past broadcasts?** No. It downloads clips and highlights only.\n\n## Data source and responsible use\n\nData comes from Twitch's public web endpoints. Download and use only content you own or are authorized to save, and follow Twitch's terms and the rights of streamers and clippers.\n",
      "input": {
        "title": "Twitch Clip & Highlight MP4 Downloader",
        "type": "object",
        "schemaVersion": 1,
        "properties": {
          "mode": {
            "title": "What to collect",
            "type": "string",
            "description": "Choose clip URLs or slugs, channel top clips, category top clips, or highlight IDs. Each mode reads its own list field below.",
            "editor": "select",
            "enum": [
              "byUrls",
              "byChannels",
              "byCategories",
              "byHighlightIds"
            ],
            "enumTitles": [
              "Clip URLs or slugs",
              "Top clips from channels",
              "Top clips from categories",
              "Highlights by ID or URL"
            ],
            "default": "byUrls",
            "prefill": "byUrls",
            "sectionCaption": "Twitch clips and highlights",
            "sectionDescription": "Collect clips by URL, from a channel or category ranking, or resolve highlight videos. Downloads are optional; the default returns signed media URLs and metadata."
          },
          "clipUrls": {
            "title": "Clip URLs or slugs",
            "type": "array",
            "description": "Used by the clip URL mode. Paste twitch.tv/<channel>/clip/<slug>, clips.twitch.tv/<slug>, or bare slugs.",
            "editor": "stringList",
            "items": {
              "type": "string"
            },
            "default": [],
            "prefill": [
              "https://www.twitch.tv/xqc/clip/EagerMagnificentOpossumRaccAttack-Z_1cH-jBbf9w3u7C"
            ]
          },
          "channelLogins": {
            "title": "Channel logins or URLs",
            "type": "array",
            "description": "Used by the channel mode. Twitch channel logins or channel URLs; top clips are read for the selected period and sort order.",
            "editor": "stringList",
            "items": {
              "type": "string"
            },
            "default": [],
            "prefill": []
          },
          "categoryNames": {
            "title": "Category names, slugs or URLs",
            "type": "array",
            "description": "Used by the category mode. Examples: Just Chatting, grand-theft-auto-v, or a twitch.tv/directory/category/... URL.",
            "editor": "stringList",
            "items": {
              "type": "string"
            },
            "default": [],
            "prefill": []
          },
          "highlightIds": {
            "title": "Highlight IDs or URLs",
            "type": "array",
            "description": "Used by the highlight mode. Numeric highlight IDs or twitch.tv/videos/<id> URLs. Past broadcasts and uploads are rejected.",
            "editor": "stringList",
            "items": {
              "type": "string"
            },
            "default": [],
            "prefill": []
          },
          "quality": {
            "title": "Download quality",
            "type": "string",
            "description": "Source picks the best available tier. Twitch clip sources top out at 1080p without login; if the exact tier is missing, the nearest available tier is used and marked as a fallback.",
            "editor": "select",
            "enum": [
              "source",
              "1080",
              "720",
              "480",
              "360"
            ],
            "enumTitles": [
              "Source / best available",
              "1080p",
              "720p",
              "480p",
              "360p"
            ],
            "default": "source",
            "prefill": "source",
            "sectionCaption": "Download and output options"
          },
          "saveToKeyValueStore": {
            "title": "Save MP4 files to the key-value store",
            "type": "boolean",
            "description": "Off by default: return signed source URLs and metadata only. On: download each clip or highlight as MP4 and add a public key-value-store download URL.",
            "default": false,
            "prefill": false
          },
          "maxFileSizeMB": {
            "title": "Maximum file size (MB)",
            "type": "integer",
            "description": "Clips and highlights larger than this are not downloaded. Their metadata and signed source URL are still returned with a skipped status.",
            "default": 500,
            "prefill": 500,
            "minimum": 1,
            "maximum": 2048
          },
          "maxHighlightDurationSeconds": {
            "title": "Maximum highlight length to download (seconds)",
            "type": "integer",
            "description": "Highlights longer than this are not downloaded; metadata and the signed HLS URL are still returned. Has no effect on clips.",
            "default": 600,
            "prefill": 600,
            "minimum": 1,
            "maximum": 3600
          },
          "includeThumbnail": {
            "title": "Include thumbnail URLs",
            "type": "boolean",
            "description": "Add a direct thumbnail image URL to every clip and highlight record.",
            "default": true,
            "prefill": true
          },
          "period": {
            "title": "Clip period",
            "type": "string",
            "description": "Time window for channel and category rankings. Clip URL and highlight modes ignore it.",
            "editor": "select",
            "enum": [
              "LAST_DAY",
              "LAST_WEEK",
              "LAST_MONTH",
              "ALL_TIME"
            ],
            "enumTitles": [
              "Last 24 hours",
              "Last 7 days",
              "Last 30 days",
              "All time"
            ],
            "default": "LAST_WEEK",
            "prefill": "LAST_WEEK",
            "sectionCaption": "Ranking and filters"
          },
          "sort": {
            "title": "Ranking order",
            "type": "string",
            "description": "Most viewed first, or Twitch's trending order. Applies to channel and category modes.",
            "editor": "select",
            "enum": [
              "VIEWS_DESC",
              "TRENDING"
            ],
            "enumTitles": [
              "Most viewed",
              "Trending"
            ],
            "default": "VIEWS_DESC",
            "prefill": "VIEWS_DESC"
          },
          "language": {
            "title": "Broadcast language",
            "type": "string",
            "description": "Keep only clips in this broadcast language. Leave on (any) for no language filter.",
            "editor": "select",
            "enum": [
              "",
              "EN",
              "ES",
              "DE",
              "FR",
              "PT",
              "RU",
              "JA",
              "KO",
              "ZH",
              "IT",
              "TR",
              "PL",
              "AR",
              "TH",
              "ID",
              "VI",
              "NL",
              "SV",
              "FI",
              "DA",
              "NO",
              "CS",
              "HU",
              "EL",
              "RO",
              "BG",
              "UK",
              "HE",
              "MS",
              "TL",
              "ASL",
              "OTHER"
            ],
            "enumTitles": [
              "(any)",
              "English (EN)",
              "Spanish (ES)",
              "German (DE)",
              "French (FR)",
              "Portuguese (PT)",
              "Russian (RU)",
              "Japanese (JA)",
              "Korean (KO)",
              "Chinese (ZH)",
              "Italian (IT)",
              "Turkish (TR)",
              "Polish (PL)",
              "Arabic (AR)",
              "Thai (TH)",
              "Indonesian (ID)",
              "Vietnamese (VI)",
              "Dutch (NL)",
              "Swedish (SV)",
              "Finnish (FI)",
              "Danish (DA)",
              "Norwegian (NO)",
              "Czech (CS)",
              "Hungarian (HU)",
              "Greek (EL)",
              "Romanian (RO)",
              "Bulgarian (BG)",
              "Ukrainian (UK)",
              "Hebrew (HE)",
              "Malay (MS)",
              "Tagalog (TL)",
              "American Sign Language (ASL)",
              "Other"
            ],
            "default": "",
            "prefill": ""
          },
          "minViews": {
            "title": "Minimum views",
            "type": "integer",
            "description": "Skip clips below this view count. Set to 0 to keep every clip.",
            "default": 0,
            "prefill": 0,
            "minimum": 0,
            "maximum": 100000000
          },
          "createdAfter": {
            "title": "Created on or after",
            "type": "string",
            "description": "Optional YYYY-MM-DD date. Older clips are skipped in channel and category modes.",
            "editor": "datepicker"
          },
          "createdBefore": {
            "title": "Created on or before",
            "type": "string",
            "description": "Optional YYYY-MM-DD date. Newer clips are skipped in channel and category modes.",
            "editor": "datepicker"
          },
          "maxItems": {
            "title": "Maximum clips or highlights",
            "type": "integer",
            "description": "Stop after this many successful records (1-1000). Invalid inputs still produce error rows. Twitch caps channel and category rankings at about 1,000 clips per period.",
            "default": 20,
            "prefill": 1,
            "minimum": 1,
            "maximum": 1000
          }
        },
        "required": []
      },
      "output": {
        "actorOutputSchemaVersion": 1,
        "title": "Twitch Clip & Highlight MP4 Downloader Output",
        "description": "One row per clip or highlight with metadata, signed media URLs, quality details, optional key-value-store MP4 download, or a clear error row.",
        "properties": {
          "clips": {
            "type": "string",
            "title": "Twitch clips and highlights",
            "description": "Dataset containing clip and highlight metadata, media URLs, and optional downloaded MP4 files.",
            "template": "{{links.apiDefaultDatasetUrl}}/items"
          }
        }
      },
      "storages": {
        "dataset": {
          "actorSpecification": 1,
          "views": {
            "overview": {
              "title": "Twitch clips and highlights",
              "transformation": {
                "fields": [
                  "recordType",
                  "title",
                  "channelLogin",
                  "viewCount",
                  "durationSeconds",
                  "quality",
                  "fileSizeBytes",
                  "downloadUrl"
                ]
              },
              "display": {
                "component": "table",
                "properties": {}
              }
            }
          }
        }
      },
      "environmentVariables": {}
    },
    "buildNumber": "1.0.3",
    "actVersion": {
      "sourceType": "SOURCE_FILES",
      "buildTag": "latest",
      "versionNumber": "1.0"
    }
  }
}