# YouTube Comments Scraper: Comments, Questions & Sentiment (`precious_bathmat/youtube-comments-scraper`) Actor

Scrape YouTube comments and replies from any video or Short, sorted by top or newest. Plus a report per video: top comments, viewer questions, complaints, most-mentioned moments, keywords, sentiment and creator replies. No API key, no login.

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

## Pricing

from $0.50 / 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: Comments, Questions & Sentiment

Scrape **YouTube comments** from any video or Short, with no API key and no login, and get a **report for every video** that tells you what the comments actually say:

- **Every comment**: text, likes, reply count, date, link, and whether it is pinned, hearted or written by the creator
- **Replies** under each comment (optional)
- **Top or newest first**: what YouTube shows first, or what people are saying right now
- **Video report**: top comments, the questions viewers ask, the complaints, the **moments people mention** ("1:23:24 ..."), keywords and phrases, sentiment, emoji and how often the creator hearts or replies
- **Video details**: title, channel, views, likes, publish date and comments per 1,000 views

### What does this YouTube comments scraper do?

```
Learn Python - Full Course for Beginners · freeCodeCamp.org
 49.4M views · 46,100 comments · 0.93 comments per 1,000 views
 500 newest comments: 35.6% positive, 3.2% negative
 Most-mentioned moment: 1:23:20 (30 comments)
 Top question: "Want more from Mike? He's starting a coding RPG/Bootcamp…" (4,700 likes, pinned)
 Top phrases: learn python · python course · hello world · try except
```

1. Paste **video links** (watch pages, Shorts, youtu.be links or plain video ids).
2. Choose **how many comments** per video, **top or newest**, and whether to include **replies**.
3. You get **every comment** in the dataset and **one report per video**, plus a CSV of all reports.

```mermaid
flowchart LR
    A[Video links,<br/>Shorts, ids] --> B[YouTube's own<br/>comment feed]
    B --> C[Comments<br/>+ replies]
    C --> D[Dataset<br/>one row per comment]
    C --> E[Video report<br/>questions, complaints,<br/>moments, keywords,<br/>sentiment]
```

### Who is it for?

- **YouTubers and channel managers**: what your viewers ask, what they complain about, which moments they talk about, and how often you reply
- **Marketers and brands**: what people say about a product launch, an ad, a review or a competitor's video
- **Product and market researchers**: real questions and objections, in the audience's own words, from thousands of comments
- **Agencies and analysts**: comment sentiment and engagement across a list of videos, as a table
- **AI and data teams**: clean comment text for training, topic modelling or sentiment models

### What data do you get?

**Comments** (dataset, one row per comment or reply)

| Field | What it tells you |
|---|---|
| `videoId`, `videoTitle` | Which video |
| `commentId`, `parentCommentId`, `isReply` | The comment, and for replies the comment it answers |
| `text` | The comment |
| `likes`, `replies` | Engagement |
| `publishedTimeText`, `approxPublishedAt`, `edited` | When it was posted ("3 days ago" and the date it works out to) |
| `isPinned`, `isHearted`, `isByCreator` | Pinned by the creator, hearted by the creator, written by the creator |
| `sentiment`, `isQuestion`, `timestamps` | Positive, negative or neutral; a question; the video times it mentions |
| `url` | Direct link to the comment |

**Video report** (`REPORTS` and `REPORT_<videoId>`, one per video)

| Field | What it tells you |
|---|---|
| `title`, `channel`, `channelUrl`, `channelSubscribers`, `views`, `likes`, `publishedDate` | The video |
| `totalComments`, `commentsPer1kViews`, `likesPer1kViews` | How much people engage |
| `commentsRead`, `repliesRead`, `medianCommentLikes`, `top10LikeSharePercent` | What the report is based on, and how concentrated the likes are |
| `sentiment` | Positive, negative and neutral share |
| `creator` | Pinned comment, hearted comments, creator replies |
| `commentAge` | Comments from the last 24 hours, 7 days, 30 days, year, older |
| `topComments` | The 10 most-liked comments |
| `topQuestions` | The 10 most-liked questions |
| `topNegative` | The 5 most-liked negative comments |
| `topMoments` | Video times mentioned by 2+ comments, with a link to that moment |
| `topKeywords`, `topPhrases`, `topEmoji` | What people talk about |

`REPORTS_CSV` has one flat row per video, ready for a spreadsheet. `RUN_SUMMARY` lists any problems and the limits of the data.

### Example: 2 October 2026

Two runs: 6 videos at 300 top comments each, and 5 videos at 500 newest comments each.

