{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Audio Extractor [Only $6/1K💰] | MP3/M4A/FLAC",
    "description": "Extract audio from YouTube and YouTube Music — MP3, M4A, WebM, FLAC, WAV, Ogg Vorbis and ALAC — with a public download link per track, optional captions/transcripts and section trimming, via native stream copy (no re-encode) for speed. $0.006 per track, first 50 MB included.",
    "version": "0.1",
    "x-build-id": "E5UxcZiMeTvvCyg0O"
  },
  "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. Leave it empty for the cheapest downloads: YouTube usually serves audio straight to the Actor. If a track comes back blocked, the Actor retries through Apify residential proxy on its own, billing residential bandwidth as Proxy MB, including bandwidth spent on a retry that still fails. Enable a proxy here to force it for every track, or paste your own proxies into proxyUrls.",
            "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
          },
          "retries": {
            "title": "Retries per track",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "How many times a failed track is retried, each time with a rotated proxy and a longer backoff. Retries on the metered residential proxy are capped at 1 to keep proxy costs bounded.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}