# YouTube Comments Sentiment & Audience Analyzer (`coregent/youtube-comment-sentiment-audience-intelligence`) Actor

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.

- **URL**: https://apify.com/coregent/youtube-comment-sentiment-audience-intelligence.md
- **Developed by:** [Delowar Munna](https://apify.com/coregent) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 comment analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Comment Sentiment & Audience Intelligence

![YouTube Comment Sentiment & Audience Intelligence](https://raw.githubusercontent.com/coregentdevspace/youtube-comment-sentiment-audience-intelligence-assets/main/thumbnail-youtube-comment-sentiment-audience-intelligence.png)

**Turn YouTube comments into evidence-backed audience intelligence.**

Turn YouTube comments into structured audience intelligence. Analyze an existing comment dataset or paste video URLs to uncover sentiment, recurring questions, complaints, praise, content requests, purchase intent, competitor mentions and the moments viewers discuss most. Compare videos and rank insights by engagement while keeping every conclusion linked to real source comments — no AI account or YouTube API key required.

### What this Actor does

- **One analyzed row per comment** — sentiment (label, score, confidence), language, multi-label intents, topics, tracked brand/competitor/product mentions, video timestamps and a spam-like flag.
- **An audience report** — audience mood (unweighted *and* engagement-weighted), what viewers love and dislike, a normalized FAQ, content and feature requests, buying signals, competitor mentions, the most discussed moments, creator-response coverage and a side-by-side video comparison.
- **Evidence for every insight** — each theme, question and request carries its comment count, likes, video IDs and exact quotes with links to the source comments.
- **Code counts, AI classifies** — the AI labels each comment and merges near-identical phrases. Every count, share, weight and ranking is computed by code from the analyzed rows. Quotes are copied from real comments and checked character-for-character before they are saved.

### Comment analysis vs comment scraping

This Actor is an **analysis layer**. If you already collected comments — with [YouTube Comment Scraper PRO](https://apify.com/coregent/youtube-comment-scraper-pro) or any other tool — point this Actor at that dataset and nothing is scraped again. If you only have video URLs, the Actor runs YouTube Comment Scraper PRO for you first.

### Quick start from a dataset

```json
{
    "datasetId": "YOUR_DATASET_ID",
    "maxTotalComments": 2000,
    "analysisDepth": "standard",
    "generateReport": true
}
```

Datasets from `coregent/youtube-comment-scraper-pro` need no mapping. Other datasets work when they use common field names: `text` / `comment` / `commentText`, `commentId` / `id`, `likeCount` / `likes`, `videoId` / `videoUrl`, `isReply` / `parentId` / `parentCommentId`.

### Quick start from video URLs

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=QJBP2uy8LcU"],
    "maxCommentsPerVideo": 500,
    "maxTotalComments": 500,
    "commentSort": "top",
    "includeReplies": true,
    "maxUpstreamCostUsd": 2
}
```

Run it with the defaults and the Actor collects and analyzes **20 comments** from one video — enough to see every output column and a small report. Raise **Max comments to analyze** for real research.

### Product research example

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=VIDEO_A", "https://www.youtube.com/watch?v=VIDEO_B"],
    "maxCommentsPerVideo": 1000,
    "maxTotalComments": 2000,
    "brandNames": ["Our Brand"],
    "competitorNames": ["Competitor A", "Competitor B"],
    "productNames": ["Product X"],
    "trackedTopics": ["price", "battery", "compatibility", "ease of use"],
    "compareVideos": true,
    "maxThemes": 12
}
```

### Example: a real run

This input analyzes the 20 newest comments on a Figma course video, tracks Figma and four competing design tools, and counts three course topics:

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=QJBP2uy8LcU"],
    "maxTotalComments": 20,
    "maxCommentsPerVideo": 20,
    "commentSort": "newest",
    "includeReplies": true,
    "maxRepliesPerComment": 1,
    "maxUpstreamCostUsd": 1,
    "productNames": ["Figma"],
    "competitorNames": ["Penpot", "Sketch", "Adobe XD", "Canva"],
    "trackedTopics": ["auto layout", "prototyping", "components"]
}
```

It returned 20 rows: 18 analyzed comments (11 positive, 3 negative, 2 mixed, 2 neutral) and 2 creator comments that were saved but not analyzed or charged. Below is the **All comments** tab from a run on the same video:

![All comments tab](https://raw.githubusercontent.com/coregentdevspace/youtube-comment-sentiment-audience-intelligence-assets/main/youtube-comment-sentiment-audience-intelligence-output-all-comments-table-view.png)

A comment from that run with a question, a complaint and a tracked product mention:

```json
{
    "recordType": "comment_analysis",
    "commentId": "Ugz1jbwiaYsGy-4gPQt4AaABAg",
    "videoId": "QJBP2uy8LcU",
    "videoTitle": "Free Figma UX Design UI Essentials Course",
    "commentUrl": "https://www.youtube.com/watch?v=QJBP2uy8LcU&lc=Ugz1jbwiaYsGy-4gPQt4AaABAg",
    "author": "@chiomamaryann6320",
    "text": "Hey Dan, I am enjoying the course. Please reply to my questions on Udemy. I am frustrated at the prototyping stage, my features page always shows blank when I preview. Please help. Thank you",
    "likeCount": 0,
    "analysisStatus": "analyzed",
    "language": "en",
    "sentimentLabel": "negative",
    "sentimentScore": -0.5,
    "sentimentConfidence": 0.85,
    "intents": ["question", "support_request", "complaint", "product_problem"],
    "topics": ["prototyping", "prototype preview", "udemy course"],
    "question": "How can the blank features page in prototype preview be fixed?",
    "request": null,
    "mentions": [{ "type": "product", "name": "Figma", "sentiment": "negative" }],
    "isSpamLike": false
}
```

And one that asks for new content, as shown in the **Questions & requests** tab:

```json
{
    "text": "I highly recommend this course. I really like it.\n\nCould you write more courses where we can develop some projects, like a blog, etc.?",
    "likeCount": 0,
    "intents": ["recommendation", "content_request", "praise"],
    "question": null,
    "request": "Courses that develop projects, such as building a blog",
    "sentimentLabel": "positive",
    "commentUrl": "https://www.youtube.com/watch?v=QJBP2uy8LcU&lc=UgzI4qQDNv6Lz974pwd4AaABAg"
}
```

### Sentiment and engagement weighting

Each comment gets `positive`, `neutral`, `negative`, `mixed` or `uncertain`, a score from −1 to +1 and a confidence. The label describes the tone of the **comment text** toward the video or product, never the person who wrote it.

The report shows sentiment two ways: every comment counted once, and weighted by likes. The default weighting is `1 + ln(1 + likes)`, capped at 10, so one viral comment can't dominate. Engagement weighting describes visible agreement and attention on comments. It is not a representative survey of all viewers.

A descriptive polarization indicator (`one_sided_positive`, `one_sided_negative`, `mixed`, `divided`) is always shown with the positive and negative shares behind it.

### Questions, requests and complaints

Intents are multi-label: `question`, `content_request`, `feature_request`, `complaint`, `praise`, `purchase_intent`, `price_question`, `where_to_buy`, `already_purchased`, `alternative_request`, `competitor_mention`, `product_problem`, `confusion`, `support_request`, `experience_report`, `recommendation`, `spam_or_promotion`.

Questions are rewritten as short FAQ entries, and equivalent ones are merged — "What camera is this?" and "Which camera did you use?" become one FAQ item with the combined count. The Actor never invents an answer.

### Audience themes

Topics are not limited to a fixed list. Each comment gets short topic descriptors, and near-identical ones ("battery duration", "battery life") are merged into one theme across all videos in the run, so comparisons line up. Your own **Tracked topics** are counted separately from the discovered themes.

### Buying and competitor signals

Purchase intent, price questions, where-to-buy requests and "already bought it" comments are counted and quoted. The Actor reports what the text says and never predicts whether anyone will buy.

Brands, competitors and products are tracked **only when you list them**. Each mention carries the sentiment expressed toward that name. Competitors are never inferred from random names.

### Timestamp moments

Timestamps that viewers write (`2:31`, `1:02:03`) are converted to seconds and grouped within a few seconds of each other. A **most discussed moment** needs at least two different commenters and comes with a deep link to that second of the video. Aspect ratios like 16:9, times of day marked am/pm and chapter lists are ignored. The video itself is never watched or downloaded.

### Video comparison

With two or more videos, the report adds a side-by-side table: analyzed comments, sentiment split, weighted sentiment, complaint, praise, question, request, purchase and spam shares, creator-response rate and top themes. The wording stays descriptive ("Video A has a lower negative-comment share in this sample") and never declares one video better.

### Evidence and quote integrity

- Every quote is copied from a real comment by code, never written by the AI, and re-checked as an exact excerpt before it is saved. Long comments are cut at a word boundary and marked `truncated: true`.
- Every insight carries its count, likes, video IDs and comment links.
- The short report narrative is written by the AI from the theme names alone. If it contains any number it is discarded, and a narrative written by code is used instead.
- Every analyzed row records `analysisProvider`, `analysisModel`, `promptVersion`, `analysisSchemaVersion` and `analyzedAt`, so results stay reproducible as models change.

### Input reference

| Field                                                                                              | Default          | What it does                                                      |
| -------------------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------- |
| `videoUrls`                                                                                        | one sample video | Videos or Shorts to collect comments from first                   |
| `datasetId`                                                                                        | —                | Existing Apify comment dataset (ID or Console URL)                |
| `comments`                                                                                         | `[]`             | Inline comment objects                                            |
| `maxTotalComments`                                                                                 | `20`             | Hard ceiling on comments read and analyzed                        |
| `maxCommentsPerVideo`                                                                              | `20`             | Video URLs only: comments collected per video                     |
| `commentSort`                                                                                      | `top`            | `top` or `newest`                                                 |
| `includeReplies`                                                                                   | `true`           | Collect and analyze replies                                       |
| `maxRepliesPerComment`                                                                             | `5`              | Video URLs only                                                   |
| `maxUpstreamCostUsd`                                                                               | `2`              | Video URLs only: spending cap for the comment-scraper run         |
| `analysisDepth`                                                                                    | `standard`       | `standard` or `sentiment` (sentiment, language and spam only)     |
| `analyzeSentiment` / `extractIntents` / `extractTopics` / `detectSpam` / `extractTimestampMoments` | `true`           | Individual analysis toggles                                       |
| `brandNames` / `competitorNames` / `productNames` / `trackedTopics`                                | `[]`             | Names and themes to track                                         |
| `yourChannelHandle`                                                                                | —                | Identifies creator comments when the source has no owner flag     |
| `generateReport` / `compareVideos`                                                                 | `true`           | Report and comparison                                             |
| `engagementWeighting`                                                                              | `log_likes`      | `log_likes`, `likes` or `none`                                    |
| `maxThemes` / `maxQuotesPerInsight`                                                                | `10` / `3`       | Report list sizes                                                 |
| `excludeCreatorComments` / `excludeEmojiOnly`                                                      | `true`           | Skip (and don't charge) creator comments and emoji-only reactions |
| `minCommentLength` / `minLikes`                                                                    | `3` / `0`        | Filters                                                           |
| `includeRepliesInInsights`                                                                         | `true`           | Include replies in report metrics                                 |
| `publishedAfter` / `publishedBefore`                                                               | —                | Date filters (`YYYY-MM-DD`, or a window like `30 days`)           |

### Output rows

The dataset holds **only comment rows** — one per source comment, each with an `analysisStatus`:

| Status            | Meaning                                                      | Charged |
| ----------------- | ------------------------------------------------------------ | ------- |
| `analyzed`        | Classified successfully                                      | Yes     |
| `reaction`        | Emoji or punctuation only                                    | No      |
| `creator_comment` | Written by the channel owner (excluded)                      | No      |
| `duplicate`       | Same comment seen earlier in the run                         | No      |
| `empty`           | No text                                                      | No      |
| `filtered`        | Skipped by a filter or the spending limit (see `skipReason`) | No      |
| `analysis_failed` | The AI result could not be validated after retries           | No      |

Every row has the same fields. A real analyzed row with mixed sentiment, from the run above:

```json
{
    "recordType": "comment_analysis",
    "commentId": "UgyHMQQ7xURXH-Mza2N4AaABAg",
    "videoId": "QJBP2uy8LcU",
    "videoUrl": "https://www.youtube.com/watch?v=QJBP2uy8LcU",
    "videoTitle": "Free Figma UX Design UI Essentials Course",
    "commentUrl": "https://www.youtube.com/watch?v=QJBP2uy8LcU&lc=UgyHMQQ7xURXH-Mza2N4AaABAg",
    "author": "@cozuspace",
    "text": "Hi Great course! but you haven't updated this new one in coursera. can you please update the coursera or direct me to the link for coursera thankyou",
    "likeCount": 0,
    "replyCount": 0,
    "isReply": false,
    "parentCommentId": null,
    "isPinned": false,
    "isHeartedByCreator": false,
    "isByVideoOwner": false,
    "publishedTimeText": null,
    "publishedAtApprox": "2026-08-14T15:19:32.000Z",
    "analysisStatus": "analyzed",
    "skipReason": null,
    "language": "en",
    "sentimentLabel": "mixed",
    "sentimentScore": 0.1,
    "sentimentConfidence": 0.8,
    "intents": ["praise", "complaint", "where_to_buy"],
    "topics": ["coursera course update", "course availability"],
    "question": null,
    "request": null,
    "mentions": [],
    "timestamps": [],
    "isSpamLike": false,
    "spamCategory": null,
    "spamConfidence": 0.05,
    "analysisProvider": "anthropic",
    "analysisModel": "claude-haiku-5-5",
    "promptVersion": "p1.1",
    "analysisSchemaVersion": "1.0",
    "analyzedAt": "2026-11-03T03:49:36.857Z"
}
```

Some fields are often empty, by design:

- `question` and `request` are filled only when the comment asks something or requests something.
- `mentions` lists only the names you track (`productNames`, `competitorNames`, `brandNames`).
- `timestamps` lists only the video times the comment cites, such as "at 12:40".
- `spamCategory` is set only for spam-like comments.
- `skipReason` is set only for `filtered` rows.
- `publishedTimeText` is the source's relative date ("3 weeks ago"), present only when the source gives one instead of an exact date. Video-URL mode always has the exact date in `publishedAtApprox`.
- Analysis fields are `null` on rows that weren't analyzed.

Dataset tabs: **All comments**, **Sentiment**, **Questions & requests**, **Topics, mentions & moments**, **Engagement & creator**, **Status & spam**. Apify tabs choose columns but can't filter rows. For ready-made lists such as negative comments, top questions or complaint themes, use the report. To filter rows yourself, use the dataset API or export and filter on `sentimentLabel`, `intents` or `isSpamLike`.

### Reports

The run's key-value store holds:

- **`REPORT_HTML`** — the human-readable report: executive summary, audience mood, what viewers love and dislike, what they ask, what they want next, commercial signals, tracked names, most discussed moments, creator response, video comparison, and method and limitations.
- **`REPORT`** — the full report as JSON (overall, per video and comparison).
- **`REPORT_MARKDOWN`** — the same report for Notion, Slack, GitHub or LLM workflows.
- **`OUTPUT`** — a compact summary for API callers, Make, Zapier, n8n and AI agents: coverage, mood, top themes, complaints, questions, requests, purchase signals, mentions, moments, comparison and report links.

Spam-like comments stay in the dataset but are left out of report metrics.

### Pricing

This Actor uses pay-per-event pricing with two events:

- **Comment analysis** — once per comment with status `analyzed`. Reactions, creator comments, duplicates, empty, filtered and failed rows are free.
- **Audience report** — once per run when the report is saved. No report charge when no comment could be analyzed, or when the report fails.

There is no start fee: a run that finds no comments costs nothing. See the **Pricing** tab for current rates. This README deliberately doesn't quote figures, because rates are set on the platform and can change.

### Upstream scraping costs

When you provide **video URLs**, comments are collected by [YouTube Comment Scraper PRO](https://apify.com/coregent/youtube-comment-scraper-pro), which runs as a separate Actor on your account and charges at its own published rates. Those charges are never hidden inside this Actor's prices. Datasets and inline comments involve no scraping at all.

### Cost controls

- **Max comments to analyze** caps every source and the analysis together.
- **Max source spend** caps the comment-scraper run: collection is cut before it starts so its charges fit, and the cap is also set as that run's Apify charge limit.
- **Your run spending limit** is respected before any analysis starts. If it covers fewer comments than requested, only that many are analyzed. The rest are saved as `filtered` with `skipReason: "spending_limit"`, uncharged, and the adjusted ceiling is reported in `OUTPUT.analysisCeiling`. If the limit is reached during the run, the remaining comments are saved the same way without being sent to the AI.
- Analysis is charged per batch right after the rows are saved, so partial results are kept, and paid for, even if a later step fails.

### Multilingual behavior

Language is detected per comment. Analysis is **best-effort multilingual**: no language has been benchmarked as fully supported yet. Theme names, FAQ entries and requests are written in English. Original quotes are never translated or changed.

### Sampling and accuracy limitations

- YouTube exposes public comments only — not every viewer, and not deleted, held or private comments.
- "Top" sorting over-represents highly ranked comments; "Newest" represents recency, not the whole audience.
- Likes are visible engagement, not survey weights.
- Relative publish dates ("3 weeks ago") are approximate.
- Sentiment, intents and spam are AI classifications and can be wrong, especially with sarcasm and mixed-language text. No accuracy percentage is published until it has been measured on a human-labeled benchmark.
- A report is a description of public comments, not a statistically representative audience survey.

### Privacy and responsible use

The Actor analyzes **what a comment says**, never **who wrote it**. It does not infer age, gender, ethnicity, religion, politics, health, sexuality, income or identity. It does not match commenters to real people and never posts replies. Comment text is treated as untrusted data: a comment that tries to instruct the AI is classified like any other comment. Public comments can still contain personal data, and you are responsible for your own data-protection obligations when you store or use the results.

### API and integrations

Run it from the Apify API, the Python or JavaScript clients, Make, Zapier, n8n or an MCP-connected AI agent. For a scheduled monitoring workflow, schedule YouTube Comment Scraper PRO to collect new comments, then trigger this Actor on its dataset through an integration.

### FAQ

**Do I need an OpenAI, Anthropic or YouTube API key?** No.

**Can I analyze comments I scraped with another tool?** Yes — pass the dataset ID. Common field names are recognized automatically.

**Why is a comment marked `filtered`?** Check `skipReason`: `too_short`, `below_min_likes`, `replies_excluded`, `published_before_range`, `published_after_range`, `unknown_publish_date` or `spending_limit`.

**Are spam-like comments charged?** Yes, if they were analyzed — classifying them is the work. They are left out of report metrics, and you can filter on `isSpamLike`.

**Is the report a survey of my audience?** No. It describes the public comments that were analyzed. See the limitations above.

### Changelog

- **1.0** — Initial release: dataset, inline and video-URL sources; sentiment, intents, topics, spam, tracked mentions and timestamp moments; deterministic report with verified quotes; HTML, JSON and Markdown reports; video comparison; spend guards.

# Actor input Schema

## `videoUrls` (type: `array`):

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.

## `datasetId` (type: `string`):

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.

## `comments` (type: `array`):

Comment objects sent directly, e.g. \[{"text": "Great video!", "videoId": "QJBP2uy8LcU", "likeCount": 3}]. Useful for API calls and curated samples.

## `maxTotalComments` (type: `integer`):

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.

## `maxCommentsPerVideo` (type: `integer`):

Video URLs only: how many comments the comment scraper collects per video.

## `commentSort` (type: `string`):

Top comments (most engaged) or newest comments first.

## `includeReplies` (type: `boolean`):

Collect and analyze replies as well as top-level comments. When off, replies in a dataset are skipped (saved as 'filtered', not charged).

## `maxRepliesPerComment` (type: `integer`):

Video URLs only: replies collected per top-level comment.

## `maxUpstreamCostUsd` (type: `integer`):

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.

## `analysisDepth` (type: `string`):

'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.

## `analyzeSentiment` (type: `boolean`):

Label each comment positive, neutral, negative, mixed or uncertain, with a score from -1 to +1 and a confidence.

## `extractIntents` (type: `boolean`):

Multi-label intents: question, content request, feature request, complaint, praise, purchase intent, price question, where to buy, competitor mention, product problem, confusion and more.

## `extractTopics` (type: `boolean`):

Short topic descriptors per comment, merged into report-level themes across all videos.

## `detectSpam` (type: `boolean`):

Flag spam-like text (self-promotion, scams, link spam, filler). Spam-like comments stay in the dataset but are left out of report metrics.

## `extractTimestampMoments` (type: `boolean`):

Find video timestamps mentioned in comments (e.g. 2:31) and rank the most discussed moments with deep links.

## `brandNames` (type: `array`):

Brand names to track in comments. Only names you list are tracked — competitors are never inferred.

## `competitorNames` (type: `array`):

Competitor names to track, with the sentiment expressed toward each.

## `productNames` (type: `array`):

Product or model names to track.

## `trackedTopics` (type: `array`):

Your own themes to count separately from the automatically discovered ones, e.g. price, battery, ease of use.

## `yourChannelHandle` (type: `string`):

e.g. @yourchannel. Identifies creator comments when the source has no owner flag.

## `generateReport` (type: `boolean`):

Build the overall and per-video intelligence report (REPORT, REPORT_HTML and REPORT_MARKDOWN in the key-value store). Charged once per saved report.

## `compareVideos` (type: `boolean`):

Add a side-by-side comparison when two or more videos are analyzed.

## `engagementWeighting` (type: `string`):

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.

## `maxThemes` (type: `integer`):

How many themes, questions and requests each report list shows.

## `maxQuotesPerInsight` (type: `integer`):

Exact comment quotes attached to each theme, question and request.

## `excludeCreatorComments` (type: `boolean`):

Keep the channel owner's comments out of analysis and audience metrics (saved as 'creator_comment', not charged).

## `excludeEmojiOnly` (type: `boolean`):

Count emoji/punctuation-only comments as reactions without analyzing or charging them.

## `minCommentLength` (type: `integer`):

Shorter comments are skipped.

## `minLikes` (type: `integer`):

Skip comments with fewer likes.

## `includeRepliesInInsights` (type: `boolean`):

When off, replies are analyzed but left out of report shares and rankings.

## `publishedAfter` (type: `string`):

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.

## `publishedBefore` (type: `string`):

Only comments published before this date (YYYY-MM-DD).

## `analysisBatchSize` (type: `integer`):

Maximum comments per AI request. Smaller runs are split across the parallel requests automatically. Leave at the default unless asked by support.

## `maxConcurrency` (type: `integer`):

Analysis requests in flight at once.

## `debugMode` (type: `boolean`):

Verbose diagnostics in the log. Never logs secrets or prompts.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=QJBP2uy8LcU"
  ],
  "datasetId": "",
  "comments": [],
  "maxTotalComments": 20,
  "maxCommentsPerVideo": 20,
  "commentSort": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 5,
  "maxUpstreamCostUsd": 2,
  "analysisDepth": "standard",
  "analyzeSentiment": true,
  "extractIntents": true,
  "extractTopics": true,
  "detectSpam": true,
  "extractTimestampMoments": true,
  "brandNames": [],
  "competitorNames": [],
  "productNames": [],
  "trackedTopics": [],
  "yourChannelHandle": "",
  "generateReport": true,
  "compareVideos": true,
  "engagementWeighting": "log_likes",
  "maxThemes": 10,
  "maxQuotesPerInsight": 3,
  "excludeCreatorComments": true,
  "excludeEmojiOnly": true,
  "minCommentLength": 3,
  "minLikes": 0,
  "includeRepliesInInsights": true,
  "publishedAfter": "",
  "publishedBefore": "",
  "analysisBatchSize": 40,
  "maxConcurrency": 4,
  "debugMode": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `reportHtml` (type: `string`):

No description

## `report` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `reportMarkdown` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=QJBP2uy8LcU"
    ],
    "maxTotalComments": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("coregent/youtube-comment-sentiment-audience-intelligence").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "videoUrls": ["https://www.youtube.com/watch?v=QJBP2uy8LcU"],
    "maxTotalComments": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("coregent/youtube-comment-sentiment-audience-intelligence").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=QJBP2uy8LcU"
  ],
  "maxTotalComments": 20
}' |
apify call coregent/youtube-comment-sentiment-audience-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,coregent/youtube-comment-sentiment-audience-intelligence"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/kYjdu10P853NHiYD9/builds/yLBtWtkJaAGsPBn3J/openapi.json
