# YouTube Comments Scraper + Audience Insights (`happysproutstore/youtube-comments-insights`) Actor

Scrape YouTube comments from videos or a channel's latest uploads without an API key. Each comment is labelled as question, content request, complaint, praise or willingness to pay, and an optional insights row per video lists top viewer questions, video requests and keywords.

- **URL**: https://apify.com/happysproutstore/youtube-comments-insights.md
- **Developed by:** [Recep Vural](https://apify.com/happysproutstore) (community)
- **Categories:** Social media, Videos, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 comments

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 Comments Scraper + Audience Insights

Paste video URLs, video IDs or a channel URL. You get **every comment as a row** and, optionally, **one insights row per video** that tells you what the audience is asking for. No YouTube API key and no AI model: the labels come from transparent keyword rules.

### What you get

**Comment rows** (`type: "comment"`): `videoId`, `commentId`, `text`, `author` (display name as YouTube shows it), `likeCount`, `replyCount`, `publishedTime`, `isReply`, `parentId`, `isPinned`, `isHeartedByCreator`, plus rule labels:

| Label | Catches (examples) |
|---|---|
| `isQuestion` | "?", "how do you…", Turkish "… mi", "neden…" |
| `isContentRequest` | "make a video about…", "part 2", "can you review…", "devamı gelsin", "2. bölüm", "lütfen … yapın" |
| `isComplaint` | "boring", "clickbait", "too many ads", "sıkıcı", "yanlış bilgi" |
| `isPraise` | "great video", "thank you", "emeğinize sağlık", ❤️ 🔥 👏 |
| `willingToPay` | "I'd pay", "where can I buy", "take my money", "nereden alabilirim", "kaç para" |

**Insights rows** (`type: "insights"`, one per video): count and share of each label, a tone score, the **top 10 questions** and **top 10 video requests** ranked by likes (verbatim, shortened), top complaints, purchase-intent comments, top keywords and two-word phrases (stopwords removed for EN, TR, ES, DE), most-liked themes, and the keywords inside requests and questions. The creator's own replies are left out of the insights.

Errors (`type: "error"`) are listed for videos that are unavailable, private or have comments turned off. They are free.

### Who it is for

- Creators and agencies choosing the next video from what viewers ask for
- Product and marketing teams mining reviews and questions under competitor videos
- Researchers who need clean comment data

### Input example

```json
{"videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://www.youtube.com/@mkbhd"],
 "maxVideosPerChannel": 3, "maxCommentsPerVideo": 300, "sort": "top", "includeReplies": false, "includeInsights": true}
```

### Output example (insights row, shortened)

```json
{"type": "insights", "videoId": "NiCgcUTL9_Q", "sort": "newest", "commentsAnalyzed": 299, "contentRequestCount": 30, "sentimentLabel": "positive",
 "topContentRequests": [{"text": "I would love to see a video about submarine cables and fiber amplifiers!!!! thx", "likeCount": 0}],
 "topBigrams": [{"term": "submarine cables", "comments": 18, "likes": 0}]}
```

### Speed and limits

About 100 comments per 1-3 seconds per video; 3 videos run in parallel by default. Rules are tuned for English and Turkish, with basic Spanish and German. Rule labels are signals, not perfect classification: sarcasm and very short comments can be mislabelled.

### Reliability

Comments are read with the open-source yt-dlp library. On a block or network error the Actor retries with a new proxy session and backoff, up to 4 times per video. A video that still fails returns an error row and is **not charged**. You pay only for comment rows and insights rows that were delivered.

Not affiliated with YouTube or Google. By HAPPYSPROUTSTORE LLC.

# Actor input Schema

## `videos` (type: `array`):

One per line: a video URL (watch, youtu.be, Shorts), an 11-character video ID, or a channel URL such as https://www.youtube.com/@name. A channel is expanded to its latest videos.

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

Upper limit of comment rows per video, replies included. Large values take longer: roughly 100 comments per 2-4 seconds.

## `maxVideosPerChannel` (type: `integer`):

How many of the newest uploads to take from each channel URL.

## `sort` (type: `string`):

Top comments gives the most liked and most discussed comments first; newest gives the latest ones.

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

Also return replies under each comment (marked isReply with parentId). Replies count toward the per-video limit.

## `maxRepliesPerThread` (type: `integer`):

Only used when replies are included.

## `includeInsights` (type: `boolean`):

Adds one row per video with label counts and shares, top 10 viewer questions and top 10 video requests by likes, top keywords and two-word phrases, most-liked themes and a simple tone score. Rule based, no AI model.

## `languages` (type: `array`):

Which rule packs label the comments. Leave all selected for mixed comment sections. English and Turkish are the most complete.

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

How many videos are fetched at the same time.

## `proxyConfiguration` (type: `object`):

YouTube may block busy IPs. On a block the Actor retries with a new proxy session. The default Apify proxy is enough for most runs; switch to Residential for very large batches.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 50,
  "maxVideosPerChannel": 5,
  "sort": "top",
  "includeReplies": false,
  "maxRepliesPerThread": 5,
  "includeInsights": true,
  "languages": [
    "en",
    "tr",
    "es",
    "de"
  ],
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `comments` (type: `string`):

No description

## `insights` (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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "maxCommentsPerVideo": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("happysproutstore/youtube-comments-insights").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 = {
    "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "maxCommentsPerVideo": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("happysproutstore/youtube-comments-insights").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 '{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call happysproutstore/youtube-comments-insights --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,happysproutstore/youtube-comments-insights"
        }
    }
}
```

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/n15JBoHl3LcgdtIBd/builds/hFaFM2X8yHJ8TKJFv/openapi.json
