{
  "openapi": "3.0.1",
  "info": {
    "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",
    "x-build-id": "7MucuI4BLsegk8aKi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/xyrelith-data~twitch-clip-highlight-mp4-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-xyrelith-data-twitch-clip-highlight-mp4-downloader",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/xyrelith-data~twitch-clip-highlight-mp4-downloader/runs": {
      "post": {
        "operationId": "runs-sync-xyrelith-data-twitch-clip-highlight-mp4-downloader",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/xyrelith-data~twitch-clip-highlight-mp4-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-xyrelith-data-twitch-clip-highlight-mp4-downloader",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to collect",
            "enum": [
              "byUrls",
              "byChannels",
              "byCategories",
              "byHighlightIds"
            ],
            "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.",
            "default": "byUrls"
          },
          "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.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "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.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "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.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "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.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "quality": {
            "title": "Download quality",
            "enum": [
              "source",
              "1080",
              "720",
              "480",
              "360"
            ],
            "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.",
            "default": "source"
          },
          "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
          },
          "maxFileSizeMB": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 2048,
            "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
          },
          "maxHighlightDurationSeconds": {
            "title": "Maximum highlight length to download (seconds)",
            "minimum": 1,
            "maximum": 3600,
            "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
          },
          "includeThumbnail": {
            "title": "Include thumbnail URLs",
            "type": "boolean",
            "description": "Add a direct thumbnail image URL to every clip and highlight record.",
            "default": true
          },
          "period": {
            "title": "Clip period",
            "enum": [
              "LAST_DAY",
              "LAST_WEEK",
              "LAST_MONTH",
              "ALL_TIME"
            ],
            "type": "string",
            "description": "Time window for channel and category rankings. Clip URL and highlight modes ignore it.",
            "default": "LAST_WEEK"
          },
          "sort": {
            "title": "Ranking order",
            "enum": [
              "VIEWS_DESC",
              "TRENDING"
            ],
            "type": "string",
            "description": "Most viewed first, or Twitch's trending order. Applies to channel and category modes.",
            "default": "VIEWS_DESC"
          },
          "language": {
            "title": "Broadcast language",
            "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"
            ],
            "type": "string",
            "description": "Keep only clips in this broadcast language. Leave on (any) for no language filter.",
            "default": ""
          },
          "minViews": {
            "title": "Minimum views",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Skip clips below this view count. Set to 0 to keep every clip.",
            "default": 0
          },
          "createdAfter": {
            "title": "Created on or after",
            "type": "string",
            "description": "Optional YYYY-MM-DD date. Older clips are skipped in channel and category modes."
          },
          "createdBefore": {
            "title": "Created on or before",
            "type": "string",
            "description": "Optional YYYY-MM-DD date. Newer clips are skipped in channel and category modes."
          },
          "maxItems": {
            "title": "Maximum clips or highlights",
            "minimum": 1,
            "maximum": 1000,
            "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
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}