{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper: Subtitles, Channels, Search",
    "description": "Extract YouTube transcripts and subtitles in bulk from videos, Shorts, playlists, channels and search. Timestamped segments, plain text, SRT and VTT, auto-generated flag, all caption languages, plus title, channel, publish date, views and duration. Only successful transcripts are charged.",
    "version": "1.0",
    "x-build-id": "mAoLdhlgqwc0d0F78"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~youtube-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-youtube-transcript-scraper",
        "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/zhtech~youtube-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-youtube-transcript-scraper",
        "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/zhtech~youtube-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-youtube-transcript-scraper",
        "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": {
          "urls": {
            "title": "YouTube URLs or IDs",
            "type": "array",
            "description": "Paste any mix of YouTube links, one per line: videos (watch, youtu.be, embed, live), Shorts, playlists, channels (@handle, /channel/UC..., /c/, /user/, or a channel tab like /@handle/shorts) and search result URLs. Bare 11 character video IDs and @handles also work. Channels and playlists are expanded into their videos. Duplicates are removed automatically.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Search YouTube and get transcripts of the results. One query per line. Use \"Max videos per channel, playlist or search\" to control how many results per query.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSource": {
            "title": "Max videos per channel, playlist or search",
            "minimum": 0,
            "type": "integer",
            "description": "How many videos to take from each channel, playlist or search query. Channels are read newest first. Set 0 for no limit. Single video URLs are not affected.",
            "default": 20
          },
          "maxTranscripts": {
            "title": "Max transcripts in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop the run after this many successful transcripts across all inputs. 0 means no limit (the run still respects your maximum cost per run).",
            "default": 0
          },
          "channelContentTypes": {
            "title": "Channel content",
            "type": "array",
            "description": "Which uploads to take from channel URLs: regular videos, Shorts and past live streams. A channel URL that already points at a tab (for example /@name/shorts) uses only that tab.",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Past live streams"
              ]
            },
            "default": [
              "videos",
              "shorts",
              "streams"
            ]
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only videos published on or after this date. Use a date (2026-01-31) or a relative period such as \"30 days\". Channel listings stop early once older videos are reached, so you do not pay for them."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only videos published before this date. Same formats as \"Published after\"."
          },
          "searchSort": {
            "title": "Search sort order",
            "type": "string",
            "description": "Sort order for search queries. These are the only two orders YouTube still applies. YouTube removed sorting by upload date and rating in 2025 (it silently ignores them): for recent videos use \"Published after\". Old saved inputs with \"date\" run in relevance order and \"rating\" runs as popularity, with a note in the log.",
            "default": "relevance"
          },
          "languages": {
            "title": "Preferred transcript languages",
            "type": "array",
            "description": "Language codes in order of preference, for example en, es, pt-BR. The first one the video has is used. A base code matches regional variants (en matches en-US and en-GB).",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "fallbackToAnyLanguage": {
            "title": "Fall back to the video's own language",
            "type": "boolean",
            "description": "If none of your preferred languages exist, return the transcript in the language the video was spoken in (marked with isLanguageFallback). Turn off to return a free LANGUAGE_NOT_AVAILABLE row instead.",
            "default": true
          },
          "captionType": {
            "title": "Caption type",
            "enum": [
              "any",
              "manual",
              "auto"
            ],
            "type": "string",
            "description": "Any: human-written captions when available, otherwise YouTube's auto-generated transcript. Manual only: skip videos that only have auto captions. Auto-generated only: always use the speech recognition track.",
            "default": "any"
          },
          "translateTo": {
            "title": "Translate to language (best effort)",
            "type": "string",
            "description": "Optional language code, for example es or de. If the video already has a track in this language it is used directly. Otherwise the actor asks YouTube for its machine translation. YouTube often refuses automated translation requests; in that case you still get the original transcript and translationStatus explains what happened."
          },
          "outputFormats": {
            "title": "Transcript formats",
            "type": "array",
            "description": "Which transcript fields each row should contain. segments: timestamped list of {start, end, duration, text}. text: one plain string. timestampedText: paragraphs prefixed with [m:ss], ideal for LLM citations. srt and vtt: ready subtitle files.",
            "items": {
              "type": "string",
              "enum": [
                "segments",
                "text",
                "timestampedText",
                "srt",
                "vtt"
              ],
              "enumTitles": [
                "Timestamped segments",
                "Plain text",
                "Timestamped text (LLM friendly)",
                "SRT subtitles",
                "WebVTT subtitles"
              ]
            },
            "default": [
              "segments",
              "text"
            ]
          },
          "includeWordTimestamps": {
            "title": "Word-level timestamps",
            "type": "boolean",
            "description": "Add a words array with the start time of every word to each segment. Available for auto-generated captions; human-written captions give one entry per line.",
            "default": false
          },
          "removeSoundTags": {
            "title": "Remove sound tags",
            "type": "boolean",
            "description": "Remove non-speech markers like [Music], [Applause] and music notes from the transcript.",
            "default": false
          },
          "includeDescription": {
            "title": "Include description and tags",
            "type": "boolean",
            "description": "Add the full video description and keywords to each row.",
            "default": false
          },
          "includeErrorItems": {
            "title": "Include rows for videos without a transcript",
            "type": "boolean",
            "description": "Add a free row with an errorCode (NO_CAPTIONS, PRIVATE_VIDEO, VIDEO_UNAVAILABLE and so on) for every video that has no transcript. These rows are never charged.",
            "default": true
          },
          "onlyNewVideos": {
            "title": "Only new videos (for scheduled runs)",
            "type": "boolean",
            "description": "Skip videos that were already transcribed successfully in earlier runs with the same state key. Perfect for daily channel monitoring: each run returns only fresh uploads. Videos that had no captions yet are retried next time.",
            "default": false
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the memory used by \"Only new videos\". Use a different key per schedule or task if you want them tracked separately.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "YouTube blocks many datacenter IPs. The default Apify Proxy setting works for most runs, and the actor automatically switches to residential IPs only when YouTube blocks a request. You can also pick RESIDENTIAL directly or use your own proxies.",
            "default": {
              "useApifyProxy": true
            }
          },
          "residentialFallback": {
            "title": "Automatic residential fallback",
            "type": "boolean",
            "description": "When YouTube blocks the datacenter proxy, retry that request through Apify residential proxy. Recommended.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many videos are processed at the same time.",
            "default": 10
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many times a blocked or failed request is retried with a new IP before the video is reported as BLOCKED.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}