{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comment Brand Monitor → Slack Alerts & Sentiment",
    "description": "RoBERTa sentiment + composite risk (likes/replies/thread), 7/30/90d or custom window, paginated keyword search or comment scan, Slack on new negatives. No YouTube login.",
    "version": "0.3",
    "x-build-id": "QnjefA67IOYpr3Yfv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/supersuper~youtube-comment-brand-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-supersuper-youtube-comment-brand-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/supersuper~youtube-comment-brand-monitor/runs": {
      "post": {
        "operationId": "runs-sync-supersuper-youtube-comment-brand-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/supersuper~youtube-comment-brand-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-supersuper-youtube-comment-brand-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",
        "required": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "Brand names or keywords",
            "minItems": 1,
            "type": "array",
            "description": "Required. Drives paginated YouTube search when no video URLs are set, and filters comments when URLs are set.",
            "items": {
              "type": "string"
            }
          },
          "youtubeVideoUrls": {
            "title": "YouTube video URLs (optional)",
            "type": "array",
            "description": "Optional. Leave empty for keyword search (paginated). Paste URLs to scan that video's comments and sample reply threads for concentration scoring.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lookbackPreset": {
            "title": "Time range",
            "enum": [
              "7",
              "30",
              "90",
              "custom",
              "all"
            ],
            "type": "string",
            "description": "Keep only videos/comments inside this window. Differentiator vs open-ended scrapes: 7 / 30 / 90 days, custom dates, or no limit.",
            "default": "30"
          },
          "dateFrom": {
            "title": "Custom start date",
            "type": "string",
            "description": "Used when Time range = Custom. Format YYYY-MM-DD. Must not be in the future."
          },
          "dateTo": {
            "title": "Custom end date",
            "type": "string",
            "description": "Used when Time range = Custom. Format YYYY-MM-DD. Future dates are clamped to today."
          },
          "maxResultsPerSource": {
            "title": "Maximum results",
            "minimum": 10,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on kept results. Search mode paginates YouTube until this cap (or pages run out). Comment mode: max matching comments across videos.",
            "default": 100
          },
          "negativeThreshold": {
            "title": "Negative-alert threshold",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "0–1 on the composite risk score (RoBERTa intensity × engagement/thread). Recommended: 0.65. Higher = fewer, stronger alerts.",
            "default": 0.65
          },
          "minimumEngagement": {
            "title": "Minimum engagement for alerts",
            "minimum": 0,
            "type": "integer",
            "description": "Only Slack-alert when a negative result has at least this many likes (comments) or views (search). Dataset still includes all matches.",
            "default": 0
          },
          "onlyNewMentions": {
            "title": "Only alert on newly seen mentions",
            "type": "boolean",
            "description": "Recommended for schedules. Remembers seen IDs so Slack only fires on new hits. Dataset still includes every match in the run.",
            "default": true
          },
          "slackWebhookUrl": {
            "title": "Slack incoming-webhook URL (optional)",
            "type": "string",
            "description": "Keep private. Compact alert with risk, composite score, likes, replies, intensity, and thread negativity — only for qualifying new negatives."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}