# YouTube Comment Scraper: Comments and Replies (`herus13/youtube-comment-scraper`) Actor

Scrape the comments and replies of any YouTube video with no login and no API key. Every row carries the text, author, likes, date and parent comment. Export JSON, CSV or Excel.

- **URL**: https://apify.com/herus13/youtube-comment-scraper.md
- **Developed by:** [herus13](https://apify.com/herus13) (community)
- **Categories:** Social media, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 youtube 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

The YouTube Comment Scraper extracts the comments and replies of any YouTube video, with no login and no API key. Get one clean row per comment with its text, author, likes, date and the thread it belongs to, ready for sentiment analysis, community research or moderation reviews.

### What you get

One row per comment or reply. It carries the comment text, the author's name, channel id and link, whether the author is verified or the video's uploader, the like count, whether the comment is pinned or hearted by the creator, the date, the parent comment for a reply, and the video's total comment count.

```json
{
  "kind": "comment",
  "video_id": "jNQXAC9IVRw",
  "video_url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "comment_id": "UgxExampleCommentId",
  "parent_id": null,
  "text": "Where it all began.",
  "author": "@ExampleViewer",
  "author_id": "UCexampleChannelId",
  "author_url": "https://www.youtube.com/channel/UCexampleChannelId",
  "author_is_verified": false,
  "author_is_uploader": false,
  "like_count": 1240,
  "is_pinned": false,
  "is_favorited": false,
  "published_at": "2024-03-02T00:00:00+00:00",
  "total_comment_count": 10000000,
  "scraped_at": "2026-10-28T09:00:00Z",
  "_meta": {"author": "https://apify.com/herus13", "status": "ok", "message": null}
}
```

`_meta` is run metadata, not scraped data. A reply has `kind` set to `reply`. Its `parent_id` is the id of the comment it answers, which can itself be a reply, so follow `parent_id` upward to reach the top-level comment. `total_comment_count` is the number YouTube shows for the whole video, not how many this run read.

### What it costs

| Event | Price |
|---|---|
| Actor Start (`apify-actor-start`) | $0.00005 |
| YouTube comment (`comment`) | $0.0006 |

### Input

| Field | Type | Required | Default | What it does |
|---|---|---|---|---|
| `video_urls` | array | no | — | YouTube videos to read the comments of, one per entry, for example `https://www.youtube.com/watch?v=jNQXAC9IVRw`, a `youtu.be` or Shorts link, or the 11-character id `jNQXAC9IVRw`. An entry that is not a video, such as a playlist or channel link, is skipped with a warning naming it. Leave empty and the run stops with an error, so give at least one video. |
| `comment_sort` | string | no | `"top"` | Which comments come first: `top` for the most popular, `new` for the most recent. Default top. |
| `max_comments_per_video` | integer | no | `100` | How many top-level comments to read from each video. Default 100, minimum 0. Set 0 to read no comments; replies are limited by the next field and count separately. |
| `max_replies_per_comment` | integer | no | `0` | How many replies to read under each top-level comment. Default 0, minimum 0. Set 0 for top-level comments only. Every reply is a row and is charged like a comment. |
| `max_comments_total` | integer | no | `10000` | Stop after this many rows across all videos, comments and replies together. Default 10000, minimum -1. Set 0 for no rows. Set -1 for no limit. |
| `proxyUrls` | array | no | — | Leave empty: the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own provider instead, add one gateway URL per entry, for example `http://user:pass@host:port` — works with any provider that issues URLs. When set, the run uses these first and switches to the included proxy if they stop working, so a broken proxy never fails the run. |

### How to run it

1. Add one or more video links or ids.
2. Choose whether top comments or the newest come first.
3. Set how many comments to read per video, and how many replies under each, if you want replies.
4. Run it and export the dataset as JSON, CSV or Excel.

The 200 newest comments of one video, with up to 3 replies under each:

```json
{
  "video_urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
  "comment_sort": "new",
  "max_comments_per_video": 200,
  "max_replies_per_comment": 3
}
```

Minimal input:

```json
{
  "video_urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"]
}
```

Available as the MCP tool `herus13--youtube-comment-scraper` on mcp.apify.com, so an AI agent can call it with the same input.

### Use cases

- **Sentiment and audience research**: read what viewers say about a launch, a trailer or a competitor's video.
- **Brand and creator monitoring**: follow the newest comments on your own videos and the replies they start.
- **Moderation reviews**: pull a video's comments with their likes and authors to find spam and abuse.
- **Market and product feedback**: collect feature requests and complaints from tutorial and review videos.
- **Datasets for AI**: build a clean table of comments and replies for classification or summarisation models.

### FAQ

**Does it need a YouTube account or API key?** No. It reads what any visitor can see, without logging in.

**Are replies included?** Only when you ask for them. Set the replies per comment above 0 and each reply becomes its own row, linked to the comment it answers by `parent_id`.

**How many comments can it read?** You set the limits: comments per video and rows in total for the run. The defaults are 100 comments per video and 10,000 rows in total, so a run never reads more than you asked for.

**Why do some rows have only a day-accurate date?** YouTube shows comments as "6 years ago", so the date is accurate to the day at best.

**What happens with a video that has no comments, or that is private or removed?** It returns no rows, costs nothing, and the run log names the video.

**Can I use my own proxy?** Yes. Paste gateway URLs into Your own proxy URLs and the run uses them first, then falls back to the included residential proxy if they fail.

**Is the data fresh?** Every run reads YouTube live, so rows reflect the moment of the run, and each row carries its `scraped_at` time.

**I use another YouTube comments actor. Do I have to rewrite my input?** Usually not. Over the API or MCP, the run also reads the input of the most-used YouTube actors as you would send it to them. Single names work too: `startUrls`, `urls`, `videoUrls` or `youtubeUrls` for the videos, `maxComments`, `commentsPerVideo` or `max_comments` for the comments per video, `maxItems` for the total and `maxRepliesPerComment` for the replies. A field you set on this actor's own form always wins. A limit of 0 means none here, never "all"; a form whose 0 means all gets this actor's own limit instead. Sorts and filters from another actor are not translated, and the run log names anything it cannot use. Each row also carries the column names of the most-used YouTube comments actor (`comment`, `cid`, `videoId`, `pageUrl`, `commentsCount`, `voteCount`, `authorIsChannelOwner`, `hasCreatorHeart`, `type`, `replyToCid`), filled from this actor's own data and left empty where it has none, so an export or integration built for that actor keeps working.

### Related actors

- [YouTube Transcript Scraper](https://apify.com/herus13/youtube-transcript-scraper) — captions and subtitles of YouTube videos, playlists and channels.
- [Reddit Scraper](https://apify.com/herus13/reddit-scraper) — posts, comments and profiles from Reddit.

# Actor input Schema

## `video_urls` (type: `array`):

YouTube videos to read the comments of, one per entry, for example `https://www.youtube.com/watch?v=jNQXAC9IVRw`, a `youtu.be` or Shorts link, or the 11-character id `jNQXAC9IVRw`. An entry that is not a video, such as a playlist or channel link, is skipped with a warning naming it. Leave empty and the run stops with an error, so give at least one video.

## `comment_sort` (type: `string`):

Which comments come first: `top` for the most popular, `new` for the most recent. Default top.

## `max_comments_per_video` (type: `integer`):

How many top-level comments to read from each video. Default 100, minimum 0. Set 0 to read no comments; replies are limited by the next field and count separately.

## `max_replies_per_comment` (type: `integer`):

How many replies to read under each top-level comment. Default 0, minimum 0. Set 0 for top-level comments only. Every reply is a row and is charged like a comment.

## `max_comments_total` (type: `integer`):

Stop after this many rows across all videos, comments and replies together. Default 10000, minimum -1. Set 0 for no rows. Set -1 for no limit.

## `proxyUrls` (type: `array`):

Leave empty: the run uses the residential proxy this actor ships with, included in the price of the run. To route the run through your own provider instead, add one gateway URL per entry, for example `http://user:pass@host:port` — works with any provider that issues URLs. When set, the run uses these first and switches to the included proxy if they stop working, so a broken proxy never fails the run.

## Actor input object example

```json
{
  "video_urls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "comment_sort": "top",
  "max_comments_per_video": 100,
  "max_replies_per_comment": 0,
  "max_comments_total": 10000
}
```

# Actor output Schema

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

One row per comment or reply, with its author, likes and the video it belongs to.

# 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 = {
    "video_urls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("herus13/youtube-comment-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 = { "video_urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"] }

# Run the Actor and wait for it to finish
run = client.actor("herus13/youtube-comment-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 '{
  "video_urls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ]
}' |
apify call herus13/youtube-comment-scraper --silent --output-dataset

```

## MCP server setup

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