{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Audio Extractor | MP3, M4A & Transcripts",
    "description": "Download audio from YouTube and YouTube Music in MP3, M4A, WebM, FLAC, WAV, Ogg Vorbis or ALAC. Each track includes a public download link, metadata, optional captions/transcripts and section trimming. Pay per delivered track plus saved storage; failed downloads are not charged.",
    "version": "0.1",
    "x-build-id": "BZjiOJgjxBmlLsvw5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ahmed_jasarevic~yt-audio-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ahmed_jasarevic-yt-audio-extractor",
        "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/ahmed_jasarevic~yt-audio-extractor/runs": {
      "post": {
        "operationId": "runs-sync-ahmed_jasarevic-yt-audio-extractor",
        "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/ahmed_jasarevic~yt-audio-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-ahmed_jasarevic-yt-audio-extractor",
        "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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Public YouTube Music tracks, YouTube videos, Shorts, live, embed or youtu.be links, or bare 11-character video IDs. Every URL is processed independently, so one bad link never stops the rest of the run.",
            "items": {
              "type": "string"
            }
          },
          "format": {
            "title": "Audio format",
            "enum": [
              "m4a",
              "mp3",
              "webm",
              "flac",
              "wav",
              "vorbis",
              "alac"
            ],
            "type": "string",
            "description": "MP3 works almost everywhere and is re-encoded at 192 kbps. M4A and WebM keep the native YouTube stream whenever possible, which is much faster because no re-encoding happens. FLAC, WAV and ALAC are lossless and therefore much larger.",
            "default": "m4a"
          },
          "country": {
            "title": "Access country",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Two-letter ISO country code used to fetch public audio offered in that country. Use it when a track is only available in certain markets.",
            "default": "US"
          },
          "captionLanguage": {
            "title": "Caption language",
            "type": "string",
            "description": "Language code of the captions or timed transcript you want, for example en or en-US. Leave empty to skip captions. A missing track never stops the audio download.",
            "default": ""
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional Apify proxy configuration. Leave empty for direct downloads.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many tracks to process at the same time. Higher is faster but needs more proxies and memory. Values above 10 rarely help.",
            "default": 4
          },
          "maxDurationSeconds": {
            "title": "Maximum track length",
            "minimum": 60,
            "maximum": 43200,
            "type": "integer",
            "description": "Safety limit in seconds. Anything longer is rejected before a single byte is downloaded, so a mistaken link can never produce a huge bill. 14400 equals 4 hours.",
            "default": 14400
          },
          "maxOutputMb": {
            "title": "Maximum output size (MB)",
            "minimum": 1,
            "maximum": 2048,
            "type": "integer",
            "description": "Safety limit for one saved audio file. Tracks larger than this are reported as file-too-large and are not charged for the audio track or saved MB. Raise it only when you need large lossless files.",
            "default": 512
          },
          "maxProxyMb": {
            "title": "Maximum residential proxy per track (MB)",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Cap on metered residential proxy bandwidth for one track. Set to 0 to disable the automatic residential fallback and avoid proxy charges entirely.",
            "default": 50
          },
          "retries": {
            "title": "Retries per track",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "How many times a failed track is retried with a longer pause between attempts.",
            "default": 3
          },
          "mp3Bitrate": {
            "title": "MP3 bitrate",
            "minimum": 96,
            "maximum": 320,
            "type": "integer",
            "description": "Target bitrate when you pick the mp3 format. 128 kbps is small, 192 kbps is the default balance and 320 kbps is the highest quality MP3. Other formats ignore this value.",
            "default": 192
          },
          "startTimeSeconds": {
            "title": "Start at (seconds)",
            "minimum": 0,
            "maximum": 43200,
            "type": "integer",
            "description": "Optional. Skip this many seconds at the beginning of the track and save only what follows. 0 keeps the whole track.",
            "default": 0
          },
          "endTimeSeconds": {
            "title": "End at (seconds)",
            "minimum": 0,
            "maximum": 43200,
            "type": "integer",
            "description": "Optional. Stop saving at this point, for example 90 to get the first 90 seconds. 0 means keep playing to the end of the track.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}