{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Intelligence Scraper",
    "description": "Extract public YouTube videos, channels, playlists, Shorts, livestreams, comments, and subtitles into normalized intelligence records",
    "version": "0.1",
    "x-build-id": "XeYeOwwn96iq5j5GC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/qaseemiqbal~youtube-intelligence-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-qaseemiqbal-youtube-intelligence-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/qaseemiqbal~youtube-intelligence-scraper/runs": {
      "post": {
        "operationId": "runs-sync-qaseemiqbal-youtube-intelligence-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/qaseemiqbal~youtube-intelligence-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-qaseemiqbal-youtube-intelligence-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": {
          "startUrls": {
            "title": "YouTube URLs",
            "type": "array",
            "description": "Video, Shorts, channel, playlist, search result, hashtag, or live URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "Public YouTube URL to scrape."
                },
                "userData": {
                  "type": "object",
                  "title": "User data",
                  "description": "Optional metadata preserved in output source context."
                }
              }
            },
            "default": []
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Search terms exactly as they would be entered in YouTube search.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "channelHandles": {
            "title": "Channel handles or IDs",
            "type": "array",
            "description": "Examples: @Apify, Apify, UCxxxx.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags to scrape without the # symbol.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "mode": {
            "title": "Scraping mode",
            "enum": [
              "auto",
              "search",
              "videos",
              "channels",
              "playlists",
              "shorts",
              "live",
              "comments",
              "transcripts",
              "hashtags",
              "monitor"
            ],
            "type": "string",
            "description": "Choose whether to auto-detect each source type or force a specific scraping workflow.",
            "default": "auto"
          },
          "maxResultsPerSource": {
            "title": "Maximum results per source",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum number of main results to collect from each URL, search query, channel, playlist, or hashtag. The default is intentionally small to keep runs cheap.",
            "default": 25
          },
          "maxVideos": {
            "title": "Maximum regular videos",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum number of regular videos to collect per source when video-type limits apply.",
            "default": 25
          },
          "maxShorts": {
            "title": "Maximum Shorts",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum number of YouTube Shorts to collect per source when Shorts are available.",
            "default": 10
          },
          "maxStreams": {
            "title": "Maximum live streams",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum number of live, upcoming, or past livestream videos to collect per source.",
            "default": 5
          },
          "maxCommentsPerVideo": {
            "title": "Maximum comments per video",
            "minimum": 0,
            "maximum": 50000,
            "type": "integer",
            "description": "Maximum number of top-level public comments to collect for each video when comments are enabled.",
            "default": 0
          },
          "maxRepliesPerComment": {
            "title": "Maximum replies per comment",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of public replies to collect for each top-level comment.",
            "default": 0
          },
          "includeVideoDetails": {
            "title": "Include video details",
            "type": "boolean",
            "description": "Open each video page to collect richer metadata. Leave disabled for the cheapest discovery runs.",
            "default": false
          },
          "includeChannelDetails": {
            "title": "Include channel details",
            "type": "boolean",
            "description": "Open channel pages to collect public channel profile information. Leave disabled for lower-cost runs.",
            "default": false
          },
          "includeDescriptionLinks": {
            "title": "Extract description links",
            "type": "boolean",
            "description": "Extract public links found in video descriptions.",
            "default": true
          },
          "includeSocialLinks": {
            "title": "Extract social links",
            "type": "boolean",
            "description": "Detect common public social profile links from channel and description links.",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Collect public comments for videos.",
            "default": false
          },
          "includeReplies": {
            "title": "Include comment replies",
            "type": "boolean",
            "description": "Collect public replies under top-level comments when comments are enabled.",
            "default": false
          },
          "commentsSort": {
            "title": "Comments sort",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Preferred public comment ordering when the page supports it.",
            "default": "top"
          },
          "includeSubtitles": {
            "title": "Include subtitles/transcripts",
            "type": "boolean",
            "description": "Collect public subtitles or transcripts when they are available.",
            "default": false
          },
          "subtitleLanguages": {
            "title": "Subtitle languages",
            "type": "array",
            "description": "Preferred subtitle language codes, such as en, de, es, or fr.",
            "items": {
              "type": "string",
              "minLength": 2
            },
            "default": [
              "en"
            ]
          },
          "subtitleFormat": {
            "title": "Subtitle format",
            "enum": [
              "plainText",
              "srt",
              "webvtt",
              "xml",
              "json"
            ],
            "type": "string",
            "description": "Format used for saved subtitle or transcript output.",
            "default": "plainText"
          },
          "includeTranscriptSegments": {
            "title": "Include transcript segments",
            "type": "boolean",
            "description": "Include timestamped transcript segments in transcript records.",
            "default": false
          },
          "saveSubtitlesToKeyValueStore": {
            "title": "Save subtitles to Key-Value Store",
            "type": "boolean",
            "description": "Save full subtitle files to Apify Key-Value Store and include references in dataset records.",
            "default": true
          },
          "searchSort": {
            "title": "Search sort",
            "enum": [
              "relevance",
              "uploadDate",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Preferred sorting order for YouTube search results.",
            "default": "relevance"
          },
          "searchDateFilter": {
            "title": "Search date filter",
            "enum": [
              "any",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "Limit YouTube search results by approximate upload date.",
            "default": "any"
          },
          "searchType": {
            "title": "Search result type",
            "enum": [
              "all",
              "video",
              "channel",
              "playlist"
            ],
            "type": "string",
            "description": "Restrict YouTube search to videos, channels, playlists, or all supported result types.",
            "default": "video"
          },
          "durationFilter": {
            "title": "Duration filter",
            "enum": [
              "any",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "Restrict search results by video duration when supported by YouTube.",
            "default": "any"
          },
          "features": {
            "title": "Search features",
            "type": "array",
            "description": "Optional YouTube search feature filters such as live, HD, 4K, subtitles, or Creative Commons.",
            "items": {
              "type": "string",
              "enum": [
                "live",
                "4k",
                "hd",
                "subtitles",
                "creativeCommons",
                "360",
                "vr180",
                "3d",
                "hdr",
                "location",
                "purchased"
              ]
            },
            "default": []
          },
          "channelTab": {
            "title": "Channel tab",
            "enum": [
              "videos",
              "shorts",
              "streams",
              "playlists",
              "about",
              "all"
            ],
            "type": "string",
            "description": "Channel section to scrape, such as videos, Shorts, streams, playlists, about, or all supported tabs.",
            "default": "videos"
          },
          "channelVideoSort": {
            "title": "Channel video sort",
            "enum": [
              "newest",
              "popular",
              "oldest"
            ],
            "type": "string",
            "description": "Preferred sort order for channel videos when available.",
            "default": "newest"
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only include videos published on or after this date in YYYY-MM-DD format."
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only include videos published on or before this date in YYYY-MM-DD format."
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Preferred YouTube interface and result language.",
            "default": "en"
          },
          "countryCode": {
            "title": "Country code",
            "minLength": 2,
            "maxLength": 2,
            "type": "string",
            "description": "Preferred two-letter country or region code for localized YouTube results.",
            "default": "US"
          },
          "timezone": {
            "title": "Timezone",
            "type": "string",
            "description": "Timezone used for interpreting dates and run summaries.",
            "default": "UTC"
          },
          "deduplicate": {
            "title": "Deduplicate results",
            "type": "boolean",
            "description": "Merge duplicate videos found from multiple sources into one canonical result.",
            "default": true
          },
          "dedupeKey": {
            "title": "Deduplication key",
            "enum": [
              "videoId",
              "canonicalUrl",
              "sourceAndVideoId"
            ],
            "type": "string",
            "description": "Field used to decide whether two video records are duplicates.",
            "default": "videoId"
          },
          "datasetStrategy": {
            "title": "Dataset strategy",
            "enum": [
              "single",
              "separate"
            ],
            "type": "string",
            "description": "Choose whether to store all record types in one dataset or split them into separate datasets.",
            "default": "single"
          },
          "outputGranularity": {
            "title": "Output granularity",
            "enum": [
              "flat",
              "nested",
              "both"
            ],
            "type": "string",
            "description": "Choose a flatter output for spreadsheets, nested output for APIs, or both.",
            "default": "nested"
          },
          "errorHandling": {
            "title": "Error handling",
            "enum": [
              "pushErrorItems",
              "skipRecoverableErrors",
              "failOnCritical"
            ],
            "type": "string",
            "description": "Choose how the Actor should handle invalid sources and recoverable page errors.",
            "default": "pushErrorItems"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings used for YouTube requests. Apify Proxy is recommended.",
            "default": {
              "useApifyProxy": true
            }
          },
          "minConcurrency": {
            "title": "Minimum concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Minimum number of pages processed in parallel.",
            "default": 1
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of pages processed in parallel. Lower values are usually cheaper and less likely to trigger blocking.",
            "default": 2
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of retries for failed page requests. The default retries once to avoid repeating blocked or very slow requests too many times.",
            "default": 1
          },
          "requestTimeoutSecs": {
            "title": "Request timeout seconds",
            "minimum": 15,
            "maximum": 600,
            "type": "integer",
            "description": "Maximum time allowed for processing one request, including page navigation and parsing.",
            "default": 90
          },
          "navigationTimeoutSecs": {
            "title": "Navigation timeout seconds",
            "minimum": 10,
            "maximum": 180,
            "type": "integer",
            "description": "Maximum time allowed for browser navigation. YouTube channel pages can sometimes need more than 30 seconds on cloud proxies.",
            "default": 45
          },
          "maxSessionUses": {
            "title": "Maximum session uses",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Retire a browser/proxy session after this many successful requests.",
            "default": 25
          },
          "saveSnapshots": {
            "title": "Save debug snapshots",
            "type": "boolean",
            "description": "Save optional HTML snapshots for failed pages to help with debugging.",
            "default": false
          },
          "debugMode": {
            "title": "Debug mode",
            "type": "boolean",
            "description": "Enable more detailed logs and debug metadata.",
            "default": false
          },
          "logLevel": {
            "title": "Log level",
            "enum": [
              "DEBUG",
              "INFO",
              "WARNING",
              "ERROR"
            ],
            "type": "string",
            "description": "Choose how much logging the Actor should produce.",
            "default": "INFO"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}