{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube MCP Transcript & AI Chapter — Analytics",
    "description": "Skyfire/x402 payment-ready YouTube transcripts + AI auto-chapters + channel analytics at $0.003/video — 99%+ run success. RAG-ready, MCP-native. Replaces Rev.com $90/hr + vidIQ + Otter.ai/Sonix/Descript. 5 LLMs, 50+ langs.",
    "version": "1.10",
    "x-build-id": "KhElwDfXyajZ80EOx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/harvestlab~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-harvestlab-youtube-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/harvestlab~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-harvestlab-youtube-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/harvestlab~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-harvestlab-youtube-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",
        "properties": {
          "mode": {
            "title": "Scraping Mode",
            "enum": [
              "channel",
              "search",
              "video"
            ],
            "type": "string",
            "description": "Choose the type of YouTube content to scrape: analyze a channel's recent videos, search YouTube for videos by keyword, or fetch details for specific video URLs.",
            "default": "channel"
          },
          "channelUrls": {
            "title": "Channel URLs",
            "type": "array",
            "description": "YouTube channel URLs (used in 'channel' mode). Supported formats: https://youtube.com/@handle (e.g. https://www.youtube.com/@MrBeast), https://youtube.com/channel/UCxxx, or https://youtube.com/c/CustomName.",
            "items": {
              "type": "string"
            }
          },
          "channelUrl": {
            "title": "Channel URL (CLI alias)",
            "type": "string",
            "description": "CLI alias for channelUrls (single-URL form). Hidden from Console form; exposed so `apify call -i '{\"channelUrl\":\"...\"}'` works consistently across the portfolio."
          },
          "searchQuery": {
            "title": "Search Query",
            "type": "string",
            "description": "Search term to find videos on YouTube (e.g. 'AI tutorials', 'machine learning 2026', 'python crash course'). Used in 'search' mode."
          },
          "videoUrls": {
            "title": "Video URLs",
            "type": "array",
            "description": "YouTube video URLs to fetch details for (used in 'video' mode). Supported formats: https://youtube.com/watch?v=VIDEO_ID, https://youtu.be/VIDEO_ID.",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "Max Videos per Channel",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of videos to scrape per channel (in 'channel' mode) or total search results (in 'search' mode). Range: 1-100.",
            "default": 20
          },
          "maxItems": {
            "title": "Max Items (CLI alias)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "CLI alias for maxVideos. Hidden from Console form."
          },
          "includeComments": {
            "title": "Include Comments",
            "type": "boolean",
            "description": "Scrape top comments for each video. Adds ~2-3 seconds per video and requires extra HTML parsing. Disable for faster runs.",
            "default": false
          },
          "maxCommentsPerVideo": {
            "title": "Max Comments per Video",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum number of top-level comments to scrape per video (only used when Include Comments is enabled). Range: 1-50.",
            "default": 10
          },
          "includeTranscripts": {
            "title": "Include Transcripts",
            "type": "boolean",
            "description": "Download video subtitles/transcripts via YouTube's timedtext endpoint. Prefers human-uploaded captions; falls back to auto-generated (ASR). When enabled alongside AI analysis, the AI report switches to transcript-aware theme extraction (actual spoken topics, not just titles). Adds ~1-2 seconds per video and a separate $0.005 charge per transcript retrieved. Disabled by default.",
            "default": false
          },
          "transcriptLanguages": {
            "title": "Transcript Languages",
            "type": "array",
            "description": "Preferred transcript language codes in priority order (e.g. ['en', 'es']). YouTube has hundreds of ASR languages; specify a short list to match your content. If none match, the first available track is returned. Only used when 'Include Transcripts' is enabled.",
            "default": [
              "en"
            ],
            "items": {
              "type": "string"
            }
          },
          "generateChapters": {
            "title": "Generate AI Chapters",
            "type": "boolean",
            "description": "Auto-segment each video's transcript into 3-8 chapters with titles, summaries, and start/end timestamps — useful for podcasters and long-form creators who want searchable timestamps without writing them manually, or agencies re-packaging long-form content into clips. Requires 'Include Transcripts' AND an LLM API key. Each chapter-set costs $0.01 per video (only charged when chapters are successfully generated). Disabled by default.",
            "default": false
          },
          "sortVideosBy": {
            "title": "Sort Videos By",
            "enum": [
              "popular",
              "newest",
              "oldest"
            ],
            "type": "string",
            "description": "Order for channel videos: 'Most Popular' (highest view count), 'Newest First' (recent uploads), or 'Oldest First' (channel's earliest uploads).",
            "default": "popular"
          },
          "enableAiAnalysis": {
            "title": "Enable AI Analysis",
            "type": "boolean",
            "description": "Generate AI-powered channel or content analysis with growth strategy insights, audience patterns, and content recommendations. Requires an LLM API key.",
            "default": false
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openrouter",
              "anthropic",
              "google",
              "openai",
              "ollama"
            ],
            "type": "string",
            "description": "Which AI provider to use for analysis. OpenRouter is the cheapest option.",
            "default": "openrouter"
          },
          "llmModel": {
            "title": "LLM Model",
            "type": "string",
            "description": "Specific model to use. Leave empty for the provider default (google/gemini-2.0-flash-001 for OpenRouter, claude-sonnet-4-20250514 for Anthropic, gemini-2.0-flash for Google AI, gpt-4o-mini for OpenAI, llama3.1 for Ollama)."
          },
          "openrouterApiKey": {
            "title": "OpenRouter API Key",
            "type": "string",
            "description": "Your OpenRouter API key. Get one free at https://openrouter.ai/keys. Required if using OpenRouter as the LLM provider. Alternatively set OPENROUTER_API_KEY env var."
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key",
            "type": "string",
            "description": "Your Anthropic API key. Get one at https://console.anthropic.com/settings/keys. Required if using Anthropic as the LLM provider. Alternatively set ANTHROPIC_API_KEY env var."
          },
          "googleApiKey": {
            "title": "Google AI API Key",
            "type": "string",
            "description": "API key for Google AI (Gemini). Get one at https://aistudio.google.com/app/apikey. Required if using Google AI as the LLM provider. Alternatively set GOOGLE_API_KEY env var."
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "API key from https://platform.openai.com/api-keys. Required if using OpenAI as the LLM provider. Alternatively set OPENAI_API_KEY env var."
          },
          "ollamaBaseUrl": {
            "title": "Ollama Base URL",
            "type": "string",
            "description": "Base URL for Ollama API. Default: http://localhost:11434"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings. YouTube rate-limits datacenter IPs at scale — Apify residential proxy is recommended for runs scraping many channels or videos."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}