{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript & Subtitles (SRT, VTT)",
    "description": "Get YouTube video transcripts as text, timestamped segments, SRT or VTT. One row per video, in input order; failed videos get a clear error and are not charged.",
    "version": "1.0",
    "x-build-id": "LjjnEqpZC5yIx48vw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oas_built~youtube-transcripts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oas_built-youtube-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/oas_built~youtube-transcripts/runs": {
      "post": {
        "operationId": "runs-sync-oas_built-youtube-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/oas_built~youtube-transcripts/run-sync": {
      "post": {
        "operationId": "run-sync-oas_built-youtube-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": {
          "videos": {
            "title": "Videos",
            "maxItems": 100,
            "type": "array",
            "description": "YouTube video links or 11-character IDs, up to 100. Accepts watch, youtu.be, Shorts and embed links. Each entry normally gets one output row. Charged once per transcript; error rows are free.",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "title": "Channels",
            "maxItems": 5,
            "type": "array",
            "description": "Up to 5 channels as a link, @handle or UC… channel ID. Each adds its latest uploads after your video list. A channel that can't be read gets one CHANNEL_UNAVAILABLE row (free) and the run continues.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxVideosPerChannel": {
            "title": "Latest videos per channel",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "How many of each channel's latest uploads to add, newest first. Each one that returns a transcript is charged once.",
            "default": 10
          },
          "languages": {
            "title": "Preferred languages",
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "description": "Language codes in order of preference, e.g. en, es-419, zh-Hans. Creator captions are preferred within each language. With auto-generated captions on, an unmatched video may return another transcript (languageMatched false); otherwise LANGUAGE_NOT_FOUND.",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$"
            },
            "default": [
              "en"
            ]
          },
          "includeAutoGenerated": {
            "title": "Include auto-generated captions",
            "type": "boolean",
            "description": "Auto-generated captions are allowed by default. Turn this off for creator captions only; videos without a fitting creator track get a free LANGUAGE_NOT_FOUND row listing the available languages.",
            "default": true
          },
          "outputFormats": {
            "title": "Output formats",
            "minItems": 1,
            "type": "array",
            "description": "Which transcript fields to fill: plain text, timestamped segments, SRT, WebVTT. The price per transcript is the same for any combination.",
            "items": {
              "type": "string",
              "enum": [
                "text",
                "segments",
                "srt",
                "vtt"
              ],
              "enumTitles": [
                "Plain text",
                "Timestamped segments",
                "SRT subtitles",
                "WebVTT subtitles"
              ]
            },
            "default": [
              "text",
              "segments"
            ]
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Process at most this many unique videos (videos plus channel uploads). Entries beyond it get a free OVER_MAX_VIDEOS row. Use it to cap what one run can charge.",
            "default": 100
          },
          "concurrency": {
            "title": "Parallel videos",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "How many videos to fetch at the same time. 1 is the safest; 2 or 3 make large batches faster. Rows stay in input order, and the price per transcript is the same.",
            "default": 1
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "A proxy is required. Keep the default: it is the setting the Actor is tested with. Turning the proxy off stops the run before anything is fetched.",
            "default": {
              "useApifyProxy": true
            }
          },
          "useCache": {
            "title": "Use transcript cache",
            "type": "boolean",
            "description": "Save transcripts in a named store in your own Apify account and reuse them on later runs. Cached transcripts are free and need no YouTube request. Off by default; storage is billed to your account.",
            "default": false
          },
          "maxAgeDays": {
            "title": "Max cache age (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "With the cache on, reuse a saved transcript only if it is at most this many days old; older ones are fetched again (charged) and replaced. 0 = always fetch fresh, but still save.",
            "default": 90
          },
          "cacheStoreName": {
            "title": "Cache store name",
            "pattern": "^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$",
            "type": "string",
            "description": "Name of the key-value store in your account that holds the cache. 1–63 letters, digits or hyphens; no leading or trailing hyphen.",
            "default": "yt-transcripts-cache"
          },
          "errorCacheHours": {
            "title": "Error cache (hours)",
            "minimum": 0,
            "maximum": 168,
            "type": "integer",
            "description": "Remember videos that came back UNAVAILABLE or NO_CAPTIONS for this many hours, so a rerun returns the same free error row without asking YouTube again. 0 = off.",
            "default": 24
          },
          "useHelperCache": {
            "title": "Use helper caches",
            "type": "boolean",
            "description": "Remember error results (see Error cache) and each @handle's channel ID in your account. Stores no transcript text. Off = no helper reads or writes.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}