{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper — Text, Metadata & Chapters",
    "description": "Fetch YouTube transcripts, timestamped segments, video metadata and chapters as clean JSON for RAG, LLMs, spreadsheets and AI agents. Built for fast, reliable bulk runs at scale.",
    "version": "0.1",
    "x-build-id": "Ggr65T3lb9nh7uWWW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/t2solutions~youtube-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-t2solutions-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/t2solutions~youtube-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-t2solutions-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/t2solutions~youtube-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-t2solutions-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",
        "required": [
          "videos"
        ],
        "properties": {
          "videos": {
            "title": "Videos",
            "minItems": 1,
            "maxItems": 1000,
            "uniqueItems": false,
            "type": "array",
            "description": "YouTube videos to fetch: watch URLs, youtu.be links, /shorts/, /embed/ or /live/ links, or bare 11-character video IDs (1-1,000 unique videos). One dataset row is delivered per submitted entry: a transcript row when the transcript is delivered, a status row ({videoId, url, status}) when it is not, or a free invalid_input row ({url, inputIndex, status, reason}) when the entry is not a YouTube link. Duplicates are collapsed in input order. Billed: delivered transcripts and content-outcome statuses (no_captions, unavailable, no_requested_language, age_restricted); free: infrastructure failures and invalid_input. A batch of bad links never fails the run.",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "preferredLanguage": {
            "title": "Preferred transcript language",
            "enum": [
              "af",
              "sq",
              "am",
              "ar",
              "hy",
              "as",
              "az",
              "eu",
              "be",
              "bn",
              "bs",
              "bg",
              "my",
              "ca",
              "ceb",
              "zh",
              "zh-CN",
              "zh-TW",
              "zh-Hans",
              "zh-Hant",
              "co",
              "hr",
              "cs",
              "da",
              "nl",
              "en",
              "en-GB",
              "en-US",
              "en-AU",
              "en-CA",
              "en-IN",
              "eo",
              "et",
              "fil",
              "fi",
              "fr",
              "fr-CA",
              "gl",
              "ka",
              "de",
              "el",
              "gu",
              "ht",
              "ha",
              "haw",
              "iw",
              "hi",
              "hmn",
              "hu",
              "is",
              "ig",
              "id",
              "ga",
              "it",
              "ja",
              "jv",
              "kn",
              "kk",
              "km",
              "rw",
              "ko",
              "ku",
              "ky",
              "lo",
              "la",
              "lv",
              "lt",
              "lb",
              "mk",
              "mg",
              "ms",
              "ml",
              "mt",
              "mi",
              "mr",
              "mn",
              "ne",
              "no",
              "ny",
              "or",
              "ps",
              "fa",
              "fa-IR",
              "pl",
              "pt",
              "pt-BR",
              "pt-PT",
              "pa",
              "ro",
              "ru",
              "sm",
              "gd",
              "sr",
              "st",
              "sn",
              "sd",
              "si",
              "sk",
              "sl",
              "so",
              "es",
              "es-419",
              "es-ES",
              "es-MX",
              "su",
              "sw",
              "sv",
              "tg",
              "ta",
              "tt",
              "te",
              "th",
              "tr",
              "tk",
              "uk",
              "ur",
              "ug",
              "uz",
              "vi",
              "cy",
              "xh",
              "yi",
              "yo",
              "zu",
              "other"
            ],
            "type": "string",
            "description": "Choose the transcript language from the dropdown. Each option shows its YouTube language code in parentheses (Czech is cs, not the country code CZ); pick Other to enter a code that is not listed. Manual captions beat auto-generated (ASR) for the same language; a regional match (en-US/en-GB) and then the base language (en for en-US) are tried before the any-language fallback.",
            "default": "en"
          },
          "preferredLanguageCustom": {
            "title": "Other language code (optional)",
            "maxLength": 20,
            "type": "string",
            "description": "Used only when Preferred transcript language is Other. Enter an ISO/YouTube code such as en-US, zh-Hans or pt-PT. Ignored for the listed languages."
          },
          "fallbackToAnyLanguage": {
            "title": "Fall back to any available language",
            "type": "boolean",
            "description": "When the preferred language is unavailable, take the first manual track (or the first track) instead of recording no_requested_language. Must be a real boolean. Default: true.",
            "default": true
          },
          "includeTimestamps": {
            "title": "Include timestamped segments",
            "type": "boolean",
            "description": "Include the segments array ([{start, duration, end, text}]) alongside the plain transcriptText. segmentCount is always reported. Must be a real boolean. Default: true.",
            "default": true
          },
          "includeChapters": {
            "title": "Include video chapters (extra request)",
            "type": "boolean",
            "description": "Extract creator-added chapter markers ({title, startSeconds, timeText}; timeText is nullable when YouTube omits it). Chapters exist only when the creator added them; a video without chapters yields chapters: []. If chapter markers cannot be retrieved, chapters stays [] and the reason is recorded in RUN_SUMMARY.chaptersUnavailable. Default: false.",
            "default": false
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of unique videos processed in one run (1..1000). Videos beyond this cap are counted in RUN_SUMMARY.videosSkippedOverCap and the state becomes partial with partialReason video_cap. At the defaults (25-minute deadline, 4 workers, 1.5 s pacing) 1,000 videos fit comfortably; with 1 worker, 1,000 needs a longer deadline. Default: 100.",
            "default": 100
          },
          "concurrency": {
            "title": "Parallel workers",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many videos are processed in parallel (1..8, clamped at run time). Each worker keeps its own pacing gap, so the batch finishes about concurrency times faster while every network lane still sees the same per-IP request rate. The effective value is capped by the number of healthy network lanes available to the run. Set 1 for the old sequential behavior when isolating a problem. An out-of-range value is clamped and recorded in the run notes. Default: 4.",
            "default": 4
          },
          "pacingSeconds": {
            "title": "Pacing between videos (seconds)",
            "minimum": 0.5,
            "maximum": 30,
            "type": "number",
            "description": "Delay between videos for each worker in seconds (0.5..30, clamped at run time). The gap is per worker: the aggregate launch rate is concurrency / pacingSeconds, while each exit IP keeps the same per-IP rate. Default: 1.5.",
            "default": 1.5
          },
          "maxDurationMinutes": {
            "title": "Fail-safe deadline (minutes)",
            "minimum": 1,
            "maximum": 59,
            "type": "number",
            "description": "Hard wall for the whole run, 1..59 minutes (clamped). On expiry running stops, transcripts already delivered are kept, and RUN_SUMMARY records state timed_out with partialReason deadline. A single stalled video is capped at 20 seconds (reported as video_timeout), so it cannot consume the run. Budget roughly maxVideos x (1.6 + pacingSeconds) / concurrency seconds plus slow-video headroom; the defaults comfortably fit 1,000 videos. Default: 25.",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}