{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcripts for RAG",
    "description": "Turn YouTube videos into retrieval-ready text. Per video you get a full plain transcript plus token-bounded chunks (real cl100k tokens, your size and overlap) each carrying start and end timestamps, a deep link to the moment, and a deterministic chunk id for idempotent upserts. No API key, no proxy.",
    "version": "0.1",
    "x-build-id": "F0UydJ8zhOnbVNWes"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/omargnagy~youtube-transcripts-for-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-omargnagy-youtube-transcripts-for-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/omargnagy~youtube-transcripts-for-rag/runs": {
      "post": {
        "operationId": "runs-sync-omargnagy-youtube-transcripts-for-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/omargnagy~youtube-transcripts-for-rag/run-sync": {
      "post": {
        "operationId": "run-sync-omargnagy-youtube-transcripts-for-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": [
          "videos"
        ],
        "properties": {
          "videos": {
            "title": "YouTube videos",
            "type": "array",
            "description": "Video URLs or 11-character video ids, one per line. Watch links, youtu.be links, Shorts, embed and live links all work. Required in every mode. Duplicates are removed and the original order is kept. An entry that is not a YouTube video reference fails the run with a readable message instead of being silently skipped.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "chunks",
              "transcript",
              "languages"
            ],
            "type": "string",
            "description": "chunks = full transcript plus token-bounded chunks. transcript = full transcript only, no chunks. languages = list the caption languages a video has, without downloading any transcript (this mode is not charged). Any other value is rejected as a bad request.",
            "default": "chunks"
          },
          "languages": {
            "title": "Language fallback chain",
            "type": "array",
            "description": "Caption languages to try, in order. Each code is matched exactly first, then by prefix, so \"en\" also accepts \"en-GB\". The first code that the video actually has wins, and the output records which codes were tried. Ignored when mode = languages.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowAutoGenerated": {
            "title": "Allow auto-generated captions",
            "type": "boolean",
            "description": "On: YouTube's speech-recognition captions count as a valid track. Off: only human-written caption tracks are accepted, and a video that has nothing else is reported as an error record rather than returning machine text you did not ask for. Ignored when mode = languages.",
            "default": true
          },
          "allowAnyLanguage": {
            "title": "Fall back to any available language",
            "type": "boolean",
            "description": "On: when none of the codes in the fallback chain is available, take the video's first caption track anyway. Off (default): report the video as an error listing the languages it does have. Ignored when mode = languages.",
            "default": false
          },
          "chunkTokens": {
            "title": "Chunk size in tokens",
            "minimum": 50,
            "maximum": 4000,
            "type": "integer",
            "description": "Maximum tokens per chunk, counted with the cl100k_base encoding used by OpenAI's text-embedding-3 and GPT-4 class models. Only used when mode = chunks. A chunk never exceeds this number.",
            "default": 400
          },
          "chunkOverlapTokens": {
            "title": "Chunk overlap in tokens",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Tokens repeated from the end of one chunk at the start of the next, so a sentence split across a boundary still retrieves. Must be smaller than the chunk size. Set 0 for no overlap. Only used when mode = chunks.",
            "default": 40
          },
          "includeFullTranscript": {
            "title": "Include the full transcript on the video record",
            "type": "boolean",
            "description": "On: the one video record per video also carries the whole transcript as plain text. Turn it off when you only want the chunks and do not want the transcript duplicated in the dataset. Always on when mode = transcript.",
            "default": true
          },
          "maxVideos": {
            "title": "Max videos per run",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Safety cap. Videos beyond this count are dropped from the list before any request is made.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "YouTube refuses caption metadata to datacenter IPs, including Apify's, so the one request that reads a video's caption list goes through a residential exit. Leave this on the RESIDENTIAL group unless you know your egress is not gated. The caption text itself is downloaded without the proxy, so a run spends about 44 KB of residential bandwidth per video, not the whole transcript.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "residentialBudgetMb": {
            "title": "Residential bandwidth budget (MB per run)",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard ceiling on residential proxy traffic for this run. When it is reached the run stops cleanly: videos already done keep their records, every remaining video gets an explicit budget_exceeded record, and nothing further is charged. Measured at about 0.043 MB per video, so the default covers roughly 4,600 videos.",
            "default": 200
          },
          "debugConnectivity": {
            "title": "Log connectivity diagnostics",
            "type": "boolean",
            "description": "Operator flag. Logs each caption-discovery attempt with its HTTP status and the playability status YouTube reported, so a blocked network can be diagnosed from the run log. Does not change the output records.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}