{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Comments Sentiment & Audience Analyzer",
    "description": "Turn YouTube comments into evidence-backed audience intelligence: sentiment, questions, complaints, praise, content requests, purchase intent, competitor mentions, themes and timestamp moments. Analyze an existing comment dataset or paste video URLs. No AI or YouTube API key needed.",
    "version": "1.0",
    "x-build-id": "yLBtWtkJaAGsPBn3J"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/coregent~youtube-comment-sentiment-audience-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-coregent-youtube-comment-sentiment-audience-intelligence",
        "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/coregent~youtube-comment-sentiment-audience-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-coregent-youtube-comment-sentiment-audience-intelligence",
        "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/coregent~youtube-comment-sentiment-audience-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-coregent-youtube-comment-sentiment-audience-intelligence",
        "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": {
          "videoUrls": {
            "title": "Video URLs",
            "type": "array",
            "description": "YouTube videos or Shorts to analyze (URLs or 11-character video IDs). Comments are collected first by Coregent's YouTube Comment Scraper PRO, which is billed separately at its own rates and capped by 'Max source spend'. Leave empty if you analyze a dataset or inline comments.",
            "default": [
              "https://www.youtube.com/watch?v=QJBP2uy8LcU"
            ],
            "items": {
              "type": "string"
            }
          },
          "datasetId": {
            "title": "Existing comment dataset",
            "type": "string",
            "description": "ID (or Console URL) of an Apify dataset holding YouTube comments — for example the output of coregent/youtube-comment-scraper-pro, which needs no mapping. Other datasets work when they use common field names such as text/comment, commentId/id, likeCount/likes and videoId/videoUrl.",
            "default": ""
          },
          "comments": {
            "title": "Inline comments",
            "type": "array",
            "description": "Comment objects sent directly, e.g. [{\"text\": \"Great video!\", \"videoId\": \"QJBP2uy8LcU\", \"likeCount\": 3}]. Useful for API calls and curated samples.",
            "default": []
          },
          "maxTotalComments": {
            "title": "Max comments to analyze (total)",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard ceiling on comments read from all sources and analyzed in this run. The default keeps a first run small — raise it to analyze a whole dataset or more comments per video.",
            "default": 20
          },
          "maxCommentsPerVideo": {
            "title": "Max comments per video",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Video URLs only: how many comments the comment scraper collects per video.",
            "default": 20
          },
          "commentSort": {
            "title": "Comment order",
            "enum": [
              "top",
              "newest"
            ],
            "type": "string",
            "description": "Top comments (most engaged) or newest comments first.",
            "default": "top"
          },
          "includeReplies": {
            "title": "Include replies",
            "type": "boolean",
            "description": "Collect and analyze replies as well as top-level comments. When off, replies in a dataset are skipped (saved as 'filtered', not charged).",
            "default": true
          },
          "maxRepliesPerComment": {
            "title": "Max replies per comment",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Video URLs only: replies collected per top-level comment.",
            "default": 5
          },
          "maxUpstreamCostUsd": {
            "title": "Max source spend (USD)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Video URLs only: hard spending cap for the comment-scraper run. Collection is cut before it starts so its charges stay within this amount, and the cap is also passed to Apify as that run's charge limit.",
            "default": 2
          },
          "analysisDepth": {
            "title": "Analysis depth",
            "enum": [
              "standard",
              "sentiment"
            ],
            "type": "string",
            "description": "'Standard' adds intents (questions, complaints, requests, purchase signals …), topics and timestamp moments to sentiment. 'Sentiment only' returns sentiment, language and spam status per comment — the price per comment is the same.",
            "default": "standard"
          },
          "analyzeSentiment": {
            "title": "Sentiment",
            "type": "boolean",
            "description": "Label each comment positive, neutral, negative, mixed or uncertain, with a score from -1 to +1 and a confidence.",
            "default": true
          },
          "extractIntents": {
            "title": "Audience intents",
            "type": "boolean",
            "description": "Multi-label intents: question, content request, feature request, complaint, praise, purchase intent, price question, where to buy, competitor mention, product problem, confusion and more.",
            "default": true
          },
          "extractTopics": {
            "title": "Topics and themes",
            "type": "boolean",
            "description": "Short topic descriptors per comment, merged into report-level themes across all videos.",
            "default": true
          },
          "detectSpam": {
            "title": "Spam / noise detection",
            "type": "boolean",
            "description": "Flag spam-like text (self-promotion, scams, link spam, filler). Spam-like comments stay in the dataset but are left out of report metrics.",
            "default": true
          },
          "extractTimestampMoments": {
            "title": "Timestamp moments",
            "type": "boolean",
            "description": "Find video timestamps mentioned in comments (e.g. 2:31) and rank the most discussed moments with deep links.",
            "default": true
          },
          "brandNames": {
            "title": "Your brands",
            "type": "array",
            "description": "Brand names to track in comments. Only names you list are tracked — competitors are never inferred.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "competitorNames": {
            "title": "Competitors",
            "type": "array",
            "description": "Competitor names to track, with the sentiment expressed toward each.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "productNames": {
            "title": "Products",
            "type": "array",
            "description": "Product or model names to track.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "trackedTopics": {
            "title": "Tracked topics",
            "type": "array",
            "description": "Your own themes to count separately from the automatically discovered ones, e.g. price, battery, ease of use.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "yourChannelHandle": {
            "title": "Your channel handle",
            "type": "string",
            "description": "e.g. @yourchannel. Identifies creator comments when the source has no owner flag.",
            "default": ""
          },
          "generateReport": {
            "title": "Generate audience report",
            "type": "boolean",
            "description": "Build the overall and per-video intelligence report (REPORT, REPORT_HTML and REPORT_MARKDOWN in the key-value store). Charged once per saved report.",
            "default": true
          },
          "compareVideos": {
            "title": "Compare videos",
            "type": "boolean",
            "description": "Add a side-by-side comparison when two or more videos are analyzed.",
            "default": true
          },
          "engagementWeighting": {
            "title": "Engagement weighting",
            "enum": [
              "log_likes",
              "likes",
              "none"
            ],
            "type": "string",
            "description": "How likes weigh comments in the weighted mood and rankings. 'Log of likes' keeps one viral comment from dominating. Unweighted results are always included too.",
            "default": "log_likes"
          },
          "maxThemes": {
            "title": "Max themes per list",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many themes, questions and requests each report list shows.",
            "default": 10
          },
          "maxQuotesPerInsight": {
            "title": "Evidence quotes per insight",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Exact comment quotes attached to each theme, question and request.",
            "default": 3
          },
          "excludeCreatorComments": {
            "title": "Exclude creator comments",
            "type": "boolean",
            "description": "Keep the channel owner's comments out of analysis and audience metrics (saved as 'creator_comment', not charged).",
            "default": true
          },
          "excludeEmojiOnly": {
            "title": "Skip emoji-only reactions",
            "type": "boolean",
            "description": "Count emoji/punctuation-only comments as reactions without analyzing or charging them.",
            "default": true
          },
          "minCommentLength": {
            "title": "Min comment length (characters)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Shorter comments are skipped.",
            "default": 3
          },
          "minLikes": {
            "title": "Min likes",
            "minimum": 0,
            "type": "integer",
            "description": "Skip comments with fewer likes.",
            "default": 0
          },
          "includeRepliesInInsights": {
            "title": "Include replies in report metrics",
            "type": "boolean",
            "description": "When off, replies are analyzed but left out of report shares and rankings.",
            "default": true
          },
          "publishedAfter": {
            "title": "Published after",
            "type": "string",
            "description": "Only comments published after this date (YYYY-MM-DD) or within a window such as '30 days'. Relative ages like '3 weeks ago' are approximate.",
            "default": ""
          },
          "publishedBefore": {
            "title": "Published before",
            "type": "string",
            "description": "Only comments published before this date (YYYY-MM-DD).",
            "default": ""
          },
          "analysisBatchSize": {
            "title": "Analysis batch size",
            "minimum": 5,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum comments per AI request. Smaller runs are split across the parallel requests automatically. Leave at the default unless asked by support.",
            "default": 40
          },
          "maxConcurrency": {
            "title": "Parallel AI requests",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Analysis requests in flight at once.",
            "default": 4
          },
          "debugMode": {
            "title": "Debug logging",
            "type": "boolean",
            "description": "Verbose diagnostics in the log. Never logs secrets or prompts.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}