# YouTube Comments Scraper: Replies & Channels (`paul_studio/youtube-comments-scraper`) Actor

YouTube comments with replies from videos, Shorts, channels, playlists, hashtags and searches. Threads kept together, creator replies and pins marked, keyword and question filters, only-new-comments monitoring.

- **URL**: https://apify.com/paul_studio/youtube-comments-scraper.md
- **Developed by:** [Paul Yu](https://apify.com/paul_studio) (community)
- **Categories:** Videos, Social media, AI
- **Features:** Limited permissions
- **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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### What does YouTube Comments Scraper do?

It collects YouTube comments in bulk, with their replies, from single videos or from whole channels, playlists, hashtags and searches. Each comment comes back with its author, likes, date, reply count and the creator's signals, already grouped into threads.

- **Paste anything.** Video and Shorts links, `@handles`, channel and playlist links, `#hashtags` or search words in one list. For a channel or search, the newest or top videos are read.
- **Threads kept together.** Replies carry `parentId` and `threadId`, and the results page shows them under their comment. Replies are optional and capped per comment, so one busy thread cannot fill your quota.
- **The creator's voice marked.** Comments written by the channel itself, comments the creator hearted, and pinned comments are flagged.
- **Honest numbers.** The report shows, per video, how many comments were read against the number YouTube displays, and why they can differ. Dates and likes are kept exactly as YouTube shows them and converted with their precision stated.
- **Filters that save money.** Keywords, words to skip, minimum likes, only questions, posted after a date. Filtered comments are not charged.
- **Only new comments.** On a schedule, each run delivers, and charges for, only comments you have not received before.

**Price:** $0.0008 per comment on the Free plan, down to $0.0005 on Gold; replies count as comments. $1 ≈ 1,250 comments on the Free plan, up to 2,000 on Gold. Each run also has a start fee of $0.001 ($0.0007 on Gold), so a scheduled run that finds nothing new costs a tenth of a cent. To cap spending, set Maximum cost per run in Run options; the run never goes over it. The cost limit always uses your own plan's price.

![Results page: comments as threads, creator replies marked, search and filters](https://raw.githubusercontent.com/daupaul/apify-actor-assets/main/youtube-comments/hero.png)

### What you get for each comment

| Comment | Author and thread | Video |
|---|---|---|
| Text, link to the comment | Author handle and channel link | Title, link |
| Likes (and as YouTube shows them) | Written by the creator, verified | Channel |
| Posted (as shown, and as a date with its precision), edited | Reply or top comment, parent, thread | The line from your input |
| Pinned, hearted by the creator | Reply count | |

Videos without comments to save (no comments yet, comments turned off, private, members only, removed) and sources that cannot be found get a row with the reason, free of charge.

After each run, the **Results page** in the Output tab shows the comments as threads with search, sorting (most liked, newest), a video filter, creator-only, questions-only and top-level-only views, light and dark mode, and a CSV download.

### How to use it

1. Paste videos, channels, playlists, hashtags or search words, one per line.
2. Set **Comments per video**. End a line with `| 500` to take a different number from that line.
3. Choose **Top comments** or **Newest first**, and whether to include replies.
4. Click **Start**. Fifty comments from one video take a few seconds.

To follow comments on a video or a channel, turn on **Only new comments**, pick **Newest first**, give the monitor a name and add a [schedule](https://docs.apify.com/platform/schedules).

### Input example

```json
{
  "sources": ["https://www.youtube.com/watch?v=jNQXAC9IVRw | 200", "@mkbhd"],
  "maxComments": 50,
  "maxVideos": 3,
  "commentSort": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 5,
  "keywords": ["battery", "price"]
}
```

### Output example

```json
{
  "commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "text": "We're so honored that the first ever YouTube video was filmed here!",
  "author": "@SanDiegoZoo",
  "authorChannelUrl": "https://www.youtube.com/channel/UCC5NfQ6Mf0dq_eEwv4P_hWA",
  "isCreator": false,
  "likes": 4800000,
  "likesText": "4.8M",
  "replyCount": 986,
  "isReply": false,
  "parentId": null,
  "threadId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "publishedText": "6 years ago",
  "publishedAt": "2020-11-19",
  "publishedPrecision": "year",
  "edited": false,
  "pinned": true,
  "heartedByCreator": true,
  "commentUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "videoTitle": "Me at the zoo",
  "status": "ok"
}
```

### Use cases

- **Audience research:** what viewers ask, praise and complain about, with the questions filter as a ready FAQ list.
- **Brand and product monitoring:** follow review channels or your own videos and get new comments on a schedule.
- **Sentiment analysis and AI:** clean text, threads and like counts as input for your own models.
- **Creator and community management:** find unanswered questions, see what the creator replied to and hearted.

### FAQ

#### Why are fewer comments read than YouTube shows?

Two reasons. YouTube lists only about 1,000 to 1,500 comments in each order (Top or Newest), even on videos with millions; when you ask for more, the Actor reads both orders and combines them without duplicates, which roughly doubles what any single listing gives. And the number under a video counts comments YouTube hides: held for review, removed, filtered as spam, or from deleted accounts. The report lists, for every video, the comments read and the number YouTube shows.

#### How exact are dates and likes?

YouTube shows comment dates as "3 weeks ago" and rounds likes above 1,000 (1.8K). `publishedText` and `likesText` keep exactly what YouTube shows; `publishedAt` and `likes` turn them into a date (a UTC time for comments from the last day) and a number, and `publishedPrecision` says how far the date can be off (a "2 years ago" comment can be up to a year older). A like count YouTube shows in a form that cannot be read is left empty, never guessed.

#### Are replies charged?

Yes, each saved reply is a comment. They are off by default and capped per comment when on.

#### What happens when YouTube blocks a request?

Each request is retried from new IP addresses, and the run switches to residential IPs when your plan includes them. If a video stops answering part way through, or a reply thread cannot be read, the comments read so far are kept and the report says so for that video.

#### Can I get comments on community posts?

Not yet. Videos, Shorts and live stream replays are supported.

#### Is it legal to scrape YouTube comments?

The Actor reads comments YouTube shows publicly to any viewer, without signing in. Comments contain personal data (names and handles), so make sure your use complies with privacy law such as the GDPR, and with YouTube's terms.

### Use it from AI assistants and code

Works as a tool in Claude, ChatGPT, Cursor and other assistants through the [Apify MCP server](https://mcp.apify.com/). Add `https://mcp.apify.com?tools=paul_studio/youtube-comments-scraper` to your MCP client and ask, for example: "Get the 100 top comments on my latest video and list the questions viewers ask."

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("paul_studio/youtube-comments-scraper").call(run_input={
    "sources": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"], "maxComments": 100, "onlyQuestions": True,
})
for c in client.dataset(run["defaultDatasetId"]).iterate_items():
    if c["status"] == "ok":
        print(c["likesText"], c["text"][:80])
```

### Pricing

You pay per comment saved (replies count as comments). Videos without comments, filtered comments, duplicates and comments already delivered to a monitor are free. Proxies are included. Set a maximum cost per run in the run options and the Actor never goes over it.

### Feedback

Something missing or wrong? Open an issue on the **Issues** tab with the video link.

# Actor input Schema

## `sources` (type: `array`):

One per line. For a channel, playlist, hashtag or search, the newest or top videos are read. End a line with | 500 to take 500 comments per video from that line.

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

Top-level comments; replies, when included, come on top of this number.

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

Newest first is best for keeping up with new comments.

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

Adds replies under each comment. Replies are charged like comments.

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

In the order YouTube shows them. A popular comment can have thousands.

## `keywords` (type: `array`):

One word or phrase per line, e.g. "price" or "battery". Any of them. Not case-sensitive.

## `excludeKeywords` (type: `array`):

e.g. "giveaway" or "subscribe to my channel".

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

Uses the count YouTube shows, which is rounded above 1,000 (1.2K).

## `onlyQuestions` (type: `boolean`):

Comments with a question mark: what viewers ask, for FAQs and content ideas.

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

A date or a period such as 7 days. YouTube shows comment dates as "3 weeks ago", so this is approximate.

## `maxVideos` (type: `integer`):

Channels are read newest first. One number for the whole line, across tabs.

## `channelTabs` (type: `array`):

Newest of each tab in turn. A link to a tab (…/@name/shorts) reads only that tab.

## `onlyNewVideos` (type: `boolean`):

Skip comments this monitor has already delivered, so a scheduled run returns and charges only new ones. Set Order to Newest first, or new comments may sit below the ones already delivered.

## `monitorName` (type: `string`):

Give each schedule its own name, e.g. "launch-video". Use a new name to start over. Runs with the same name share one history, also across Tasks.

## Actor input object example

```json
{
  "sources": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxComments": 100,
  "commentSort": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 5,
  "keywords": [],
  "excludeKeywords": [],
  "onlyQuestions": false,
  "maxVideos": 10,
  "channelTabs": [
    "videos"
  ],
  "onlyNewVideos": false,
  "monitorName": "default"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

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

No description

## `report` (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 = {
    "sources": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ],
    "maxComments": 100,
    "commentSort": "top",
    "maxVideos": 10,
    "channelTabs": [
        "videos"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("paul_studio/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 = {
    "sources": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
    "maxComments": 100,
    "commentSort": "top",
    "maxVideos": 10,
    "channelTabs": ["videos"],
}

# Run the Actor and wait for it to finish
run = client.actor("paul_studio/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 '{
  "sources": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxComments": 100,
  "commentSort": "top",
  "maxVideos": 10,
  "channelTabs": [
    "videos"
  ]
}' |
apify call paul_studio/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,paul_studio/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/AohkkycXvhslvDP2e/builds/geXZYa2wKYeZx254K/openapi.json
