{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Scraper & Monitor – New Comments + Alerts",
    "description": "Scrape YouTube comments from videos or a channel's latest uploads. Monitor new comments only, flag questions the creator has not answered, negative comments and keywords, with Slack/webhook alerts and a shareable report.",
    "version": "1.0",
    "x-build-id": "iN8075ezBjo8q1R0s"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kirozhang~youtube-comments-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kirozhang-youtube-comments-monitor",
        "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/kirozhang~youtube-comments-monitor/runs": {
      "post": {
        "operationId": "runs-sync-kirozhang-youtube-comments-monitor",
        "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/kirozhang~youtube-comments-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-kirozhang-youtube-comments-monitor",
        "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": {
          "channelUrls": {
            "title": "Channels",
            "type": "array",
            "description": "Channel URLs, @handles or channel IDs, e.g. <code>https://www.youtube.com/@mkbhd</code>, <code>@mkbhd</code> or <code>UCBJycsmduvYEL83R_U4JriQ</code>. The latest uploads of each channel are checked.",
            "items": {
              "type": "string"
            }
          },
          "videosPerChannel": {
            "title": "Latest videos per channel",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many of the newest uploads of each channel to check.",
            "default": 3
          },
          "videoUrls": {
            "title": "Videos",
            "type": "array",
            "description": "Video URLs or IDs (watch, youtu.be, Shorts and live links work), e.g. <code>https://www.youtube.com/watch?v=jNQXAC9IVRw</code>.",
            "items": {
              "type": "string"
            }
          },
          "includeShorts": {
            "title": "Include Shorts",
            "type": "boolean",
            "description": "Also check the latest Shorts of each channel (same number as above).",
            "default": false
          },
          "maxVideoAgeDays": {
            "title": "Only videos uploaded in the last (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Optional (0 = no limit). Channel uploads older than this are skipped – handy for monitoring only fresh videos."
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Upper limit of top-level comments read per video in one run.",
            "default": 200
          },
          "sortBy": {
            "title": "Sort comments by",
            "enum": [
              "newest",
              "top"
            ],
            "type": "string",
            "description": "Order in which comments are read.",
            "default": "newest"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Also save replies (one row each, with <code>parentCommentId</code>).",
            "default": false
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Used with Include replies.",
            "default": 20
          },
          "includeAuthorNames": {
            "title": "Include commenter handles",
            "type": "boolean",
            "description": "Off by default (privacy-friendly). When on, rows include the commenter's public @handle and channel ID.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new comments (monitoring mode)",
            "type": "boolean",
            "description": "Off by default (every comment read is returned, each with <code>isNew</code>). When on, the first run with a Tracking name saves the baseline and later runs return – and charge – only comments that were not returned before. With the newest sort the Actor stops reading as soon as it reaches known comments, so monitoring runs are fast and cheap.",
            "default": false
          },
          "trackingId": {
            "title": "Tracking name",
            "type": "string",
            "description": "Optional. A stable name for this list of videos/channels (e.g. <code>my-channel</code>). Runs with the same name share history. Default: derived from the input."
          },
          "alertOnQuestions": {
            "title": "Flag unanswered questions",
            "type": "boolean",
            "description": "Questions (\"How do you…\", \"Where can I…?\") that the creator has not replied to, pinned or hearted are flagged with <code>isAlert</code> and listed in the report and notification.",
            "default": true
          },
          "alertOnNegative": {
            "title": "Flag negative comments",
            "type": "boolean",
            "description": "Comments with negative sentiment (basic English word list: \"scam\", \"broken\", \"waste of time\", \"refund\"…) are flagged. Every row has <code>sentiment</code> and <code>sentimentScore</code>.",
            "default": true
          },
          "checkCreatorReplies": {
            "title": "Check whether the creator replied",
            "type": "boolean",
            "description": "For flagged comments that have replies, read the replies to see if the channel owner answered (<code>creatorReplied</code>). Up to 25 threads per video per run; no extra charge.",
            "default": true
          },
          "alertKeywords": {
            "title": "Alert keywords",
            "type": "array",
            "description": "Optional. A comment that mentions any of these words or phrases is flagged as an alert, e.g. <code>refund</code>, <code>broken</code>, <code>sponsor</code>, your product or competitor names. Case- and accent-insensitive.",
            "items": {
              "type": "string"
            }
          },
          "customTopics": {
            "title": "Custom topics",
            "type": "array",
            "description": "Optional. One topic per line: <code>Topic name: word, phrase, word</code>, e.g. <code>Audio: mic, sound, audio</code>. Matching comments get the topic in <code>customTopics</code>.",
            "items": {
              "type": "string"
            }
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "Optional. A Slack <a href=\"https://api.slack.com/messaging/webhooks\" target=\"_blank\">Incoming Webhook</a> URL (https://hooks.slack.com/services/…). After a run you get one summary message in that channel. Stored encrypted."
          },
          "webhookUrl": {
            "title": "Webhook URL (JSON)",
            "type": "string",
            "description": "Optional. Any https endpoint (Make, Zapier, n8n, a Microsoft Teams workflow or your own server). Receives one JSON POST per run with counts, items and the report link. Stored encrypted."
          },
          "notifyOn": {
            "title": "Send a notification when",
            "enum": [
              "alerts",
              "new",
              "always"
            ],
            "type": "string",
            "description": "When the Slack / webhook message is sent.",
            "default": "alerts"
          },
          "publicReport": {
            "title": "Shareable report link",
            "type": "boolean",
            "description": "Off by default. When on, the HTML report (videos, comments that need attention, 7- and 30-day trends) is kept at one fixed link per Tracking name (OUTPUT.reportUrl) – share it with your team or a client. Anyone with the link can open it; commenter names are never included.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy (datacenter) works well for YouTube. Switch to residential only if you see repeated errors.",
            "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}