{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper - Bulk Subtitles, SRT & RAG Chunks",
    "description": "Extract YouTube transcripts in bulk from videos, playlists, channels, @handles or searches. Timestamped segments, plain text, SRT, VTT and RAG-ready chunks, in any caption language, with optional translation.",
    "version": "0.1",
    "x-build-id": "uKeIJTzaib4d5QJuQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamill~youtube-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamill-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/datamill~youtube-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-datamill-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/datamill~youtube-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-datamill-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": {
          "videoUrls": {
            "title": "YouTube videos, playlists, channels or searches",
            "type": "array",
            "description": "Paste anything YouTube: video URLs or IDs, `youtu.be` and `/shorts/` links, playlist URLs, channel URLs, `@handles`, or a search with `ytsearch:your query`. Playlists, channels and searches are expanded into their videos automatically, up to **Max videos**.",
            "default": [
              "https://www.youtube.com/watch?v=jNQXAC9IVRw"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on how many videos this run will process. Protects you from accidentally pulling an entire channel.",
            "default": 100
          },
          "preferredLanguages": {
            "title": "Preferred caption languages",
            "type": "array",
            "description": "Language codes in priority order, e.g. `en`, `ja`, `es`. The first available track wins; `en` also matches `en-GB`. If none match, the video's default track is used.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "includeAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "Most videos only have YouTube's automatic captions. Turn this off to accept human-written subtitles only.",
            "default": true
          },
          "translateTo": {
            "title": "Translate captions to",
            "type": "string",
            "description": "Optional language code (e.g. `ja`, `es`, `de`) to have YouTube translate the captions. If translation is rate limited, you still get the original transcript plus a `translationError` note."
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "Which representations to include per video. `chunks` produces overlapping passages sized for embeddings, each with its own timestamped YouTube link.",
            "items": {
              "type": "string",
              "enum": [
                "segments",
                "text",
                "srt",
                "vtt",
                "chunks"
              ],
              "enumTitles": [
                "Timestamped segments",
                "Plain text",
                "SRT subtitle file",
                "WebVTT subtitle file",
                "RAG chunks (for embeddings)"
              ]
            },
            "default": [
              "segments",
              "text"
            ]
          },
          "chunkCharacters": {
            "title": "Chunk size (characters)",
            "minimum": 100,
            "maximum": 20000,
            "type": "integer",
            "description": "Target size of each RAG chunk. Only used when `chunks` is selected. Chunks never split a caption line, so timestamps stay exact.",
            "default": 1200
          },
          "chunkOverlapCharacters": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "How much text each chunk repeats from the previous one, so meaning is not cut at a boundary.",
            "default": 150
          },
          "includeMetadata": {
            "title": "Include video metadata",
            "type": "boolean",
            "description": "Adds title, channel, duration, view count and thumbnail to every item.",
            "default": true
          },
          "includeDescription": {
            "title": "Include description and keywords",
            "type": "boolean",
            "description": "Adds the full video description and tags. Off by default because descriptions can be very long.",
            "default": false
          },
          "skipVideosWithoutCaptions": {
            "title": "Skip videos without captions",
            "type": "boolean",
            "description": "When on, videos with no captions are left out of the dataset entirely instead of being reported with a `no_captions` status.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Videos fetched in parallel. Lower this if you hit YouTube rate limits on very large runs.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "**Keep residential proxy enabled.** YouTube blocks datacenter IPs with \"Sign in to confirm you're not a bot\", so runs without a residential proxy will fail. Residential traffic costs roughly $0.0005 per transcript.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}