{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Audio Downloader",
    "description": "Extract high-quality audio from any YouTube video in seconds. Choose MP3, M4A, or WAV with custom bitrate. Built with smart fallback strategies and proxy rotation for reliable extraction as YouTube's detection evolves. Batch-ready, fast, actively maintained.",
    "version": "0.0",
    "x-build-id": "GtpUq05pdP4yJ8IhE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/utils~youtube-link/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-utils-youtube-link",
        "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-link/runs": {
      "post": {
        "operationId": "runs-sync-utils-youtube-link",
        "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-link/run-sync": {
      "post": {
        "operationId": "run-sync-utils-youtube-link",
        "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": [
          "videos"
        ],
        "properties": {
          "videos": {
            "title": "YouTube videos",
            "maxItems": 10,
            "type": "array",
            "description": "Add one item per video (max 10). Only URL is required — leave format/timeframe/quality empty to use the global settings below.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "YouTube URL",
                  "description": "Full watch URL or 11-char video id.",
                  "type": "string",
                  "editor": "textfield"
                },
                "format": {
                  "title": "Format",
                  "description": "mp3 converts this audio. Empty keeps original container.",
                  "type": "string",
                  "editor": "select",
                  "enum": [
                    "",
                    "mp3"
                  ],
                  "prefill": ""
                },
                "timeframe": {
                  "title": "Timeframe",
                  "description": "MM:SS-MM:SS or HH:MM:SS-HH:MM:SS. Empty = full.",
                  "type": "string",
                  "editor": "textfield"
                },
                "audioQuality": {
                  "title": "Audio Quality",
                  "description": "Empty uses the global Audio Quality setting.",
                  "type": "string",
                  "editor": "select",
                  "enum": [
                    "",
                    "best",
                    "high",
                    "medium",
                    "low",
                    "aac",
                    "opus"
                  ],
                  "prefill": ""
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "audioQuality": {
            "title": "Audio Quality",
            "enum": [
              "best",
              "high",
              "medium",
              "low",
              "aac",
              "opus"
            ],
            "type": "string",
            "description": "Global default. Audio bitrate preference. high/medium/low cap at ~192/128/64 kbps; aac/opus restrict container codec.",
            "default": "best"
          },
          "format": {
            "title": "Output Format (audio mode)",
            "enum": [
              "",
              "mp3"
            ],
            "type": "string",
            "description": "Global default. 'mp3' converts audio output. Leave empty to keep original container."
          },
          "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."
          },
          "segmentTimeoutSec": {
            "title": "Per-segment download timeout (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Max seconds a segment may trickle without completing before it rotates to another proxy. Lower (e.g. 60) fails slow channels faster on throttled egress; higher tolerates slow-but-alive proxies. Range 10-600, default 240.",
            "default": 240
          },
          "maxEncodeJobs": {
            "title": "Max concurrent audio encodes",
            "minimum": 0,
            "maximum": 16,
            "type": "integer",
            "description": "How many ffmpeg mp3 encodes run at the same time. Containers with few cores crawl when 10 full-song encodes run simultaneously. Match to container CPU, e.g. 2. Range 0-16, default 0 = auto-tune to the container's real CPU quota.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}