{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video, Playlist & Channel Downloader with Metadata",
    "description": "Download YouTube videos from direct links, playlists, channels, or search phrases at your chosen quality, with a public file link plus title, stats, description and subtitles per video.",
    "version": "1.0",
    "x-build-id": "tyaMzg62TcJZfZ4Pv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nimbryxo-studio~youtube-video-playlist-and-channel-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nimbryxo-studio-youtube-video-playlist-and-channel-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/nimbryxo-studio~youtube-video-playlist-and-channel-downloader/runs": {
      "post": {
        "operationId": "runs-sync-nimbryxo-studio-youtube-video-playlist-and-channel-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/nimbryxo-studio~youtube-video-playlist-and-channel-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-nimbryxo-studio-youtube-video-playlist-and-channel-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "metadata",
              "download",
              "subtitles"
            ],
            "type": "string",
            "description": "What to return: metadata only, media files, or caption files without media.",
            "default": "metadata"
          },
          "videoUrls": {
            "title": "Video URLs",
            "type": "array",
            "description": "Direct YouTube video, Shorts, live-replay, or youtu.be URLs, or 11-character video IDs.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "playlistUrls": {
            "title": "Playlist URLs",
            "type": "array",
            "description": "YouTube playlist URLs. Videos are expanded up to maxVideos in total.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "channelUrls": {
            "title": "Channel URLs",
            "type": "array",
            "description": "YouTube channel URLs, @handles, or UC channel IDs. The Videos tab is used.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchQueries": {
            "title": "Search Queries",
            "type": "array",
            "description": "YouTube search phrases. Each query resolves public results up to maxVideos in total.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "videoQuality": {
            "title": "Video Quality",
            "enum": [
              "360p",
              "480p",
              "720p",
              "1080p",
              "1440p",
              "2160p",
              "best"
            ],
            "type": "string",
            "description": "SDR target quality. 360p-1080p prefer H.264/AAC MP4. 1440p and 2160p require allow4K and are delivered with their real codec and container.",
            "default": "720p"
          },
          "container": {
            "title": "Container",
            "enum": [
              "auto",
              "mp4",
              "webm",
              "mkv"
            ],
            "type": "string",
            "description": "Auto uses MP4 H.264/AAC when available and MKV for VP9/AV1. Explicit MP4 never relabels AV1/Opus content as MP4; if no compatible stream exists the video gets a failure row.",
            "default": "auto"
          },
          "audioOnly": {
            "title": "Audio Only",
            "type": "boolean",
            "description": "Download the source audio track without video and without re-encoding.",
            "default": false
          },
          "audioFormat": {
            "title": "Audio Format",
            "enum": [
              "m4a",
              "opus"
            ],
            "type": "string",
            "description": "Source audio passthrough format used when audioOnly is enabled.",
            "default": "m4a"
          },
          "downloadSubtitles": {
            "title": "Download Subtitles",
            "type": "boolean",
            "description": "Fetch available manual or automatic captions for the requested languages.",
            "default": false
          },
          "subtitleLanguages": {
            "title": "Subtitle Languages",
            "type": "array",
            "description": "Caption language codes to request. Only tracks that already exist on the video are used; translations are not promised.",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "en-US",
                "en-GB",
                "es",
                "es-419",
                "pt",
                "pt-BR",
                "fr",
                "de",
                "it",
                "nl",
                "pl",
                "ru",
                "uk",
                "tr",
                "ar",
                "fa",
                "he",
                "hi",
                "bn",
                "ta",
                "te",
                "mr",
                "ur",
                "gu",
                "kn",
                "ml",
                "pa",
                "zh-Hans",
                "zh-Hant",
                "ja",
                "ko",
                "vi",
                "th",
                "id",
                "ms",
                "fil",
                "sv",
                "no",
                "da",
                "fi",
                "cs",
                "sk",
                "hu",
                "ro",
                "bg",
                "el",
                "hr",
                "sr",
                "sl",
                "lt",
                "lv",
                "et",
                "is",
                "sq",
                "mk",
                "bs",
                "ca",
                "gl",
                "eu",
                "af",
                "sw",
                "am",
                "km",
                "lo",
                "my",
                "ne",
                "si",
                "ka",
                "hy",
                "az",
                "kk",
                "ky",
                "uz",
                "mn",
                "mt",
                "cy",
                "ga"
              ],
              "enumTitles": [
                "English",
                "English (US)",
                "English (UK)",
                "Spanish",
                "Spanish (Latin America)",
                "Portuguese",
                "Portuguese (Brazil)",
                "French",
                "German",
                "Italian",
                "Dutch",
                "Polish",
                "Russian",
                "Ukrainian",
                "Turkish",
                "Arabic",
                "Persian",
                "Hebrew",
                "Hindi",
                "Bengali",
                "Tamil",
                "Telugu",
                "Marathi",
                "Urdu",
                "Gujarati",
                "Kannada",
                "Malayalam",
                "Punjabi",
                "Chinese (Simplified)",
                "Chinese (Traditional)",
                "Japanese",
                "Korean",
                "Vietnamese",
                "Thai",
                "Indonesian",
                "Malay",
                "Filipino",
                "Swedish",
                "Norwegian",
                "Danish",
                "Finnish",
                "Czech",
                "Slovak",
                "Hungarian",
                "Romanian",
                "Bulgarian",
                "Greek",
                "Croatian",
                "Serbian",
                "Slovenian",
                "Lithuanian",
                "Latvian",
                "Estonian",
                "Icelandic",
                "Albanian",
                "Macedonian",
                "Bosnian",
                "Catalan",
                "Galician",
                "Basque",
                "Afrikaans",
                "Swahili",
                "Amharic",
                "Khmer",
                "Lao",
                "Burmese",
                "Nepali",
                "Sinhala",
                "Georgian",
                "Armenian",
                "Azerbaijani",
                "Kazakh",
                "Kyrgyz",
                "Uzbek",
                "Mongolian",
                "Maltese",
                "Welsh",
                "Irish"
              ]
            },
            "default": [
              "en"
            ]
          },
          "subtitleFormat": {
            "title": "Subtitle Format",
            "enum": [
              "vtt",
              "srt"
            ],
            "type": "string",
            "description": "File format for downloaded captions.",
            "default": "vtt"
          },
          "includeTranscript": {
            "title": "Include Transcript Text",
            "type": "boolean",
            "description": "Add a plain-text transcript from the first requested caption track.",
            "default": false
          },
          "maxVideos": {
            "title": "Max Videos",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Total videos processed across all inputs.",
            "default": 10
          },
          "maxMinutes": {
            "title": "Max Minutes Per Video",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Reject a video before download when its duration exceeds this cap. 4K opt-in downloads are additionally capped at 10 minutes.",
            "default": 30
          },
          "maxMB": {
            "title": "Max MB Per Video",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Reject oversized downloads. Values above 500 are only used for 4K opt-in downloads, which are capped at 1000 MB.",
            "default": 500
          },
          "allow4K": {
            "title": "Allow 4K",
            "type": "boolean",
            "description": "Enable 1440p/2160p SDR downloads. These are capped at 10 minutes and 1000 MB and may use MKV with VP9/AV1 because YouTube rarely serves H.264 above 1080p.",
            "default": false
          },
          "storage": {
            "title": "Storage",
            "enum": [
              "ephemeral_kvs",
              "named_kvs",
              "s3"
            ],
            "type": "string",
            "description": "Where downloaded files are written. Named KVS persists while the store exists; ephemeral KVS follows your Apify account retention.",
            "default": "ephemeral_kvs"
          },
          "kvsName": {
            "title": "KVS Name",
            "type": "string",
            "description": "Named key-value store name when storage=named_kvs. Defaults to youtube-downloader.",
            "default": ""
          },
          "storageRetentionDays": {
            "title": "Storage Retention Days",
            "minimum": 1,
            "maximum": 7,
            "type": "integer",
            "description": "Signed-link lifetime for S3/R2 storage (1-7 days). KVS retention is controlled by your Apify account.",
            "default": 7
          },
          "s3Bucket": {
            "title": "S3 Bucket",
            "type": "string",
            "description": "Bucket name when storage=s3."
          },
          "s3Prefix": {
            "title": "S3 Prefix",
            "type": "string",
            "description": "Object key prefix when storage=s3.",
            "default": "youtube-downloader"
          },
          "s3Endpoint": {
            "title": "S3 Endpoint",
            "type": "string",
            "description": "Custom endpoint for S3-compatible storage such as Cloudflare R2."
          },
          "s3Region": {
            "title": "S3 Region",
            "type": "string",
            "description": "Region for S3 or S3-compatible storage.",
            "default": "auto"
          },
          "s3AccessKeyId": {
            "title": "S3 Access Key ID",
            "type": "string",
            "description": "Optional access key ID when storage=s3."
          },
          "s3SecretAccessKey": {
            "title": "S3 Secret Access Key",
            "type": "string",
            "description": "Optional secret access key when storage=s3."
          },
          "s3PublicBaseUrl": {
            "title": "S3 Public Base URL",
            "type": "string",
            "description": "Optional public bucket URL. When set, files use public URLs instead of expiring presigned URLs."
          },
          "cookies": {
            "title": "Cookies (Netscape format)",
            "type": "string",
            "description": "Optional cookies.txt content for age-restricted or members-only videos. Public videos work without cookies."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional. Metadata and player extraction use this connection; media bytes are downloaded directly.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}