{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper Intelligence",
    "description": "Scrape public YouTube videos, Shorts, streams, channels, playlists, search results, subtitles, comments, and AI-ready transcript records.",
    "version": "0.1",
    "x-build-id": "4puLKxfZZOEw0Jv30"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crowdpull~youtube-scraper-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crowdpull-youtube-scraper-intelligence",
        "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/crowdpull~youtube-scraper-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-crowdpull-youtube-scraper-intelligence",
        "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/crowdpull~youtube-scraper-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-crowdpull-youtube-scraper-intelligence",
        "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": {
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Video, Shorts, channel, handle, playlist, or YouTube search-result URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "YouTube search terms. Use maxResults/maxResultsShorts/maxResultStreams to control output buckets.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Search keywords alias",
            "type": "array",
            "description": "Alias for searchQueries.",
            "items": {
              "type": "string"
            }
          },
          "youtubeHandles": {
            "title": "YouTube handles/channels",
            "type": "array",
            "description": "YouTube handles or channel IDs. Examples: @bittensor, kurzgesagt, UC...",
            "items": {
              "type": "string"
            }
          },
          "getTrending": {
            "title": "Get trending videos",
            "type": "boolean",
            "description": "Scrape YouTube Trending for the selected gl/hl locale.",
            "default": false
          },
          "gl": {
            "title": "Search country",
            "type": "string",
            "description": "YouTube gl locale parameter such as US, GB, DE, or JP.",
            "default": "us"
          },
          "hl": {
            "title": "Search language",
            "type": "string",
            "description": "YouTube hl language parameter such as en, de, es, or ja.",
            "default": "en"
          },
          "maxItems": {
            "title": "Maximum total items",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Total output cap across all sources. If maxResults is omitted, this also sets the per-source regular-video target."
          },
          "maxResults": {
            "title": "Max regular videos per source",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum regular videos to emit per source.",
            "default": 50
          },
          "maxResultsShorts": {
            "title": "Max Shorts per source",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum Shorts videos to emit per source. Use 0 to exclude Shorts.",
            "default": 0
          },
          "maxResultStreams": {
            "title": "Max streams per source",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum livestream or stream replay videos to emit per source. Use 0 to exclude streams.",
            "default": 0
          },
          "sortBy": {
            "title": "Sorting order",
            "enum": [
              "relevance",
              "uploadDate",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Sorting order. Also accepts the sortingOrder alias with relevance, rating, date, or views.",
            "default": "relevance"
          },
          "sortingOrder": {
            "title": "Sorting order alias",
            "enum": [
              "relevance",
              "rating",
              "date",
              "views"
            ],
            "type": "string",
            "description": "Alias for sortBy."
          },
          "sort": {
            "title": "Sort alias",
            "type": "string",
            "description": "Search sort alias. Supports r/relevance, date, views, and rating."
          },
          "dateFilter": {
            "title": "Date filter",
            "enum": [
              "any",
              "hour",
              "day",
              "week",
              "month",
              "year",
              "custom"
            ],
            "type": "string",
            "description": "Relative or custom upload date filter applied after extraction, and mapped into search URLs where supported.",
            "default": "any"
          },
          "uploadDate": {
            "title": "Upload date alias",
            "enum": [
              "all",
              "any",
              "hour",
              "today",
              "day",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Upload date alias: all, hour, today, week, month, or year."
          },
          "dateAfter": {
            "title": "Date after",
            "type": "string",
            "description": "YYYY-MM-DD. Used when dateFilter is custom."
          },
          "dateBefore": {
            "title": "Date before",
            "type": "string",
            "description": "YYYY-MM-DD. Used when dateFilter is custom."
          },
          "videoType": {
            "title": "Video type filter",
            "enum": [
              "any",
              "video",
              "movie"
            ],
            "type": "string",
            "description": "Search-compatible type filter. Movie matching is best-effort from public metadata.",
            "default": "any"
          },
          "features": {
            "title": "Feature filter",
            "type": "string",
            "description": "Single feature or comma-separated features: any, 4k, hd, live, movie, cc, 3d, hdr, location, purchased, subtitles, vr180, vr360."
          },
          "lengthFilter": {
            "title": "Length filter",
            "enum": [
              "any",
              "under4",
              "between420",
              "plus20"
            ],
            "type": "string",
            "description": "Search-compatible length filter.",
            "default": "any"
          },
          "duration": {
            "title": "Duration alias",
            "enum": [
              "all",
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Duration alias. Maps short to under4, medium to between420, and long to plus20."
          },
          "isHD": {
            "title": "HD",
            "type": "boolean",
            "description": "Only include HD videos when true, or exclude HD videos when false."
          },
          "hasSubtitles": {
            "title": "Subtitles/CC",
            "type": "boolean",
            "description": "Only include videos with public subtitle tracks when true."
          },
          "hasCC": {
            "title": "Creative Commons",
            "type": "boolean",
            "description": "Only include videos marked with a Creative Commons license when true."
          },
          "is3D": {
            "title": "3D",
            "type": "boolean",
            "description": "Only include videos with public 3D signals when true."
          },
          "isLive": {
            "title": "Live",
            "type": "boolean",
            "description": "Only include live or stream replay results when true."
          },
          "isBought": {
            "title": "Purchased",
            "type": "boolean",
            "description": "Compatibility-only purchased/premium filter. Public unauthenticated YouTube often returns no real video rows for this filter, and purchase availability is not reliably exposed."
          },
          "is4K": {
            "title": "4K",
            "type": "boolean",
            "description": "Only include videos with 4K public formats when true."
          },
          "is360": {
            "title": "360 degrees",
            "type": "boolean",
            "description": "Only include videos with 360-degree public metadata when true."
          },
          "hasLocation": {
            "title": "Location",
            "type": "boolean",
            "description": "Only include videos with public location metadata when true."
          },
          "isHDR": {
            "title": "HDR",
            "type": "boolean",
            "description": "Only include videos with HDR public format metadata when true."
          },
          "isVR180": {
            "title": "VR180",
            "type": "boolean",
            "description": "Only include videos with VR180 public metadata when true."
          },
          "oldestPostDate": {
            "title": "Scrape videos published after date",
            "type": "string",
            "description": "YYYY-MM-DD or relative values such as 1 day, 7 days."
          },
          "sortVideosBy": {
            "title": "Sort channel videos by",
            "enum": [
              "NEWEST",
              "POPULAR",
              "OLDEST"
            ],
            "type": "string",
            "description": "Post-sorts extracted channel/search candidates by newest, popular, or oldest.",
            "default": "NEWEST"
          },
          "enrichChannelAbout": {
            "title": "Enrich channel/about fields",
            "type": "boolean",
            "description": "Fetch channel about pages once per channel to fill description, links, subscriber count, total videos, and total views where public.",
            "default": true
          },
          "includeSubtitles": {
            "title": "Include subtitles",
            "type": "boolean",
            "description": "Extract public manual captions first and auto-generated captions second.",
            "default": true
          },
          "downloadSubtitles": {
            "title": "Download subtitles alias",
            "type": "boolean",
            "description": "Alias for includeSubtitles."
          },
          "saveSubsToKVS": {
            "title": "Save subtitles to key-value store",
            "type": "boolean",
            "description": "Compatibility alias. Defaults to true in this actor so downstream automations can use stable KV URLs.",
            "default": true
          },
          "languages": {
            "title": "Subtitle language fallback",
            "type": "array",
            "description": "Language codes or regex patterns, tried in order. Example: en.*,es,fr.",
            "default": [
              "en.*"
            ],
            "items": {
              "type": "string"
            }
          },
          "subtitlesLanguage": {
            "title": "Subtitle language alias",
            "type": "string",
            "description": "Compatibility alias. Use any, en, de, es, fr, it, ja, ko, nl, pt, or ru."
          },
          "preferAutoGeneratedSubtitles": {
            "title": "Prefer auto-generated subtitles",
            "type": "boolean",
            "description": "Prefer auto-generated captions before manual captions.",
            "default": false
          },
          "subtitlesFormat": {
            "title": "Subtitle format",
            "enum": [
              "all",
              "srt",
              "vtt",
              "xml",
              "plaintext"
            ],
            "type": "string",
            "description": "Choose one subtitle payload format or keep all AI-ready formats.",
            "default": "all"
          },
          "includeComments": {
            "title": "Include full comments",
            "type": "boolean",
            "description": "Fetch comments with yt-dlp. Large values can significantly increase runtime.",
            "default": false
          },
          "commentSort": {
            "title": "Comment sort",
            "enum": [
              "top",
              "new"
            ],
            "type": "string",
            "description": "Comment sorting mode passed to yt-dlp when comments are enabled.",
            "default": "top"
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum comments to extract per video when includeComments is enabled.",
            "default": 500
          },
          "transcriptMode": {
            "title": "Transcript mode",
            "enum": [
              "captionsOnly",
              "captionsThenWhisper"
            ],
            "type": "string",
            "description": "Use captions only, or fall back to Whisper when no suitable caption track exists.",
            "default": "captionsOnly"
          },
          "openaiApiKey": {
            "title": "OpenAI API key",
            "type": "string",
            "description": "Secret. Required only for captionsThenWhisper."
          },
          "maxWhisperMinutesPerRun": {
            "title": "Max Whisper minutes per run",
            "minimum": 0,
            "maximum": 1440,
            "type": "integer",
            "description": "Total audio minutes allowed for Whisper fallback in one actor run.",
            "default": 60
          },
          "maxAudioDurationMinutes": {
            "title": "Max audio duration per video",
            "minimum": 1,
            "maximum": 720,
            "type": "integer",
            "description": "Maximum individual video duration eligible for Whisper fallback.",
            "default": 20
          },
          "enableDedup": {
            "title": "Enable Smart Scrape dedup",
            "type": "boolean",
            "description": "Skip previously emitted videos per source until they age beyond the refresh window.",
            "default": true
          },
          "refreshWindowDays": {
            "title": "Refresh window days",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Recently seen videos older than this many days are refreshed so mutable metrics stay current.",
            "default": 7
          },
          "customMapFunction": {
            "title": "Custom map function",
            "type": "string",
            "description": "JavaScript function. Receives each output row as item/input and should return JSON-serializable data."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy configuration. Plain Apify Proxy is the default; switch to residential for tougher runs.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}