# YouTube Comments Scraper (`neuro-scraper/youtube-comments-scraper`) Actor

YouTube Comments Scraper SD - YouTube Comments Scraper is a powerful tool that extracts public comments, replies, likes, authors and reply counts from YouTube videos by video URL, sort order and comment limit - YouTube comment extractor for audience research and sentiment analysis.

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

## Pricing

from $1.25 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 and likes from any public YouTube video

The YouTube Comments Scraper turns the comment section of any public YouTube video into clean, structured rows. Paste video links and get every comment with its author, likes, reply count, publish time and pinned or hearted status.

The YouTube Comments Scraper needs no login, no Google account and no YouTube Data API key. It reads the same public comment data that YouTube shows to any logged-out visitor.

Use it for audience research, sentiment analysis, community management, product feedback and creator research. Every row is ready to export as CSV, JSON or Excel.

#### What the YouTube Comments Scraper does

The YouTube Comments Scraper opens each video page exactly as a logged-out browser does and reads the comment section the way YouTube's own web player loads it: twenty comments per page, page after page.

You choose the order (Top comments or Newest first), how many comments to collect per video, and whether the replies under each comment should be scraped too.

Each comment becomes one dataset row. When replies are on, every reply becomes its own row directly under its parent comment, linked by `parentCommentId`.

#### Who uses the YouTube Comments Scraper

Brand and marketing teams who want to know what viewers actually say about a launch, an ad or a review video.

Researchers who build sentiment, toxicity or topic datasets from public YouTube comments.

Creators and agencies who track audience questions, feature requests and engagement on their own videos and on competitors' videos.

Data teams who feed comment text into language models, dashboards or a data warehouse through the Apify API.

### Input fields for the YouTube Comments Scraper

Only `startUrls` is required. Everything else has a sensible default, so the YouTube Comments Scraper runs on its first click.

| Field | Type | Default | Meaning |
|---|---|---|---|
| `startUrls` | array | 2 example videos | YouTube video URLs or 11-character ids: watch, youtu.be, Shorts and m.youtube.com links all work |
| `maxComments` | integer | `100` | Top-level comments per video; replies come on top of this number |
| `getAllComments` | boolean | `false` | Ignore the limit and page through every comment YouTube lists |
| `sortBy` | string | `top` | `top` (Top comments), `latest` (Newest first) or `oldest` |
| `includeReplies` | boolean | `false` | Also scrape the replies of each comment |
| `maxRepliesPerComment` | integer | `20` | Replies per comment when replies are on |
| `maxItems` | integer | empty | Optional cap on all rows of the run |
| `proxyConfiguration` | object | Apify RESIDENTIAL, US | Proxy used for every request |

The field names are the same as in earlier versions of the YouTube Comments Scraper, so saved tasks and API calls keep working.

#### About the `oldest` order

YouTube itself offers only Top comments and Newest first. For `oldest`, the YouTube Comments Scraper reads the comments newest-first, up to 5,000 per video, and returns them oldest first.

Pinned comments stay on top, exactly as YouTube shows them in every order. On videos with more than 5,000 comments the log says that the scan limit was reached.

### Output of the YouTube Comments Scraper

Every row of the YouTube Comments Scraper has the same keys, so the dataset schema stays stable across runs and videos.

| Field | Meaning |
|---|---|
| `commentId` | YouTube's comment id (replies: `<parent>.<reply>`) |
| `text` | Full comment text |
| `author` | Author handle as shown, e.g. `@frankwest8025` |
| `authorChannelId`, `authorUrl` | Author's channel id and channel link |
| `authorThumbnail` | Author avatar URL |
| `authorIsVerified` | Verified badge on the author |
| `authorIsChannelOwner` | The comment was written by the video's own channel |
| `likes`, `likesText` | Like count as a number and as YouTube shows it ("30K") |
| `replyCount` | Number of replies under the comment |
| `publishedTimeText` | Relative time as YouTube shows it, e.g. "5 years ago (edited)" |
| `isPinned`, `isHearted` | Pinned by the creator / hearted by the creator |
| `isReply`, `replyLevel`, `parentCommentId` | Reply flags; `parentCommentId` only on replies |
| `position` | Order of the top-level comment in the chosen sort |
| `videoId`, `videoUrl`, `videoTitle` | The video the comment belongs to |
| `videoCommentsTotal` | Exact total comment count of the video, from YouTube's comment header |
| `commentUrl` | Direct link to the comment |
| `sortedBy`, `inputUrl`, `scrapedAt` | Run context and ISO timestamp |

Export the YouTube Comments Scraper dataset as CSV, JSON, Excel, XML or HTML from the Apify console, or read it through the Apify API.

#### Example row

