{
  "openapi": "3.0.1",
  "info": {
    "title": "Youtube Video Downloader",
    "description": "Download YouTube videos in multiple resolutions (up to 4K) and formats. Built with smart fallback strategies and proxy rotation for reliable extraction as YouTube's detection evolves. Batch processing, custom quality selection, fast turnaround. Actively maintained.",
    "version": "1.0",
    "x-build-id": "796haD8EFcI2QLSJs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/utils~youtube-video-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-utils-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/utils~youtube-video-downloader/runs": {
      "post": {
        "operationId": "runs-sync-utils-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/utils~youtube-video-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-utils-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",
        "properties": {
          "videos": {
            "title": "YouTube videos",
            "maxItems": 5,
            "type": "array",
            "description": "Add one item per video (max 5). Only URL is required — leave timeframe/videoQuality empty to use the global settings below. When filled, overrides the video set. S3 toggle ON = deliver this video to the S3 bucket below (off = store in this run's key-value store).",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "YouTube URL",
                  "description": "Full watch URL or 11-char video id.",
                  "type": "string",
                  "editor": "textfield"
                },
                "timeframe": {
                  "title": "Timeframe",
                  "description": "MM:SS-MM:SS or HH:MM:SS-HH:MM:SS. Empty = full.",
                  "type": "string",
                  "editor": "textfield"
                },
                "videoQuality": {
                  "title": "Video Quality",
                  "description": "Empty uses the global Video Quality setting.",
                  "type": "string",
                  "editor": "select",
                  "enum": [
                    "",
                    "best",
                    "high",
                    "medium",
                    "low"
                  ],
                  "prefill": ""
                },
                "s3": {
                  "title": "S3 delivery",
                  "description": "Optional. ON = also upload this video to the S3 bucket in the S3 delivery section below. OFF (default) = key-value store only (the main store). Missing/invalid S3 config never fails the run — it falls back to the key-value store.",
                  "type": "boolean",
                  "editor": "checkbox",
                  "default": false
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "timeframe": {
            "title": "Timeframe (optional)",
            "type": "string",
            "description": "Global default. Cut only a portion: MM:SS-MM:SS or HH:MM:SS-HH:MM:SS (e.g. 1:30-3:00). Empty = full."
          },
          "videoQuality": {
            "title": "Video Quality",
            "enum": [
              "best",
              "high",
              "medium",
              "low"
            ],
            "type": "string",
            "description": "Global default. Quality ceiling for the downloaded MP4. best = any height (highest available); high = up to 1080p; medium = up to 720p; low = up to 480p. The delivered file never exceeds the ceiling and may be lower when the source has nothing higher.",
            "default": "best"
          },
          "s3": {
            "title": "S3 delivery (optional)",
            "type": "object",
            "description": "OPTIONAL — the key-value store stays the main store. Deliver selected videos straight to your own S3-compatible bucket as well (AWS S3, Cloudflare R2, MinIO, Backblaze B2, ...). Per-video toggle: ON = S3, OFF (default) = key-value store only. Leave this section empty to disable. The bucket must already exist — the actor never creates buckets. A missing/invalid config or a failed upload automatically falls back to the key-value store — it never fails the run.",
            "properties": {
              "endpoint": {
                "title": "Endpoint",
                "description": "e.g. https://s3.us-east-1.amazonaws.com | https://<account>.r2.cloudflarestorage.com | http://<host>:9000 (MinIO)",
                "type": "string",
                "editor": "textfield",
                "prefill": ""
              },
              "bucket": {
                "title": "Bucket",
                "description": "Existing bucket name.",
                "type": "string",
                "editor": "textfield",
                "prefill": ""
              },
              "region": {
                "title": "Region",
                "description": "AWS region (e.g. us-east-1). Most S3-compatible servers accept any value; Cloudflare R2 requires 'auto'.",
                "type": "string",
                "editor": "textfield",
                "prefill": "us-east-1"
              },
              "accessKey": {
                "title": "Access key",
                "description": "Access key id with PutObject permission on the bucket.",
                "type": "string",
                "editor": "textfield",
                "prefill": ""
              },
              "secretKey": {
                "title": "Secret key",
                "description": "Secret access key (stored as run input; anyone with run access can read it).",
                "type": "string",
                "editor": "textfield",
                "prefill": ""
              },
              "publicBaseUrl": {
                "title": "Public base URL (optional)",
                "description": "e.g. https://cdn.example.com — used as the downloadUrl prefix (ends in /<videoId>.<ext>). Empty = path-style object URL from the endpoint (needs a public bucket).",
                "type": "string",
                "editor": "textfield",
                "prefill": ""
              }
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}