{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Transcript Scraper With AI Enrichment",
    "description": "Scrapes transcripts from any YouTube video, capturing full text, timestamps, language, and metadata. Ideal for SEO research, content analysis, accessibility, subtitle extraction, and automated processing of large video libraries with accurate transcript output",
    "version": "0.1",
    "x-build-id": "4lLe7ORWhByrKLdsz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapio~youtube-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapio-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/scrapio~youtube-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapio-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/scrapio~youtube-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapio-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": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "🔗 YouTube Video / Channel / Playlist URLs or IDs",
            "type": "array",
            "description": "📋 Enter YouTube video URLs, 11-char video IDs, Shorts/embed/live links, OR channel/playlist URLs. Containers are expanded to their videos (see Max Videos per Channel/Playlist).",
            "items": {
              "type": "string"
            }
          },
          "preferredLanguages": {
            "title": "🌍 Preferred Languages (allowlist, in priority order)",
            "type": "array",
            "description": "🎯 ISO language codes (e.g. en, es, fr, de). The first available match wins; matched authoritatively on languageCode (not display-name substrings). Leave empty to auto-pick the best track (manual English → any manual → best generated).",
            "items": {
              "type": "string"
            }
          },
          "transcriptType": {
            "title": "📝 Transcript Type",
            "enum": [
              "any",
              "manualOnly",
              "autoOnly"
            ],
            "type": "string",
            "description": "Choose which caption tracks to consider, using the library's authoritative is_generated flag. 'any' = manual or auto; 'manualOnly' = human-written only; 'autoOnly' = auto-generated only.",
            "default": "any"
          },
          "translateTo": {
            "title": "🌐 Translate Transcript To",
            "type": "string",
            "description": "Optional ISO code (e.g. en, es) to translate the selected transcript into via YouTube's translate() — only works when the track isTranslatable. Leave empty for no translation.",
            "default": ""
          },
          "includeSegments": {
            "title": "⏱️ Include Timestamped Segments",
            "type": "boolean",
            "description": "Include the per-segment array (start, duration, end, hh:mm:ss timestamp, text, deep-link URL). Plain text is always included.",
            "default": true
          },
          "includeSrt": {
            "title": "🎞️ Include SRT Output",
            "type": "boolean",
            "description": "Include a ready-to-use SRT subtitle string in each row.",
            "default": true
          },
          "includeVtt": {
            "title": "📺 Include WebVTT Output",
            "type": "boolean",
            "description": "Include a ready-to-use WebVTT subtitle string in each row.",
            "default": true
          },
          "maxVideosPerChannel": {
            "title": "📺 Max Videos per Channel / Playlist",
            "minimum": 1,
            "type": "integer",
            "description": "When a channel or playlist URL is provided, scrape up to this many of its videos.",
            "default": 10
          },
          "concurrency": {
            "title": "⚡ Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many videos to process in parallel. Higher is faster but uses more proxy bandwidth.",
            "default": 5
          },
          "aiEnhancement": {
            "title": "🤖 AI Enrichment (summary, key points, topics, chapters)",
            "type": "boolean",
            "description": "Add an AI-generated summary, key points, topic tags, and chapters to each transcript using the provider you choose below. Requires an API key for that provider. Off by default.",
            "default": false
          },
          "aiModel": {
            "title": "🤖 AI Model / Provider",
            "enum": [
              "claude-haiku-4-5",
              "claude-sonnet-5",
              "claude-opus-4-8",
              "claude-fable-5",
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1-mini",
              "gpt-4.1",
              "o3-mini",
              "o1",
              "gemini-2.0-flash-lite",
              "gemini-2.0-flash",
              "gemini-2.5-flash",
              "gemini-2.5-pro",
              "grok-3-mini",
              "grok-3",
              "deepseek-chat",
              "deepseek-reasoner",
              "sonar",
              "sonar-pro",
              "mistral-small-latest",
              "mistral-large-latest"
            ],
            "type": "string",
            "description": "Provider auto-detected from the name: claude-* = Anthropic, gpt-*/o1/o3 = OpenAI, gemini-* = Google, grok-* = xAI, deepseek-* = DeepSeek, sonar* = Perplexity, mistral-* = Mistral.",
            "default": "claude-haiku-4-5"
          },
          "aiApiKey": {
            "title": "🔑 AI Provider API Key",
            "type": "string",
            "description": "API key for the selected provider. Falls back to an env var: ANTHROPIC_API_KEY (Claude), OPENAI_API_KEY (OpenAI), GEMINI_API_KEY/GOOGLE_API_KEY (Gemini), XAI_API_KEY/GROK_API_KEY (Grok), DEEPSEEK_API_KEY (DeepSeek), PERPLEXITY_API_KEY/PPLX_API_KEY (Perplexity), or MISTRAL_API_KEY (Mistral)."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "🛡️ YouTube blocks datacenter IPs for transcripts — Apify Residential Proxy is used by default. Open only to change groups or disable.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}