{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Video Downloader - 4K, MP4 & MP3",
    "description": "Download YouTube videos and Shorts in MP4 up to 4K, extract MP3 audio, metadata, and subtitles in bulk, with direct links or S3 delivery. Powered by Titan Network.",
    "version": "1.2",
    "x-build-id": "cBPS6mAqjPhGvYJjM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/titan_network~titan-youtube-video-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-titan_network-titan-youtube-video-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/titan_network~titan-youtube-video-downloader/runs": {
      "post": {
        "operationId": "runs-sync-titan_network-titan-youtube-video-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/titan_network~titan-youtube-video-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-titan_network-titan-youtube-video-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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "YouTube Video URLs or IDs",
            "type": "array",
            "description": "List of YouTube video URLs (watch links, Shorts, youtu.be) or plain 11-character video IDs. One item per line. Duplicate video IDs are processed once.",
            "items": {
              "type": "string"
            }
          },
          "outputType": {
            "title": "Output Type",
            "enum": [
              "media",
              "metadata",
              "subtitles"
            ],
            "type": "string",
            "description": "What this run should produce: media (video or audio), metadata (standalone .info.json), or subtitles (standalone subtitle files). One run uses exactly one output configuration.",
            "default": "media"
          },
          "quality": {
            "title": "Video Quality Cap",
            "enum": [
              "360",
              "480",
              "720",
              "1080",
              "1440",
              "2160"
            ],
            "type": "string",
            "description": "Media mode (video) only: maximum desired video resolution. If not available, the highest available quality below this cap is selected. Audio (format=mp3) always uses the fixed value 720. Metadata/subtitles modes ignore this field.",
            "default": "720"
          },
          "format": {
            "title": "Output Format",
            "enum": [
              "mp4",
              "mp3",
              "webm"
            ],
            "type": "string",
            "description": "Media mode only: mp4/webm for merged video, mp3 for audio-only extraction. Metadata/subtitles modes ignore this field.",
            "default": "mp4"
          },
          "subtitleLanguages": {
            "title": "Subtitle Languages",
            "type": "array",
            "description": "Subtitles mode only (required): 1-10 language codes (e.g. en, zh-Hans, de), or [\"all\"] to receive every available subtitle of the video. Manual and automatic subtitles are both attempted.",
            "items": {
              "type": "string"
            }
          },
          "subtitleFormat": {
            "title": "Subtitle Format",
            "enum": [
              "srt",
              "vtt",
              "json3",
              "srv1",
              "srv2",
              "srv3",
              "ttml"
            ],
            "type": "string",
            "description": "Subtitles mode only: subtitle container format.",
            "default": "vtt"
          },
          "storageType": {
            "title": "Storage Provider",
            "enum": [
              "apify",
              "aws",
              "gcp",
              "digitalocean"
            ],
            "type": "string",
            "description": "Destination where downloaded files will be stored: apify (Titan platform storage, returns pre-signed links valid ~24h; files are NOT copied to the Apify Key-Value Store), aws (Amazon S3), gcp (Google Cloud Storage), digitalocean (DigitalOcean Spaces). Azure is not supported.",
            "default": "apify"
          },
          "s3Bucket": {
            "title": "Cloud Storage Bucket / Container Name",
            "type": "string",
            "description": "Bucket or container name if using custom cloud storage (required for aws/gcp/digitalocean)."
          },
          "s3Region": {
            "title": "Storage Region",
            "type": "string",
            "description": "Region of your storage bucket (e.g. us-east-1, auto, nyc3). Required for DigitalOcean Spaces."
          },
          "s3AccessKeyId": {
            "title": "Storage Access Key ID",
            "type": "string",
            "description": "Access Key ID for your cloud storage provider (required for aws/gcp/digitalocean)."
          },
          "s3SecretAccessKey": {
            "title": "Storage Secret Access Key",
            "type": "string",
            "description": "Secret Access Key for your cloud storage provider (required for aws/gcp/digitalocean)."
          },
          "maxWaitSec": {
            "title": "Per-Task Timeout (Seconds)",
            "minimum": 0,
            "maximum": 86400,
            "type": "integer",
            "description": "Maximum seconds to wait for each task's SSE completion before cancelling it. Defaults by mode: metadata/subtitles 1800, audio 7200, video 14400.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Max Concurrent Tasks",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of concurrent submit + SSE worker units (1-50). Default 20.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}