{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript & Subtitles Scraper API",
    "description": "Scrape YouTube transcripts, subtitles, and captions in bulk, the cheapest pay-per-video YouTube transcript API on Apify. Callable from any MCP client (Claude, Cursor, ChatGPT). Supports YouTube videos, Shorts, and every URL format.",
    "version": "0.5",
    "x-build-id": "cz12nrEK885YrDA4v"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/johnvc~YoutubeTranscripts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-johnvc-YoutubeTranscripts",
        "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/johnvc~YoutubeTranscripts/runs": {
      "post": {
        "operationId": "runs-sync-johnvc-YoutubeTranscripts",
        "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/johnvc~YoutubeTranscripts/run-sync": {
      "post": {
        "operationId": "run-sync-johnvc-YoutubeTranscripts",
        "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": {
          "youtube_url": {
            "title": "YouTube URL(s)",
            "description": "Required unless 'channel' is provided. Provide one YouTube URL as a string, or multiple as an array (max 250 URLs per run). Works with standard videos, Shorts, youtu.be short links, embed URLs, and m.youtube.com mobile URLs. Channel URLs (youtube.com/@handle, /channel/, /c/, /user/) are detected automatically and treated as the 'channel' input. Each video URL is processed in parallel. If more than 250 URLs are submitted, only the first 250 are processed and a truncation notice is written to the dataset - split larger batches into multiple runs. Invalid URLs are recorded as errors in the dataset but do not stop the run. Charged per video successfully transcribed."
          },
          "languages": {
            "title": "Preferred Languages",
            "type": "array",
            "description": "Ordered list of ISO 639-1 language codes. The first available transcript matching one of these languages is returned. Example: [\"en\", \"es\", \"fr\"] tries English first, then Spanish, then French. Defaults to [\"en\"] when omitted.",
            "items": {
              "type": "string"
            },
            "default": [
              "en"
            ]
          },
          "translate_to": {
            "title": "Translate To",
            "type": "string",
            "description": "Optional. If set to an ISO 639-1 code (e.g. \"es\", \"fr\", \"de\"), the picked transcript is translated to this language. Requires the source transcript to be translatable - run with list_only=true first to see translation_languages for each available transcript. If translation is unavailable, the original transcript is returned (no error)."
          },
          "transcript_type": {
            "title": "Transcript Type",
            "enum": [
              "any",
              "manual",
              "generated"
            ],
            "type": "string",
            "description": "Filter which transcript variant to consider when both manually-created and auto-generated captions exist for a language. \"any\" picks whichever matches the language priority first; \"manual\" only considers human-made captions; \"generated\" only considers auto-generated.",
            "default": "any"
          },
          "output_formats": {
            "title": "Additional Output Formats",
            "type": "array",
            "description": "Optional list of extra output formats to include in the dataset alongside the default structured fields. Allowed values: \"srt\" (SubRip subtitles), \"vtt\" (WebVTT subtitles), \"text\" (plain text, newline-separated). Unknown values are ignored with a warning. The structured fields (timestamped, non_timestamped, etc.) are always included.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "preserve_formatting": {
            "title": "Preserve HTML formatting",
            "type": "boolean",
            "description": "If true, keep YouTube's inline HTML formatting tags (<i>, <b>) in transcript text. Default false (strips them for clean text).",
            "default": false
          },
          "list_only": {
            "title": "List available transcripts only (discovery mode)",
            "type": "boolean",
            "description": "If true, do NOT fetch any transcript. Instead, for each URL return the list of all available transcripts with their language code, generated/manual status, is_translatable flag, and translation_languages. Useful for discovering what languages exist before picking one. Not charged as a videoprocessed event.",
            "default": false
          },
          "include_metadata": {
            "title": "Include video metadata",
            "type": "boolean",
            "description": "If true, also fetch video metadata via yt-dlp: title, description, channel_name, channel_id, channel_url, view_count, like_count, video_duration_seconds, upload_date, thumbnail_url, tags, categories, availability, was_live. Adds about 1-3 seconds per video. If metadata extraction fails, the transcript is still returned and metadata_error is populated. Defaults to true.",
            "default": true
          },
          "channel": {
            "title": "Channel(s) to list",
            "description": "Optional. One YouTube channel as a string, or multiple as an array. Accepts an @handle (\"@mkbhd\"), a bare handle (\"mkbhd\"), a channel ID (\"UCBJycsmduvYEL83R_U4JriQ\"), or any channel URL (/channel/, /c/, /user/, /@handle; a /videos, /shorts, or /streams tab URL keeps that tab). Each channel produces one dataset row per video, newest first, up to max_videos: video_id, url, title, duration, view count, and thumbnail. Rows are marked result_type=\"channel_video\". Listing is not charged as a videoprocessed event."
          },
          "max_videos": {
            "title": "Max videos per channel",
            "type": "integer",
            "description": "Maximum number of videos to list per channel, newest first. Default 100. Values above 1000 are capped at 1000 (and values below 1 are raised to 1) with a log warning rather than failing the run. When channel_transcripts is true, at most 250 videos per run (across all channels plus explicit URLs) proceed to transcript extraction.",
            "default": 100
          },
          "channel_transcripts": {
            "title": "Fetch transcripts for listed channel videos",
            "type": "boolean",
            "description": "If true, every video listed from the channel(s) is also queued for transcript extraction (newest first, deduplicated against youtube_url entries, subject to the 250 videos per run limit). Each successful transcript is charged as a videoprocessed event, exactly like videos passed via youtube_url. Default false: channels are only listed.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}