{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript & RAG Chunker",
    "description": "Get the full transcript of any YouTube video, playlist, channel or search - as plain text, SRT/VTT, or RAG-ready token-window chunks (overlap, dedup, token counts, deep links). Transcript-only or transcript + chunks, your choice. Multi-language + translation. Per-video pricing.",
    "version": "0.2",
    "x-build-id": "ZL8qN6aVqFhPxwK2g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leaderly_jackpine~youtube-rag-transcripts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leaderly_jackpine-youtube-rag-transcripts",
        "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/leaderly_jackpine~youtube-rag-transcripts/runs": {
      "post": {
        "operationId": "runs-sync-leaderly_jackpine-youtube-rag-transcripts",
        "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/leaderly_jackpine~youtube-rag-transcripts/run-sync": {
      "post": {
        "operationId": "run-sync-leaderly_jackpine-youtube-rag-transcripts",
        "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": {
          "startUrls": {
            "title": "Start URLs",
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "description": "YouTube video (youtube.com/watch?v=... or youtu.be/...), playlist (youtube.com/playlist?list=...), channel (youtube.com/@handle, /channel/UC..., /c/Name or /user/Name, with or without /videos) or search (youtube.com/results?search_query=) URLs.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries (optional)",
            "maxItems": 100,
            "type": "array",
            "description": "Free-text search queries; each is run on YouTube and its result videos are enqueued (capped by maxVideos).",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Preferred caption languages",
            "type": "array",
            "description": "Preferred caption languageCodes in priority order (e.g. ['en','en-US']). The first match present on the video wins.",
            "items": {
              "type": "string"
            }
          },
          "captionPreference": {
            "title": "Caption preference",
            "enum": [
              "manual",
              "auto"
            ],
            "type": "string",
            "description": "manual = prefer human captions, fall back to auto-generated (ASR); auto = prefer ASR.",
            "default": "manual"
          },
          "translateTo": {
            "title": "Translate to (optional)",
            "type": "string",
            "description": "Optional translation languageCode appended as &tlang to the caption baseUrl (e.g. 'es'). When set, the chosen track is translated into this language."
          },
          "chunkSizeTokens": {
            "title": "Chunk size (tokens)",
            "minimum": 128,
            "maximum": 8192,
            "type": "integer",
            "description": "Target maximum tokens per chunk in tokenWindow mode (128-8192). Chunks are segment-aligned so a chunk may slightly exceed this when a single caption segment is larger.",
            "default": 512
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 512,
            "type": "integer",
            "description": "Overlap tokens carried into the next chunk in tokenWindow mode (0-512). Must be smaller than chunk size.",
            "default": 64
          },
          "chunkingMode": {
            "title": "Chunking mode",
            "enum": [
              "tokenWindow",
              "timestampWindow"
            ],
            "type": "string",
            "description": "tokenWindow = greedily pack segments up to chunk size with overlap; timestampWindow = one chunk per fixed-length time window.",
            "default": "tokenWindow"
          },
          "timestampWindowSeconds": {
            "title": "Timestamp window (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Length of each time window in timestampWindow mode (10-600).",
            "default": 60
          },
          "tokenizerModel": {
            "title": "Tokenizer",
            "enum": [
              "o200k_base",
              "cl100k_base"
            ],
            "type": "string",
            "description": "Tokenizer used for token counts. o200k_base matches GPT-4o/4.1/o-series; cl100k_base matches GPT-4/3.5. Note: counts are estimates for non-OpenAI models (Claude/embeddings may differ 5-15%).",
            "default": "o200k_base"
          },
          "outputFormats": {
            "title": "Output formats",
            "uniqueItems": true,
            "type": "array",
            "description": "What to emit per video. chunkRows = flat chunk rows (one per line, free, ideal for JSONL/RAG ingestion); json = per-video summary row with nested chunks (charged); srt/vtt/txt = subtitle/plain-text transcript attached to the summary row; markdown = transcript with timestamp headings + deep links.",
            "items": {
              "type": "string"
            },
            "default": [
              "chunkRows",
              "json"
            ]
          },
          "includeRagChunks": {
            "title": "Include RAG chunks",
            "type": "boolean",
            "description": "ON (default) = transcript + RAG-ready token-window chunks (flat chunk rows per video). OFF = transcript-only mode: one clean row per video with the full transcript (no chunk rows, no chunking). Use OFF when you just want the transcript text of each video.",
            "default": true
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on the number of videos processed across all sources (1-1000). Listing videos beyond this are skipped.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy. Residential with US country pin is the default: datacenter egress can be bot-flagged and silently return no captionTracks.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}