{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper for AI & RAG – Videos, Channels",
    "description": "Get YouTube transcripts (captions) in bulk from videos, playlists, channels or search. Clean text, timestamped segments and RAG-ready chunks with deep links, language fallback and video metadata. Pay only for successful transcripts.",
    "version": "0.1",
    "x-build-id": "gxlY4CCPznDFIV5AG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/clearfeed-labs~youtube-transcripts-ai/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-clearfeed-labs-youtube-transcripts-ai",
        "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/clearfeed-labs~youtube-transcripts-ai/runs": {
      "post": {
        "operationId": "runs-sync-clearfeed-labs-youtube-transcripts-ai",
        "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/clearfeed-labs~youtube-transcripts-ai/run-sync": {
      "post": {
        "operationId": "run-sync-clearfeed-labs-youtube-transcripts-ai",
        "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": "Any mix of video URLs (watch, youtu.be, Shorts, live, embed), bare 11-character video IDs, playlist URLs, and channel URLs or @handles (e.g. https://www.youtube.com/@3blue1brown). Duplicates are removed.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries (optional)",
            "type": "array",
            "description": "Find videos by YouTube search and get their transcripts, e.g. \"retrieval augmented generation tutorial\".",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerChannel": {
            "title": "Max videos per channel",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Newest videos taken from each channel.",
            "default": 20
          },
          "channelTabs": {
            "title": "Channel tabs",
            "type": "array",
            "description": "Which channel tabs to take videos from (used when the channel URL has no tab).",
            "items": {
              "type": "string",
              "enum": [
                "videos",
                "shorts",
                "streams"
              ],
              "enumTitles": [
                "Videos",
                "Shorts",
                "Live streams"
              ]
            },
            "default": [
              "videos"
            ]
          },
          "maxVideosPerPlaylist": {
            "title": "Max videos per playlist",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Videos taken from each playlist, in playlist order.",
            "default": 100
          },
          "maxVideosPerSearch": {
            "title": "Max videos per search query",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Top search results taken for each query.",
            "default": 20
          },
          "maxVideos": {
            "title": "Max videos in total",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap across all inputs. 0 = no cap.",
            "default": 0
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Language codes in order of preference (e.g. en, de, es, pt-BR). 'en' also matches en-US/en-GB. Uploaded (human) captions are preferred over auto-generated ones in the same language.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "Use YouTube's automatic (speech recognition) captions when no uploaded captions exist in your languages.",
            "default": true
          },
          "allowTranslation": {
            "title": "Translate when your language is missing (experimental)",
            "type": "boolean",
            "description": "If no track exists in your preferred languages, ask YouTube for a machine translation into the first preferred language. YouTube currently rate-limits translated captions heavily, so this usually falls back to the original language (see translationError).",
            "default": false
          },
          "fallbackToAnyLanguage": {
            "title": "Fall back to the original language",
            "type": "boolean",
            "description": "If nothing above works, return the transcript in whatever language is available (the spoken language first) instead of an error.",
            "default": true
          },
          "outputMode": {
            "title": "Output rows",
            "enum": [
              "video",
              "chunk"
            ],
            "type": "string",
            "description": "One row per video, or one row per text chunk (ready to embed and load into a vector database).",
            "default": "video"
          },
          "includePlainText": {
            "title": "Plain text",
            "type": "boolean",
            "description": "Full transcript as one clean string.",
            "default": true
          },
          "includeTimestampedText": {
            "title": "Timestamped text",
            "type": "boolean",
            "description": "Transcript as paragraphs prefixed with [mm:ss], about every 30 seconds. Great for LLM answers with citations.",
            "default": false
          },
          "includeSegments": {
            "title": "Timestamped segments",
            "type": "boolean",
            "description": "Array of caption lines with start and end in seconds.",
            "default": false
          },
          "includeChunks": {
            "title": "Chunks (in per-video rows)",
            "type": "boolean",
            "description": "Add a `chunks` array to each video row. Always on in per-chunk mode.",
            "default": false
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 200,
            "maximum": 50000,
            "type": "integer",
            "description": "Target chunk length. ~4 characters ≈ 1 token, so 2000 ≈ 500 tokens. Chunks never cut a caption line.",
            "default": 2000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Characters repeated at the start of the next chunk so context is not lost at boundaries.",
            "default": 200
          },
          "removeNonSpeechTags": {
            "title": "Remove non-speech tags",
            "type": "boolean",
            "description": "Strip [Music], [Applause], ♪ and similar tags.",
            "default": true
          },
          "includeMetadata": {
            "title": "Video metadata",
            "type": "boolean",
            "description": "Title, channel, publish date, duration, views, category, keywords, thumbnail.",
            "default": true
          },
          "includeDescription": {
            "title": "Video description",
            "type": "boolean",
            "description": "Add the full video description text.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Videos processed in parallel.",
            "default": 10
          },
          "maxRetries": {
            "title": "Attempts per video",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Each retry uses a fresh IP address.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Residential Apify Proxy is the default because YouTube blocks most datacenter IPs. Only small caption files (~30 KB per video) go through it. If you choose datacenter proxies, blocked videos are retried through residential IPs automatically.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "residentialFallback": {
            "title": "Automatic residential fallback",
            "type": "boolean",
            "description": "Retry blocked videos through residential IPs.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}