{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper With Commenter Lead Enrichment",
    "description": "YouTube Comments Scraper extracts comments from any YouTube video, capturing usernames, text, timestamps, likes, replies, and comment IDs. Ideal for sentiment analysis, audience research, trend monitoring, and automating structured YouTube comment data collection at scale",
    "version": "0.1",
    "x-build-id": "YNFBT5siOKbIfiB2a"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simpleapi~youtube-comments-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simpleapi-youtube-comments-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/simpleapi~youtube-comments-scraper/runs": {
      "post": {
        "operationId": "runs-sync-simpleapi-youtube-comments-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/simpleapi~youtube-comments-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-simpleapi-youtube-comments-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": {
          "targetVideos": {
            "title": "🎯 Target Video URLs or IDs",
            "type": "array",
            "description": "📋 The YouTube videos to pull comments + commenter leads from. Accepts full URLs (https://www.youtube.com/watch?v=VIDEO_ID or https://youtu.be/VIDEO_ID) or the bare 11-character video ID. Add several to run them all in one job. (Base-compatible: a `startUrls` key in the input JSON also works.)",
            "items": {
              "type": "string"
            }
          },
          "commentsPerVideo": {
            "title": "📈 Comments to Collect per Video",
            "minimum": 0,
            "type": "integer",
            "description": "🔢 Maximum number of comments to pull from each video. 0 = no limit (collect every available comment). Example: commentsPerVideo=50 pulls the first 50 comments per video, in the chosen commentSortMode order. Default 10. (Base-compatible: `maxComments` also works.)"
          },
          "commentSortMode": {
            "title": "🧭 Comment Sort Mode",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "⬆️ How comments are ordered: • top — YouTube's most-liked/most-relevant first (best for sentiment/opinion mining). • newest — most recently posted first (best for live-discussion/recency monitoring). (Base-compatible: `sortOrder` also works.)"
          },
          "maxCommentersToEnrich": {
            "title": "🕵️ Max Unique Commenters to Enrich (Lead Enrichment)",
            "minimum": 0,
            "type": "integer",
            "description": "🔎 OPT-IN. Set >0 to fetch each unique commenter's channel page ONCE (deduped — the same commenter is never re-fetched, even if they posted many comments) and attach their subscriber count, channel join date, and total video count to every one of their comment rows. This is ONE extra request per UNIQUE commenter, capped at this number per run — set it to control cost. 0 = feature OFF (default), the base comment fields are still fully collected at no extra cost. Example: maxCommentersToEnrich=25 enriches (at most) the first 25 distinct commenters encountered."
          },
          "fetchAllReplies": {
            "title": "↩️ Expand Full Reply Threads",
            "type": "boolean",
            "description": "🧵 When ON (default), follows EACH parent comment's own 'more replies' continuation token to fetch every reply YouTube is hiding behind the 'View N more replies' button — not just the 2-3 shown inline. When OFF, behaves like a plain comments scraper (inline-preview replies only).",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "🔢 Maximum Replies per Comment",
            "minimum": 0,
            "type": "integer",
            "description": "🧢 Caps how many replies are kept per parent comment when 'Expand Full Reply Threads' is ON. Use 0 for no limit (up to a 40-page safety valve per comment). Default is 50."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "🛡️ Configure proxy settings for both the comment-scraping requests AND the optional commenter channel-enrichment requests. By default, no proxy is used. If you hit rate limits or blocks, enable Apify Proxy — the actor automatically tries datacenter first, then residential."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}