# YouTube Comments Scraper — Comments, Replies & Likes (`fabrikit/youtube-comments-scraper`) Actor

Scrape the comments of any YouTube video without an API key: text, likes, reply count, date, pinned and creator-heart flags, replies on demand, Top or Newest order. Commenter names are replaced by a stable pseudonym by default (privacy-safe).

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

## Pricing

from $0.45 / 1,000 comment scrapeds

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, Replies & Likes

**YouTube Comments Scraper extracts the comments of any public video on youtube.com** and returns one flat row per comment: text, like count, number of replies, when it was posted, whether it is pinned, edited or carries the creator's heart, and (optionally) the replies under each comment. Choose YouTube's own **Top** or **Newest** order, paste as many videos as you like (watch links, youtu.be, Shorts or live links, or bare IDs) and pay only per comment saved. No YouTube API key, no Google account, no browser.

**Privacy by default**: commenters are private persons, so their names, channel IDs and channel links are *not* saved unless you switch `hashAuthors` off. Instead every commenter gets a stable 16-character pseudonym (`authorHash`), which is enough to count unique commenters or to see the same person across videos. E-mail addresses and phone numbers inside comment text are removed.

This Actor is part of our YouTube family: [YouTube Videos Scraper](https://apify.com/fabrikit/youtube-videos-scraper) (search, playlists, single videos with details), [YouTube Shorts Scraper](https://apify.com/fabrikit/youtube-shorts-scraper) and [YouTube Channel Scraper](https://apify.com/fabrikit/youtube-channel-scraper). The videos scraper deliberately leaves comments out; this one is built around them.

### What data does it return?

| Field | Example | Notes |
|---|---|---|
| `videoId`, `videoUrl`, `videoTitle` | `dQw4w9WgXcQ`, `…/watch?v=dQw4w9WgXcQ`, `Rick Astley - Never Gonna Give You Up …` | the video the comment belongs to |
| `videoChannelName`, `videoChannelId` | `Rick Astley`, `UCuAXFkgsw1L7xaCfnd5JJOw` | the channel that published the video |
| `videoCommentCount` | `2460059` | total comments YouTube reports for the video |
| `commentId`, `commentUrl` | `UgzKYksqeQ5gA3t0g0F4AaABAg`, `…&lc=UgzKYksqeQ5gA3t0g0F4AaABAg` | the URL opens the video with that comment highlighted |
| `text` | `I Rick rolled my entire French class…` | full text; e-mails and phone numbers replaced by `[email removed]` / `[phone removed]` |
| `likeCount` | `104000` | number; YouTube rounds large counts (104K) |
| `replyCount` | `621` | number of replies in the thread (0 for replies) |
| `publishedText`, `publishedAt` | `6 years ago`, `2020-10-20T00:00:00.000Z` | `publishedAt` is computed from the relative text, so it is approximate (minute precision for fresh comments, day or coarser for old ones) |
| `isEdited`, `isPinned`, `isHearted` | `true`, `false`, `false` | edited by the author; pinned by the creator; marked with the creator's heart |
| `isReply`, `parentCommentId` | `true`, `UgzKYksqeQ5gA3t0g0F4AaABAg` | replies point at the comment they answer |
| `authorIsChannelOwner`, `authorIsVerified` | `false`, `false` | the commenter is the video's channel / has a verification or artist badge |
| `authorHash` | `5d9765b4cf5af595` | stable pseudonym (SHA-256 based), same commenter → same hash in every run |
| `author`, `authorChannelId`, `authorUrl` | `@handle`, `UC…`, `https://www.youtube.com/@handle` | **only when `hashAuthors` is off**; otherwise `null` |
| `position`, `sortedBy` | `1`, `top` | rank in the video's comment list (for replies: rank inside the thread) and the order used |
| `inputUrl`, `scrapedAt` | your input value, ISO time | |

### Use cases

- **Audience research and sentiment analysis** — pull thousands of comments on a product launch, a trailer or a news clip and run them through your own NLP or an LLM.
- **Creator analytics** — compare what viewers say under your videos and your competitors' videos; `isHearted`/`isPinned` show how creators engage, `likeCount` shows what resonates.
- **Social listening and brand monitoring** — schedule a daily run with `sort: newest` on the videos that matter to you and get only what was posted since.
- **Research datasets** — pseudonymous comment corpora (hashed authors) for academic or AI work without collecting names.
- **Community management** — export every comment of a campaign video to CSV or Excel, including replies, to review or answer them.

### How to use it

1. Paste one or more **Videos** (links or IDs).
2. Set **Max comments (total)** and, if you have several videos, **Max comments per video**.
3. Pick the **Order** (Top comments or Newest first) and switch **Include replies** on if you need them.
4. Keep **Hide commenter identities** on unless you have a lawful basis to store the commenters' names.
5. Run it and download the dataset as JSON, CSV, Excel or HTML, or read it through the API.

#### Input example: the prefilled run (20 top comments of one video)

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "maxComments": 20
}
```

#### Input example: newest comments with replies from several videos, named authors

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=0e3GPea1Tyg",
    "https://www.youtube.com/shorts/Y8IJi7iP5vk",
    "https://youtu.be/dQw4w9WgXcQ"
  ],
  "sort": "newest",
  "includeReplies": true,
  "maxRepliesPerComment": 3,
  "maxComments": 300,
  "maxCommentsPerVideo": 100,
  "hashAuthors": false
}
```

