{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper — Subtitles, SRT/VTT & RAG Chunks",
    "description": "Scrape YouTube transcripts and subtitles from any video, playlist or channel. Export text, SRT, VTT or timestamped chunks for RAG and LLM datasets.",
    "version": "1.0",
    "x-build-id": "067f9YJUiWdUjDauZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/spool~youtube-transcript-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-spool-youtube-transcript-api",
        "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/spool~youtube-transcript-api/runs": {
      "post": {
        "operationId": "runs-sync-spool-youtube-transcript-api",
        "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/spool~youtube-transcript-api/run-sync": {
      "post": {
        "operationId": "run-sync-spool-youtube-transcript-api",
        "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": [
          "videoUrls"
        ],
        "properties": {
          "videoUrls": {
            "title": "YouTube videos, channels or playlists",
            "minItems": 1,
            "type": "array",
            "description": "Paste any mix of: video URLs or IDs, playlist URLs, channel URLs (`/@handle`, `/channel/UC...`, `/c/name`). Channels and playlists are expanded automatically into their videos. Accepts watch links, youtu.be, Shorts, embed and live URLs. Duplicates are removed.",
            "default": [
              "https://www.youtube.com/watch?v=aircAruvnKk"
            ],
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Language codes in priority order, e.g. `en`, `es`, `fr`. The first available match wins; a manually written track is always preferred over an auto-generated one in the same language.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "includeAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "Use YouTube's automatic speech recognition when no human-written captions exist. Turn this off if you only want human-verified text.",
            "default": true
          },
          "removeCaptionCredits": {
            "title": "Remove caption credits",
            "type": "boolean",
            "description": "Strip translator and reviewer credits from the start and end of the transcript (e.g. \"Translator: … Reviewer: …\", \"Subtitles by the Amara.org community\"). These are not spoken content and pollute the first RAG chunk. Only the first and last few cues are checked.",
            "default": true
          },
          "translateTo": {
            "title": "Translate captions to",
            "type": "string",
            "description": "Language code to translate captions into, e.g. `fr`, `ar`, `es`, `de`. Uses YouTube's own caption translation, so timestamps are preserved exactly. Leave empty for the original language. Ignored for tracks YouTube marks as untranslatable.",
            "default": ""
          },
          "maxVideosPerSource": {
            "title": "Max videos per channel/playlist",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Caps how many videos are taken from EACH channel or playlist. Protects you from accidentally billing a 5,000-video channel. Individual video URLs are never capped.",
            "default": 50
          },
          "chunkTranscript": {
            "title": "Split into RAG chunks",
            "type": "boolean",
            "description": "Produce overlapping chunks sized for embedding models. Each chunk keeps its start and end timestamp so retrieved passages stay citable back to the exact moment in the video.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 100,
            "maximum": 10000,
            "type": "integer",
            "description": "Target characters per chunk. Roughly 1000 characters is about 250 tokens, which suits most embedding models.",
            "default": 1000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Characters repeated between consecutive chunks so a sentence split across a boundary is not lost. Typically 10-20% of chunk size.",
            "default": 150
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "both",
              "text",
              "chunks"
            ],
            "type": "string",
            "description": "What text to include in each result.",
            "default": "both"
          },
          "includeSegments": {
            "title": "Include raw timed segments",
            "type": "boolean",
            "description": "Add the caption cue list with per-line start times and durations. Useful for building subtitle files or precise seeking; makes the dataset considerably larger.",
            "default": false
          },
          "subtitleFormat": {
            "title": "Subtitle files",
            "enum": [
              "none",
              "srt",
              "vtt",
              "both"
            ],
            "type": "string",
            "description": "Also produce ready-to-use subtitle files. SRT suits most video editors and players; VTT is the web standard for HTML5 video.",
            "default": "none"
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many videos to fetch in parallel. Higher values are faster but more likely to hit YouTube rate limits. 3 is a safe default; raise it if your runs stay clean.",
            "default": 3
          },
          "maxRetries": {
            "title": "Max retries per video",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Retry attempts for transient failures such as rate limiting or IP blocks. Blocked retries automatically switch to residential proxy. Permanent conditions (no captions, private video) are never retried.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "YouTube blocks plain datacenter IPs, so Apify Proxy is enabled by default. Residential proxy improves reliability on large runs.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}