```json
{"videoId": "VegKhno-BK8", "commentId": "UgywhLWEyYGd0EVLQlB4AaABAg", "text": "Thanos is so chill in Infinity War ...", "author": "@frankwest8025", "likes": 30000, "likesText": "30K", "replyCount": 200, "publishedTimeText": "5 years ago", "isPinned": false, "isHearted": false, "isReply": false, "position": 1, "videoCommentsTotal": 6991, "sortedBy": "top"}
```

### How to run the YouTube Comments Scraper

Open the YouTube Comments Scraper, paste one or more video URLs into `startUrls`, set `maxComments`, and press Start. Rows appear in the dataset while the run is still going.

Switch on `includeReplies` when the conversation under each comment matters. Each comment with replies costs one or more extra requests, so keep `maxRepliesPerComment` small for big videos.

Use `latest` to monitor new feedback on a fresh upload. Use `top` to study the comments YouTube ranks as most relevant.

#### How fast is it in practice

These numbers come from local test runs of the YouTube Comments Scraper on a home connection:

- 200 comments from two videos (100 each, Top order) in 9 seconds, 5 requests per video.
- 150 comments Newest first plus 10 replies in 12 seconds, 19 requests.
- 60 comments from a Short and a regular video in 5 seconds.

On the Apify platform the run goes through a residential proxy, so timings can differ.

### How the YouTube Comments Scraper works

The YouTube Comments Scraper follows YouTube's own public web flow. It loads the watch page and reads the page configuration from it: client version, visitor data, language and the comment section token.

It then asks YouTube's internal web endpoint for the comments with that page's own context, and follows the continuation token of each answer until your limit or the end of the comments.

Nothing is hardcoded. Every dynamic value is read from the page on every run, so a YouTube release does not silently break the YouTube Comments Scraper.

For Shorts, the watch page sometimes arrives without the comment token. The YouTube Comments Scraper then reloads it, and if needed reads the token from the Short's own page.

### YouTube Comments Scraper limits, stated plainly

The YouTube Comments Scraper reads public comments only. Comments on private, deleted or members-only videos are out of reach, and no setting changes that.

Videos with comments turned off (for example videos marked "made for kids") produce no rows. The log says "comments are turned off for this video".

Like counts are YouTube's own labels. Above 999 they are rounded ("30K"), and the YouTube Comments Scraper keeps that precision rather than inventing digits.

Publish times are relative ("5 years ago"), because that is what YouTube shows logged-out visitors. The total in `videoCommentsTotal` is exact.

Held-for-review and spam-filtered comments are never public, so they are never in the YouTube Comments Scraper dataset.

### YouTube Comments Scraper pricing

The YouTube Comments Scraper uses pay-per-event pricing: you pay per dataset row (event "result"), plus the Apify platform usage of your run. The run stops at your `maxItems` or at the charge limit you set.

Free-plan users get up to 30 rows per run, which is enough to test the YouTube Comments Scraper on real data. The current price per 1,000 results is on the Pricing tab.

### Using the YouTube Comments Scraper in a workflow

Run the YouTube Comments Scraper on a schedule to watch new comments on your channel's latest uploads, then send the dataset wherever your team works.

Connect it to Google Sheets, Slack or a CRM through the Apify integrations, or through Make, Zapier and n8n. A webhook can trigger your own automation the moment a run finishes.