#### Input example: a big pseudonymous dataset from one video

```json
{
  "videoUrls": ["aircAruvnKk"],
  "maxComments": 5000,
  "sort": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 50
}
```

### Output example

A real record from a local test run on 19 October 2026:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "videoChannelName": "Rick Astley",
  "videoChannelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "videoCommentCount": 2460059,
  "commentId": "UgzKYksqeQ5gA3t0g0F4AaABAg",
  "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgzKYksqeQ5gA3t0g0F4AaABAg",
  "text": "I Rick rolled my entire French class because we had to study a city in France and make a quiz about it …",
  "likeCount": 104000,
  "replyCount": 621,
  "publishedText": "6 years ago",
  "publishedAt": "2020-10-20T00:00:00.000Z",
  "isEdited": true,
  "isPinned": false,
  "isHearted": false,
  "isReply": false,
  "parentCommentId": null,
  "authorIsChannelOwner": false,
  "authorIsVerified": false,
  "author": null,
  "authorChannelId": null,
  "authorUrl": null,
  "authorHash": "5d9765b4cf5af595",
  "position": 1,
  "sortedBy": "top",
  "inputUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "scrapedAt": "2026-10-19T19:22:26.089Z"
}
```

A `SUMMARY` record in the key-value store lists every video with its status (`ok`, `comments-off`, `unavailable`), how many comments and replies it gave, the proxy used and any errors.

### Pricing

Pay per event: each comment or reply saved is charged (`comment-result`); proxy and platform usage are included.

Duplicates are never saved twice, videos with comments turned off cost nothing, and if you set a maximum cost per run the Actor stops cleanly when it is reached. See the Pricing tab for current prices; paid Apify plans get lower rates.

### How it compares

- **YouTube Data API v3 (`commentThreads`)**: official and exact, but you need a Google Cloud project and an API key, each 100 comments cost quota, the default daily quota is 10,000 units, and it returns commenter names whether you want them or not. This Actor reads the same public comment section a visitor sees, needs no key and hides commenters by default.
- **Other comment scrapers in the Store**: this one returns the pinned/hearted/edited flags and a stable commenter pseudonym, and lets you cap replies per thread.
- **Limits worth knowing**: like and reply counts are rounded by YouTube above 1,000 (`104K` → `104000`); dates are relative, so `publishedAt` is approximate; the comment section is loaded 20 comments per request, so 10,000 comments means about 500 requests.

### Integrations

Call it from the Apify API, the JavaScript or Python client, or schedule it in Apify Console. Send the results to n8n, Make, Zapier, Google Sheets, Airtable, Slack or a webhook. AI agents (Claude, ChatGPT, Cursor and other MCP clients) can run it through the Apify MCP server, e.g. "get the 200 newest comments of this video and summarise the sentiment".

### FAQ

**Is it legal to scrape YouTube comments?** The Actor only reads comments that YouTube shows to logged-out visitors. Comments are user-generated content and the commenters are usually private persons, so data-protection laws (GDPR, CCPA, Chile's Ley 21.719 and others) can apply to how you store and use the results. That is why names and channel IDs are hidden by default and contact details are stripped from the text. Only turn `hashAuthors` off when you have a lawful basis. This is not legal advice.

**What exactly is `authorHash`?** The first 16 hexadecimal characters of a SHA-256 digest of the commenter's channel ID (with a fixed prefix). It is the same in every run, so you can count unique commenters or join datasets, but it cannot be turned back into a name.

**Do I need a proxy?** No setup needed. The Apify datacenter proxy is used by default; if YouTube blocks it twice in a row, the run switches to Apify residential proxy (country = `region`) for the rest of the run.

**Why does a video return 0 comments?** Comments are turned off on that video (the `SUMMARY` record says `comments-off`), the video is private or removed (`unavailable`), or the link was not a video at all (channel and playlist links are skipped with a warning).

**Can I get only the comments posted since my last run?** Use `sort: "newest"` with a reasonable `maxComments`, then filter on `publishedAt` or on the `commentId`s you already have.

**Does it download videos or avatars?** No. Only comment data; avatar URLs are not saved.

**Which languages work?** Comments come back in whatever language they were written. Keep `language` at `en` so that relative dates and rounded counts are parsed reliably.

### Changelog

- **2026-10-19** — First version: comments and replies of any video, Top / Newest order, per-video and per-thread caps, pinned / hearted / edited flags, hashed commenters by default, contact scrubbing, pay per comment.

### En español

**YouTube Comments Scraper** extrae los comentarios públicos de cualquier video de YouTube sin API key ni login: texto, likes, cantidad de respuestas, fecha aproximada, si está fijado, editado o tiene el corazón del creador, y opcionalmente las respuestas de cada hilo, en orden "Principales" o "Más recientes". Por defecto **no guarda el nombre ni el canal de quien comenta**: cada persona recibe un seudónimo estable (`authorHash`) y se eliminan correos y teléfonos del texto, pensando en la Ley 21.719 y el RGPD. Se cobra por cada comentario guardado, con proxy incluido. Consulta la pestaña Pricing para ver los precios actuales; los planes de pago de Apify tienen tarifas más bajas. Para videos, listas y canales usa nuestros [YouTube Videos Scraper](https://apify.com/fabrikit/youtube-videos-scraper), [YouTube Shorts Scraper](https://apify.com/fabrikit/youtube-shorts-scraper) y [YouTube Channel Scraper](https://apify.com/fabrikit/youtube-channel-scraper).

# Actor input Schema

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

YouTube videos, one per line: a watch link (https://www.youtube.com/watch?v=dQw4w9WgXcQ), a youtu.be link, a Shorts or live link (/shorts/…, /live/…) or just the 11-character video ID. Channel and playlist links are not accepted here.

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

Stop after this many comments across all videos (replies count too). You pay only for the comments that are saved.

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

Optional cap for each single video, so one busy video does not use up the whole budget. Leave empty for no per-video cap.

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

The same two orders YouTube offers under a video: Top comments (YouTube's ranking, pinned comment first) or Newest first.

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

Also save the replies under each comment (one extra request per thread with replies). Replies have isReply: true and parentCommentId pointing at the comment they answer.

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

When replies are on: how many replies to take from each thread, in YouTube's order. Big threads can hold thousands.

## `hashAuthors` (type: `boolean`):

On (recommended): the commenter's name, channel ID and channel link are not saved; instead each commenter gets a stable 16-character pseudonym (authorHash, SHA-256 based) so you can still count unique commenters or follow the same person across videos. Off: the @handle, channel ID and channel URL are saved as well. Only turn it off when you have a lawful basis to process the commenters' personal data.

## `language` (type: `string`):

YouTube interface language sent with the requests (en, es, pt, de…). Comment text is never translated; it only changes strings such as the relative date. Keep "en" for reliable publishedAt and likeCount parsing.

## `region` (type: `string`):

Two-letter country code sent to YouTube (US, GB, DE, BR, MX…). It also picks the country of the residential proxy if the run has to switch to one.

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

Apify datacenter proxy by default. If YouTube answers with blocks twice in a row (HTTP 403/429, consent or bot pages), the run moves to Apify residential proxies on its own for the rest of the run.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxComments": 20,
  "sort": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "hashAuthors": true,
  "language": "en",
  "region": "US",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Every comment and reply saved during the run (text, likes, reply count, date, pinned/hearted flags, pseudonymous author)

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

Per-video status (ok, comments-off, unavailable), counts, proxy used and any errors

# 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=dQw4w9WgXcQ"
    ],
    "maxComments": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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