{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Scraper With Creator Contact & Lead Enrichment",
    "description": "YouTube Scraper helps you extract public YouTube data quickly. Collect videos, channels, comments, subscribers, views, likes, and metadata for competitor research, content analysis, lead generation, influencer discovery, and marketing intelligence.",
    "version": "0.1",
    "x-build-id": "2NxoHB9YXpoL3f2OA"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/api-empire~youtube-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-api-empire-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/api-empire~youtube-scraper/runs": {
      "post": {
        "operationId": "runs-sync-api-empire-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/api-empire~youtube-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-api-empire-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": {
          "discoveryKeywords": {
            "title": "🧭 Discovery keywords (find creators by niche)",
            "type": "array",
            "description": "Niche/topic keywords (e.g. \"fitness coach\", \"crypto trading\") used to discover creator channels via YouTube search. The actor searches each keyword, collects the unique channels behind the matching videos, and enriches each one into a lead row. Also accepts the base actor's original 'searchTerms' key.",
            "items": {
              "type": "string"
            }
          },
          "creatorChannels": {
            "title": "📇 Creator channels (URL / @handle / channel ID)",
            "type": "array",
            "description": "Direct YouTube channel URLs, @handles, or channel IDs (UC...) to enrich into lead rows — skips discovery and goes straight to the About page. Example: \"https://www.youtube.com/@MrBeast\" or \"@MrBeast\" or \"UCX6OQ3DkcsbYNE6H8uQQuVA\". Also accepts the base actor's original 'startUrls' key.",
            "items": {
              "type": "string"
            }
          },
          "maxLeadsPerKeyword": {
            "title": "🎯 Max creator leads per keyword",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many unique channels to discover (and enrich into a lead row) per discovery keyword. Example: maxLeadsPerKeyword=5 + 3 keywords -> up to 15 channel leads from discovery. Default is 5.",
            "default": 5
          },
          "maxChannelsTotal": {
            "title": "🧮 Max channel leads total (safety cap)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Global cap on the total number of channel leads produced across ALL keywords and direct channels combined in this run. Use 0 for unlimited (bounded only by maxLeadsPerKeyword per keyword).",
            "default": 0
          },
          "enrichContactInfo": {
            "title": "📧 Extract public email & phone",
            "type": "boolean",
            "description": "Regex-scan each channel's real, published About-page description and external links for a business email address and/or phone number. Left null when the creator hasn't published one — contact fields are never guessed or fabricated.",
            "default": true
          },
          "enrichSocialLinks": {
            "title": "🔗 Structure social & external links",
            "type": "boolean",
            "description": "Classify each channel's About-page external links into queryable lead fields: website, Linktree, Instagram, TikTok, X/Twitter, Facebook, Discord — instead of a single raw links array.",
            "default": true
          },
          "requireEmail": {
            "title": "✅ Only keep leads with a public email",
            "type": "boolean",
            "description": "When enabled, channels where no email address could be found on the About page are skipped entirely (not emitted as a null-email row).",
            "default": false
          },
          "requirePhone": {
            "title": "✅ Only keep leads with a public phone number",
            "type": "boolean",
            "description": "When enabled, channels where no phone number could be found on the About page are skipped entirely.",
            "default": false
          },
          "scrapeMode": {
            "title": "🔀 Scrape mode",
            "enum": [
              "leads",
              "videos"
            ],
            "type": "string",
            "description": "'Creator leads (channel-level)' is this actor's own mode: one row per channel with contact/social enrichment (uses the Lead Discovery + Contact Enrichment sections above). 'Per-video search (base-compatible)' runs the original YouTube-Scraper per-video engine unchanged, using the fields below — pick this to keep using an existing YouTube-Scraper input JSON as-is."
          },
          "searchTerms": {
            "title": "🔍 Search terms (per-video mode)",
            "type": "array",
            "description": "Same as the base actor's 'searchTerms': YouTube search keywords used only when Scrape mode = 'Per-video search'. Ignored in Creator leads mode (use 'Discovery keywords' there instead).",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "🔗 Direct video/channel/playlist URLs (per-video mode)",
            "type": "array",
            "description": "Same as the base actor's 'startUrls': direct YouTube URLs scraped only when Scrape mode = 'Per-video search'. Ignored in Creator leads mode (use 'Creator channels' there instead).",
            "items": {
              "type": "string"
            }
          },
          "maxVideos": {
            "title": "🎞️ Maximum videos per search term (per-video mode)",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "Set how many regular (non-Shorts, non-live) videos to scrape for each search term when Scrape mode = 'Per-video search'. Use 0 to skip long-form videos completely.",
            "default": 10
          },
          "maxShorts": {
            "title": "📱 Maximum Shorts per search term (per-video mode)",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "Control how many YouTube Shorts to collect per keyword in per-video mode. Use 0 to skip Shorts.",
            "default": 0
          },
          "maxStreams": {
            "title": "📡 Maximum streams per search term (per-video mode)",
            "minimum": 0,
            "maximum": 9999,
            "type": "integer",
            "description": "Limit how many live/upcoming streams are scraped per search term in per-video mode. Use 0 to ignore live content.",
            "default": 0
          },
          "downloadSubtitles": {
            "title": "💬 Download subtitles (per-video mode)",
            "type": "boolean",
            "description": "Download video subtitles/transcripts when available (per-video mode only).",
            "default": false
          },
          "saveSubtitlesToKvs": {
            "title": "🗄️ Save subtitles to key-value store (per-video mode)",
            "type": "boolean",
            "description": "Store every downloaded transcript in the default key-value store under its own key.",
            "default": false
          },
          "subtitlesLanguage": {
            "title": "🌐 Subtitle language (per-video mode)",
            "enum": [
              "en",
              "es",
              "fr",
              "de",
              "pt",
              "it",
              "ru",
              "ja",
              "ko",
              "zh",
              "ar",
              "hi",
              "bn",
              "tr",
              "pl",
              "nl",
              "sv",
              "id",
              "th",
              "vi"
            ],
            "type": "string",
            "description": "Primary subtitle/transcript language.",
            "default": "en"
          },
          "preferAutoGenerated": {
            "title": "⚙️ Prefer auto-generated subtitles (per-video mode)",
            "type": "boolean",
            "description": "Prefer auto-generated captions over manually uploaded ones.",
            "default": false
          },
          "subtitlesFormat": {
            "title": "📄 Subtitle format (per-video mode)",
            "enum": [
              "srt",
              "text",
              "timestamp"
            ],
            "type": "string",
            "description": "SRT, plain text, or timestamped JSON.",
            "default": "srt"
          },
          "sortingOrder": {
            "title": "🧮 Sorting order (per-video mode)",
            "enum": [
              "",
              "relevance",
              "date",
              "viewCount",
              "rating"
            ],
            "type": "string",
            "description": "Sort the final per-video dataset by relevance, date, view count, or rating.",
            "default": ""
          },
          "dateFilter": {
            "title": "🕒 Date filter (per-video mode)",
            "enum": [
              "",
              "hour",
              "today",
              "week",
              "month",
              "year"
            ],
            "type": "string",
            "description": "YouTube's built-in Upload date filter.",
            "default": ""
          },
          "videoTypeFilter": {
            "title": "📂 Video type filter (per-video mode)",
            "enum": [
              "",
              "video",
              "channel",
              "playlist",
              "movie"
            ],
            "type": "string",
            "description": "Filter to only standard videos (exclude Shorts).",
            "default": ""
          },
          "lengthFilter": {
            "title": "⏱️ Length filter (per-video mode)",
            "enum": [
              "",
              "short",
              "medium",
              "long"
            ],
            "type": "string",
            "description": "YouTube's length presets.",
            "default": ""
          },
          "publishedAfter": {
            "title": "📆 Published after (per-video mode)",
            "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 date (per-video mode).",
            "default": ""
          },
          "sortBy": {
            "title": "📊 Sort by (post-processing, per-video mode)",
            "enum": [
              "",
              "date",
              "viewCount",
              "likes"
            ],
            "type": "string",
            "description": "Sort the final per-video dataset view by date, view count, or likes.",
            "default": ""
          },
          "isHD": {
            "title": "📺 HD (per-video mode)",
            "type": "boolean",
            "description": "Only include HD videos (720p+).",
            "default": false
          },
          "hasCC": {
            "title": "📝 Subtitles / CC (per-video mode)",
            "type": "boolean",
            "description": "Only include videos with a proper closed-caption track.",
            "default": false
          },
          "isCreativeCommons": {
            "title": "⚖️ Creative Commons (per-video mode)",
            "type": "boolean",
            "description": "Filter for Creative Commons licensed videos.",
            "default": false
          },
          "is3D": {
            "title": "🕶️ 3D (per-video mode)",
            "type": "boolean",
            "description": "Only stereoscopic 3D videos.",
            "default": false
          },
          "isLive": {
            "title": "📺 Live only (per-video mode)",
            "type": "boolean",
            "description": "Restrict to live/live-style content.",
            "default": false
          },
          "isPurchased": {
            "title": "💳 Purchased content (per-video mode)",
            "type": "boolean",
            "description": "Best-effort filter for purchased/paid content.",
            "default": false
          },
          "is4K": {
            "title": "🖥️ 4K only (per-video mode)",
            "type": "boolean",
            "description": "Only videos offering a 2160p (4K) stream.",
            "default": false
          },
          "is360": {
            "title": "🌐 360° video (per-video mode)",
            "type": "boolean",
            "description": "Only immersive 360° videos.",
            "default": false
          },
          "hasLocation": {
            "title": "📍 With location (per-video mode)",
            "type": "boolean",
            "description": "Only videos with explicit location metadata.",
            "default": false
          },
          "isHDR": {
            "title": "🌈 HDR only (per-video mode)",
            "type": "boolean",
            "description": "Only High Dynamic Range videos.",
            "default": false
          },
          "isVR180": {
            "title": "🥽 VR180 only (per-video mode)",
            "type": "boolean",
            "description": "Only VR180 immersive content.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy configuration & anti-blocking",
            "type": "object",
            "description": "Starting proxy setup. By default the actor uses no proxy and, if YouTube blocks requests (About pages or search), automatically escalates to Apify datacenter proxy and then residential proxy with up to 3 retries, locking onto residential for the rest of the run. Applies to both Creator leads and Per-video search modes."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}