{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper – Timestamped JSON for RAG",
    "description": "Scrape YouTube transcripts with timestamps, chapters and video metadata as RAG-ready JSON chunks. Bulk video, playlist or channel URLs. No API key.",
    "version": "0.1",
    "x-build-id": "CMdOcplQHvf4az3r7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leadsbrary~youtube-transcript-rag-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leadsbrary-youtube-transcript-rag-feed",
        "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/leadsbrary~youtube-transcript-rag-feed/runs": {
      "post": {
        "operationId": "runs-sync-leadsbrary-youtube-transcript-rag-feed",
        "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/leadsbrary~youtube-transcript-rag-feed/run-sync": {
      "post": {
        "operationId": "run-sync-leadsbrary-youtube-transcript-rag-feed",
        "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": "Video / playlist / channel URLs",
            "type": "array",
            "description": "YouTube video, playlist or channel URLs. Playlist and channel URLs are expanded into their videos (up to maxResults).",
            "items": {
              "type": "string"
            }
          },
          "videoIds": {
            "title": "Bare video ids",
            "type": "array",
            "description": "11-character YouTube video ids, as an alternative to full URLs.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Preferred caption language codes in priority order. The first available track wins; if none match, the default track is used unless strictLanguage is true.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "strictLanguage": {
            "title": "Strict language match",
            "type": "boolean",
            "description": "If true, videos with no caption track in the requested languages get transcriptStatus=\"language_unavailable\" instead of falling back to the default track.",
            "default": false
          },
          "allowAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "Whether YouTube's automatic speech-recognition caption tracks may be used when no human-authored track exists.",
            "default": true
          },
          "includeSegments": {
            "title": "Include cue-level segments",
            "type": "boolean",
            "description": "Include the raw cue-level transcript segments with start/end seconds. Disable to keep dataset items small.",
            "default": true
          },
          "includeChunks": {
            "title": "Include RAG chunks",
            "type": "boolean",
            "description": "Include RAG chunks: cues merged into embedding-sized text blocks with stable ids, timestamps and deep-link URLs.",
            "default": true
          },
          "chunkMaxChars": {
            "title": "Chunk max characters",
            "minimum": 200,
            "maximum": 8000,
            "type": "integer",
            "description": "Target maximum characters per RAG chunk (chunks break on cue boundaries, so the real size may be slightly under).",
            "default": 1200
          },
          "chunkOverlapChars": {
            "title": "Chunk overlap characters",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Characters of overlap carried from the end of one chunk into the next, to avoid cutting sentences across chunk boundaries.",
            "default": 100
          },
          "respectChapters": {
            "title": "Respect chapter boundaries",
            "type": "boolean",
            "description": "When chapters are detected, never let a chunk span two chapters and tag each chunk with its chapter title.",
            "default": true
          },
          "includeChapters": {
            "title": "Include chapters",
            "type": "boolean",
            "description": "Parse the video's chapter markers (from the public description) into a chapters array.",
            "default": true
          },
          "includeVideoMetadata": {
            "title": "Include video metadata",
            "type": "boolean",
            "description": "Include normalized video metadata (title, channel, publish date, duration, view count, description, keywords) in each item.",
            "default": true
          },
          "textFormats": {
            "title": "Extra text formats",
            "type": "array",
            "description": "Extra plain-text renderings to attach alongside the JSON.",
            "items": {
              "type": "string",
              "enum": [
                "plain",
                "srt",
                "vtt",
                "markdown"
              ],
              "enumTitles": [
                "Plain text",
                "SRT",
                "WebVTT",
                "Markdown"
              ]
            },
            "default": [
              "plain"
            ]
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of videos to process in the run (safety cap on cost). 0 means no limit.",
            "default": 25
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum parallel requests. Lower it if YouTube starts rate-limiting.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy settings. Defaults to Residential proxies: YouTube blocks the shared datacenter pool with a \"Sign in to confirm you're not a bot\" challenge. Datacenter proxies can still be selected manually to cut cost, at the risk of that block.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}