{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper & API - Chunked for RAG",
    "description": "YouTube transcripts that arrive already chunked for RAG, each chunk carrying a youtu.be?t= link back to the second it was said. Also an MCP server: get_transcript and get_chunks from Claude or Cursor. Videos, channels, playlists, searches. Never charges for a video it could not transcribe.",
    "version": "0.1",
    "x-build-id": "lBqRGwaWBRyPF6coz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/darius.c.andrei~youtube-transcripts-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-darius.c.andrei-youtube-transcripts-rag",
        "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/darius.c.andrei~youtube-transcripts-rag/runs": {
      "post": {
        "operationId": "runs-sync-darius.c.andrei-youtube-transcripts-rag",
        "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/darius.c.andrei~youtube-transcripts-rag/run-sync": {
      "post": {
        "operationId": "run-sync-darius.c.andrei-youtube-transcripts-rag",
        "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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Videos, channels, playlists or search result pages. A channel or playlist is expanded into its videos; a watch URL that happens to carry a &list= is treated as the single video, not the playlist.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxVideos": {
            "title": "Max videos per URL",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap per input URL. Also caps the paging, so a smaller number is a faster run. YouTube's own ceilings apply above this: playlist and channel paging stops at 20,000 videos, and a search goes dry at about 260 results however high you set this.",
            "default": 50
          },
          "language": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Language codes, best first, e.g. en, de, pt-BR. Leave empty to take whatever language the video is in. A regional code matches its base language both ways: en answers en-GB.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "languageFallback": {
            "title": "If the preferred language is missing",
            "enum": [
              "translated",
              "auto-generated",
              "manual-only"
            ],
            "type": "string",
            "description": "How far to fall back. Machine translation is last because it is the lowest-quality answer. With no preferred language set, this only decides whether auto-generated captions are acceptable.",
            "default": "translated"
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "What each dataset row carries. Plain text is the default; JSON adds the timed segments; SRT and WebVTT add subtitle files. Chunks are controlled separately below.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "json",
                "srt",
                "vtt"
              ],
              "enumTitles": [
                "Plain text transcript",
                "JSON timed segments",
                "SRT subtitles",
                "WebVTT subtitles"
              ]
            },
            "default": [
              "text"
            ]
          },
          "includeChunks": {
            "title": "Include RAG chunks",
            "type": "boolean",
            "description": "Split the transcript into overlapping chunks, each with its own youtu.be?t= link back to the moment it starts. This is what makes the output ingestible without a second pass.",
            "default": true
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 32,
            "type": "integer",
            "description": "Target length per chunk in approximate tokens, estimated as words / 0.75 — we do not ship a tokenizer, because its vocabulary would have to match whatever model you use. Caption segments are atomic, so a chunk ends on a segment boundary and the real size lands near this rather than on it.",
            "default": 512
          },
          "chunkOverlap": {
            "title": "Chunk overlap",
            "minimum": 0,
            "type": "integer",
            "description": "Approximate tokens repeated from the end of the previous chunk, so a sentence split across two chunks is still retrievable from either. Must be smaller than the chunk size; it is clamped to half of it if not.",
            "default": 64
          },
          "chunkBoundary": {
            "title": "Chunk boundary",
            "enum": [
              "sentence",
              "chapter",
              "none"
            ],
            "type": "string",
            "description": "Where a chunk is allowed to end. Chapter boundaries need timestamps in the video description; videos without them fall back to sentences.",
            "default": "sentence"
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave this alone unless you know you need to change it. YouTube serves datacenter addresses for about twenty videos and then answers every request with a bot check, so residential is the default and is what the published reliability number was measured on. Turning the proxy off makes the run come from Apify's own addresses, which is the case that does not work.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}