{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper With AI Video Summary & Transcripts",
    "description": "📺 YouTube Scraper extracts video & channel data — titles, descriptions, views, likes, comments, tags, publish dates & playlists. 🔍 Perfect for SEO research, content analysis, trend tracking & competitor insights. ⚡ Fast, reliable, API-ready. Also grabs thumbnails, durations, URLs, subtitles.",
    "version": "0.1",
    "x-build-id": "BIvj4Q1OeKhhr5NDw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapier~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapier-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/scrapier~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapier-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/scrapier~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapier-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": {
          "contentSearchQueries": {
            "title": "🔍 Video search queries",
            "type": "array",
            "description": "One or more YouTube search keywords/phrases to analyze (e.g. \"machine learning tutorial\", \"crawlee\"). Every matching video is fetched and can be run through transcript + chapter + AI summarization below. (Base-compatible alias: searchTerms.)",
            "items": {
              "type": "string"
            }
          },
          "videoUrlsToAnalyze": {
            "title": "🔗 Direct video URLs",
            "type": "array",
            "description": "Direct YouTube video/Shorts URLs to analyze without a search query — ideal for summarizing a known list of videos. (Base-compatible alias: startUrls.)",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerQuery": {
            "title": "🎬 Max videos per query",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "How many regular (non-Shorts, non-live) videos to analyze per search query. 0 skips long-form videos entirely. (Base-compatible alias: maxVideos.) Default 10."
          },
          "maxShortsPerQuery": {
            "title": "📱 Max Shorts per query",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "How many YouTube Shorts to analyze per query. 0 excludes Shorts. (Base-compatible alias: maxShorts.) Default 0."
          },
          "maxLiveStreamsPerQuery": {
            "title": "📡 Max live streams per query",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "How many live/upcoming streams to analyze per query. 0 excludes live content. (Base-compatible alias: maxStreams.) Default 0."
          },
          "fetchTranscript": {
            "title": "📝 Fetch full transcript",
            "type": "boolean",
            "description": "Download the video's full transcript/subtitles. Recommended ON when using AI summary/keyword extraction below for the richest results (without it, AI falls back to title + description only). (Base-compatible alias: downloadSubtitles.)"
          },
          "transcriptLanguagePreference": {
            "title": "🌐 Transcript language",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "pt",
              "it",
              "ru",
              "ja",
              "ko",
              "zh",
              "ar",
              "hi",
              "bn",
              "tr",
              "pl",
              "nl",
              "sv",
              "id",
              "th",
              "vi"
            ],
            "type": "string",
            "description": "Preferred transcript language code. Falls back to any available track if this language has none. (Base-compatible alias: subtitlesLanguage.) Default en."
          },
          "useAutoGeneratedCaptions": {
            "title": "⚙️ Prefer auto-generated captions",
            "type": "boolean",
            "description": "Prefer YouTube's auto-generated captions over manually uploaded ones (higher coverage, lower accuracy). (Base-compatible alias: preferAutoGenerated.)"
          },
          "transcriptOutputFormat": {
            "title": "📄 Transcript output format",
            "enum": [
              "srt",
              "text",
              "timestamp"
            ],
            "type": "string",
            "description": "How the transcript field is formatted in the output: classic SRT, plain text, or timestamped JSON. (Base-compatible alias: subtitlesFormat.) Default srt."
          },
          "storeTranscriptsInKeyValueStore": {
            "title": "🗄️ Store transcripts in key-value store",
            "type": "boolean",
            "description": "Also save each transcript to the run's key-value store under \"transcript-<videoId>\", separate from the dataset. (Base-compatible alias: saveSubtitlesToKvs.)"
          },
          "includeChapterMarkers": {
            "title": "📑 Include chapter markers",
            "type": "boolean",
            "description": "Extract the uploader's chapter markers (already present in YouTube's own page payload — zero extra requests) as structured content sections with start/end/duration, used to anchor the AI summary. Empty list when a video has no chapters (most videos). Default ON.",
            "default": true
          },
          "enableAiSummary": {
            "title": "🤖 Generate AI video summary",
            "type": "boolean",
            "description": "Turn on AI-generated video summaries built from the transcript (+ chapters when present). OFF by default — requires an AI model + API key below (or a matching provider environment variable). When off or keyless, aiSummary is null and aiEnrichmentStatus reports why.",
            "default": false
          },
          "enableAiKeywordExtraction": {
            "title": "🏷️ Extract AI keywords & topics",
            "type": "boolean",
            "description": "Turn on AI keyword/topic extraction across the title, description, and transcript (up to 10 keywords + up to 5 broader topics per video). OFF by default — needs the same AI model + API key as the summary feature.",
            "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-1.5-pro",
              "gemini-2.5-flash",
              "gemini-2.5-pro",
              "grok-2-latest",
              "grok-3-mini",
              "grok-3",
              "grok-beta",
              "deepseek-chat",
              "deepseek-reasoner",
              "sonar",
              "sonar-pro",
              "sonar-reasoning",
              "mistral-small-latest",
              "mistral-large-latest"
            ],
            "type": "string",
            "description": "Provider is auto-detected from the model name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI, gemini-*=Google, grok-*=xAI, deepseek-*=DeepSeek, sonar*=Perplexity, mistral-*=Mistral. Cheaper mini/flash/haiku models are recommended.",
            "default": "claude-haiku-4-5"
          },
          "aiApiKey": {
            "title": "🔑 AI provider API key",
            "type": "string",
            "description": "API key for the provider matching aiModel above. Optional — if left empty, the matching provider environment variable is used instead (ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY/GOOGLE_API_KEY, XAI_API_KEY/GROK_API_KEY, DEEPSEEK_API_KEY, PERPLEXITY_API_KEY/PPLX_API_KEY, MISTRAL_API_KEY). With neither set, AI fields are null."
          },
          "resultSortOrder": {
            "title": "🧮 Sort results by",
            "enum": [
              "",
              "relevance",
              "date",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Sort by relevance (original order), upload date, view count, or rating. (Base-compatible alias: sortingOrder.)"
          },
          "uploadDateFilter": {
            "title": "🕒 Upload date filter",
            "enum": [
              "",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Match YouTube's \"Upload date\" filter: last hour, today, this week, this month, or this year. (Base-compatible alias: dateFilter.)"
          },
          "contentTypeFilter": {
            "title": "📂 Content type filter",
            "enum": [
              "",
              "video",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Restrict to standard videos (excludes Shorts) when set to 'video'. Channel/playlist/movie apply only where supported. (Base-compatible alias: videoTypeFilter.)"
          },
          "durationFilter": {
            "title": "⏱️ Duration filter",
            "enum": [
              "",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "YouTube's length presets: short clips, medium-length, or long-form (20+ minutes). (Base-compatible alias: lengthFilter.)"
          },
          "publishedAfterDate": {
            "title": "📆 Published after (date)",
            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$|^$",
            "type": "string",
            "description": "Only include videos published after this absolute date (YYYY-MM-DD). Leave empty for all dates. (Base-compatible alias: publishedAfter.)"
          },
          "finalSortField": {
            "title": "📊 Final sort field (post-processing)",
            "enum": [
              "",
              "date",
              "viewCount",
              "likes"
            ],
            "type": "string",
            "description": "Sort the FINAL dataset by date, view count, or likes after scraping. (Base-compatible alias: sortBy.)"
          },
          "requireHD": {
            "title": "📺 Require HD",
            "type": "boolean",
            "description": "Only include HD (720p+) videos. (Base-compatible alias: isHD.)"
          },
          "requireClosedCaptions": {
            "title": "📝 Require closed captions",
            "type": "boolean",
            "description": "Only include videos with a proper (non auto-generated) closed-caption track. (Base-compatible alias: hasCC.)"
          },
          "requireCreativeCommons": {
            "title": "⚖️ Require Creative Commons license",
            "type": "boolean",
            "description": "Only include videos YouTube marks as Creative Commons licensed. (Base-compatible alias: isCreativeCommons.)"
          },
          "require3D": {
            "title": "🕶️ Require 3D",
            "type": "boolean",
            "description": "Only include stereoscopic 3D videos. (Base-compatible alias: is3D.)"
          },
          "requireLiveOnly": {
            "title": "📡 Require live content only",
            "type": "boolean",
            "description": "Restrict to live/live-style content. (Base-compatible alias: isLive.)"
          },
          "requirePurchasedContent": {
            "title": "💳 Require purchased content",
            "type": "boolean",
            "description": "Best-effort filter for purchased/paid content; YouTube rarely exposes this, so coverage is limited. (Base-compatible alias: isPurchased.)"
          },
          "require4K": {
            "title": "🖥️ Require 4K",
            "type": "boolean",
            "description": "Only include videos offering at least one 2160p (4K) stream. (Base-compatible alias: is4K.)"
          },
          "require360": {
            "title": "🌐 Require 360°",
            "type": "boolean",
            "description": "Only include immersive 360° (equirectangular) videos. (Base-compatible alias: is360.)"
          },
          "requireLocationData": {
            "title": "📍 Require location data",
            "type": "boolean",
            "description": "Only include videos where YouTube exposes explicit location metadata. (Base-compatible alias: hasLocation.)"
          },
          "requireHDR": {
            "title": "🌈 Require HDR",
            "type": "boolean",
            "description": "Only include High Dynamic Range (HDR) videos. (Base-compatible alias: isHDR.)"
          },
          "requireVR180": {
            "title": "🥽 Require VR180",
            "type": "boolean",
            "description": "Only include VR180 immersive content. (Base-compatible alias: isVR180.)"
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy configuration & anti-blocking",
            "type": "object",
            "description": "Starting proxy setup. Defaults to no proxy and automatically escalates to Apify datacenter then residential proxy (with retries) if YouTube blocks requests, locking onto residential for the rest of the run."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}