| Video | Views | Comments | Per 1,000 views | Positive | Negative |
|---|---|---|---|---|---|
| Learn Python - Full Course (freeCodeCamp) | 49.4M | 46,100 | 0.93 | 35.6% | 3.2% |
| But what is a neural network? (3Blue1Brown) | 24.6M | 9,350 | 0.38 | 49.4% | 4.0% |
| Steve Jobs' 2005 Stanford Commencement Address | 49.2M | 29,194 | 0.59 | 42.8% | 2.4% |
| Inside the Mind of a Master Procrastinator (TED) | 62.0M | 79,654 | 1.29 | 29.6% | 7.6% |
| Let's build GPT: from scratch (Andrej Karpathy) | 8.0M | 3,306 | 0.41 | 41.2% | 2.6% |

What the reports surfaced:

- **Moments**: 30 of the 500 newest comments on the Python course point at the same 10 seconds (**1:23:20**). On Karpathy's GPT video the most-mentioned moments are **57:00** (one viewer flags a possible slip) and **1:20:00**, the self-attention formula.
- **Phrases**: "panic monster" and "instant gratification monkey" for the TED talk; "stay hungry, stay foolish" for Steve Jobs; "self attention", "head size" and "block size" for Karpathy.
- **Top comments** (top sort): "Inside the mind of master procrastinator. Me: adds to 'watch later'" with **74,000 likes**; a 73-year-old learning Python with **35,000**.
- **Activity**: the neural network video still gets about **11 comments a day**, eight years after it was posted.

### Pricing

**$0.0005 per comment** saved ($0.50 per 1,000) and **$0.02 per video report**.

- 1 video, 200 comments: **$0.12**
- 5 videos, 500 comments each: **$1.35**
- Reports only (turn off "Save comments"): **$0.02 per video**, still based on every comment read

### Good to know

- **No names**: the Actor does not collect commenter names, handles or channels, and replaces @handles inside comment text with `@user`. You get what was said, not who said it.
- **Dates are approximate**: YouTube shows "3 days ago" or "1 year ago", so `approxPublishedAt` is only as precise as that.
- **Like counts are rounded** by YouTube above 1,000 ("1.2K"). Video likes are exact when YouTube sends them, otherwise rounded (`likesRounded: true`).
- **Top vs newest**: top comments skew old and popular; newest shows what people say now. Pinned comments come first in both.
- **Sentiment is a simple rule** (English words and emoji). It works for the share of positive and negative comments across hundreds of comments, not for judging a single comment, and it misses sarcasm.
- **Large runs keep going**: YouTube blocks an address after a few hundred pages. The Actor then switches to Apify Proxy on its own (datacenter first, residential only if needed), at no extra cost to you. A test run read **13,289 comments and replies from 10 videos** this way. If every address is blocked, the run stops cleanly, keeps what it read and says so in `RUN_SUMMARY`.
- **Comments turned off** (for example videos made for kids), private and removed videos are listed in `RUN_SUMMARY`, and nothing is charged for them.
- Data comes from **YouTube's public web comment feed**, the same one youtube.com loads under every video.

### Input

| Field | Meaning |
|---|---|
| **Videos** | Video links, Shorts links, youtu.be links or ids |
| **Comments per video** | 1 to 20,000 (default 200) |
| **Sort** | Top comments or newest first |
| **Include replies** | Off by default |
| **Replies per comment** | 1 to 500 (default 20) |
| **Save comments** | On by default; off = reports only |

### Integrations

Export to JSON, CSV, Excel or Google Sheets, or connect through the Apify API, webhooks, Make, Zapier and n8n. **Schedule it** with "newest first" to follow the comments on your latest videos every day.

# Actor input Schema

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

YouTube video links, Shorts links, youtu.be links or video ids. One report per video.

## `maxComments` (type: `integer`):

Most top-level comments to read per video (1 to 20,000). Replies are counted separately.

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

Top comments (what YouTube shows first) or newest first (to see current activity).

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

Also read the replies under each comment.

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

Most replies to read under each comment (1 to 500), when replies are included.

## `saveComments` (type: `boolean`):

Save every comment to the dataset (charged per comment). Turn off to pay for the video reports only; the reports still use every comment read.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=rfscVS0vtbw",
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxComments": 200,
  "sort": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "saveComments": true
}
```

# Actor output Schema

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

One row per comment or reply: text, likes, replies, date, pinned, hearted, by creator, sentiment, question, timestamps, link.

## `reports` (type: `string`):

One report per video: top comments, questions, complaints, most-mentioned moments, keywords, sentiment, creator engagement.

## `reportsCsv` (type: `string`):

One flat row per video.

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

Requests, problems and the limits of the data.

# 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=rfscVS0vtbw",
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("precious_bathmat/youtube-comments-scraper").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=rfscVS0vtbw",
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("precious_bathmat/youtube-comments-scraper").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=rfscVS0vtbw",
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call precious_bathmat/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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

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/1TwD4J6WOYeCshMna/builds/oxGP7t8lV69mUwsDn/openapi.json