Developers call the YouTube Comments Scraper from Python or JavaScript with the Apify API client, pass the input as JSON and read the dataset when the run ends.

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("neuro-scraper/youtube-comments-scraper").call(run_input={"startUrls": [{"url": "https://www.youtube.com/watch?v=VegKhno-BK8"}], "maxComments": 200, "sortBy": "latest"})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["author"], item["likes"], item["text"][:80])
```

Because every row has the same keys, the integration never needs special cases. Map `text`, `author` and `likes` once and reuse that mapping for every video.

#### Sentiment analysis with the YouTube Comments Scraper

Export the comment text as CSV, add a sentiment column with your model of choice, and group by `videoId` to compare videos.

Use `likes` and `replyCount` as weights: a negative comment with 30K likes says more about the audience than ten comments nobody liked.

### Related scrapers

The YouTube Comments Scraper is part of a family of YouTube and social media scrapers by the same developer, with the same no-login approach.

| Actor | What it extracts |
|---|---|
| [YouTube Scraper](https://apify.com/neuro-scraper/youtube-comment-scraper) | YouTube search results and video data by keyword, channel or playlist |
| [YouTube Transcript Scraper](https://apify.com/neuro-scraper/youtube-transcript-scraper) | Full transcripts with timestamps |
| [YouTube Video Details Scraper](https://apify.com/neuro-scraper/youtube-video-details-scraper) | Views, likes, dates, tags and chapters of a video |
| [YouTube Channel Scraper](https://apify.com/neuro-scraper/my-actor-11) | Channel profile, about data and the channel's videos |
| [YouTube Playlist Scraper](https://apify.com/neuro-scraper/my-actor-10) | Every video of a playlist |
| [YouTube Shorts Scraper](https://apify.com/neuro-scraper/youtube-shorts-scraper) | Shorts of a channel or a search |
| [YouTube Video Downloader](https://apify.com/neuro-scraper/youtube-video-downloader) | Video or audio files in the quality you choose |
| [Facebook Comments Scraper](https://apify.com/neuro-scraper/facebook-comments-scraper) | Comments of public Facebook posts |
| [TikTok Video Details Scraper](https://apify.com/neuro-scraper/tiktok-video-details-scraper) | Stats and details of TikTok videos |
| [Instagram Reels Scraper](https://apify.com/neuro-scraper/instagram-reels-scraper) | Reels of public Instagram profiles |
| [Facebook Reels Scraper](https://apify.com/neuro-scraper/facebook-reels-scraper) | Reels of public Facebook pages |
| [TikTok Profile Scraper](https://apify.com/neuro-scraper/tiktok-profile-scraper) | Public TikTok profile data |

### Leave a review

If the YouTube Comments Scraper saved you time, please leave a star rating and a short review on the Actor page. Reviews help other users decide, and they tell me what to build next.

If something did not work, open an issue on the Actor page with the run link. Bugs get fixed faster than they get reviewed.

### Frequently asked questions

#### Does the YouTube Comments Scraper need my YouTube login or an API key?

No. The YouTube Comments Scraper never logs in and does not use the YouTube Data API. It reads the same public comment data any logged-out visitor sees.

#### How many comments can the YouTube Comments Scraper collect from one video?

As many as YouTube lists, page by page. Set `getAllComments` to read the whole thread, or `maxComments` to stop earlier. In tests one video returned 150 comments Newest first in 12 seconds including replies.

#### Can the YouTube Comments Scraper scrape replies?

Yes. Turn on `includeReplies`. Each reply is its own row with `isReply: true`, its `replyLevel` and the `parentCommentId` of the comment it answers. Replies to replies are included.

#### Does the YouTube Comments Scraper work on YouTube Shorts?

Yes. Paste the Shorts URL. In tests a Short returned 30 comments in two requests, with the exact total of 8,901 comments from YouTube's header.

#### Why are some like counts rounded?

Because YouTube shows them rounded. A comment with "30K" likes is stored as `likes: 30000` and `likesText: "30K"`. Counts below 1,000 are exact.

#### Can I get comments sorted oldest first?

Yes, with `sortBy: oldest`. YouTube has no oldest-first order, so the YouTube Comments Scraper reads newest-first up to 5,000 comments per video and reverses them. Pinned comments stay on top.

#### What happens when a video has comments turned off?

The YouTube Comments Scraper logs "comments are turned off for this video" and moves on to the next URL. One bad URL never fails the whole run.

#### Which export formats does the YouTube Comments Scraper support?

The dataset exports as CSV, JSON, Excel, XML and HTML from the console, and the same data is available through the Apify API and integrations.

#### Do I need my own proxy for the YouTube Comments Scraper?

No. The YouTube Comments Scraper uses Apify's residential proxy by default. You can switch to another proxy in the input if you prefer.

# Actor input Schema

## `startUrls` (type: `array`):

YouTube video URLs or video ids. Accepted: youtube.com/watch?v=..., youtu.be/..., youtube.com/shorts/..., m.youtube.com links. Example: https://www.youtube.com/watch?v=VegKhno-BK8

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

Maximum number of top-level comments per video. Replies (if enabled) come on top of this number.

## `getAllComments` (type: `boolean`):

Ignore the limit above and page through every comment YouTube lists for the video.

## `sortBy` (type: `string`):

'top' = YouTube's Top comments order, 'latest' = Newest first. YouTube has no oldest-first order: 'oldest' reads the comments newest-first (up to 5,000 per video) and returns them oldest first.

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

Also scrape the replies of each comment (one extra request per comment that has replies).

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

Used when replies are on.

## `maxItems` (type: `integer`):

Optional cap on the whole run (comments + replies). Leave empty for no total cap.

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

Apify Proxy, RESIDENTIAL group in the United States, is used by default. You can pick another country or group; the run then follows YouTube's answers for that location.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=VegKhno-BK8"
    },
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxComments": 100,
  "getAllComments": false,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=VegKhno-BK8"
        },
        {
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
        }
    ],
    "maxComments": 100,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/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 = {
    "startUrls": [
        { "url": "https://www.youtube.com/watch?v=VegKhno-BK8" },
        { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    ],
    "maxComments": 100,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

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

```

## MCP server setup

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