# YouTube Comments Scraper: YouTube Comment Replies & Likes (`xmolodtsov/youtube-comments-scraper`) Actor

Scrape comments and replies from YouTube videos and Shorts: comment text, author and channel, likes, reply count, date, pinned and creator-heart flags, plus the video's total comment count. Top or newest first. Export JSON, CSV or Excel. No API key, no login.

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

## Pricing

from $0.40 / 1,000 youtube comment results

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?

YouTube Comments Scraper collects the **comments and comment replies** of any YouTube video or Short, with the
comment text, the author, the **likes** on every comment, the reply count, pinned and creator-heart flags, and the
video's exact total comment count. Paste video or Shorts URLs, pick **Top comments** or **Newest first**, and get
one clean row per comment and one per reply.

The output uses the field names that most YouTube comment datasets on Apify already use (`author`, `comment`, `cid`,
`replyToCid`, `voteCount`, `hasCreatorHeart` and so on), so an existing pipeline keeps working when you switch. On top
of that, every row carries the fields comment exports often leave out: the author's channel ID, channel URL, avatar,
verified badge, a pinned flag and the like count exactly as YouTube displays it.

Who uses it:

- **Brands and marketers** read what viewers say about a product launch, an ad or a sponsored video.
- **Creators and agencies** find the questions, requests and complaints in their own comment sections and their competitors'.
- **Researchers and data teams** build sentiment, topic and toxicity datasets from public YouTube discussions.
- **AI and LLM builders** feed real audience language into summaries, classifiers and RAG pipelines.

No YouTube API key, no login, no quota and no proxy setup. Export results as JSON, CSV or Excel, or pull them via API.

### What data can you get?

Every comment and every reply is one result. Replies follow the comment they answer.

| Field | Example | Description |
|---|---|---|
| `author` | `@candycake9531` | The commenter's handle |
| `comment` | `Is everyone going to ignore…` | The comment text |
| `cid` | `Ugxzbv_ZeZXNRcfwsSF4AaABAg` | YouTube's comment ID (replies: `<thread id>.<reply id>`) |
| `replyCount` | `675` | Replies under the comment (0 for replies) |
| `replyToCid` | `null` | For a reply: the `cid` of the comment it answers |
| `voteCount` | `291000` | Likes, as a number |
| `authorIsChannelOwner` | `false` | The video's creator wrote it |
| `publishedTimeText` | `6 years ago` | When it was posted, as YouTube shows it |
| `type` | `comment` | `comment` or `reply` |
| `hasCreatorHeart` | `false` | The creator gave it a heart |
| `videoId` | `dQw4w9WgXcQ` | The video's ID |
| `pageUrl` | `https://www.youtube.com/watch?v=dQw4w9WgXcQ` | The video's URL (Shorts keep their `/shorts/` URL) |
| `commentsCount` | `2459315` | The video's exact total number of comments |
| `title` | `Rick Astley - Never Gonna Give You Up…` | The video's title |
| `authorChannelId` | `UCNLgzvqrGzFi5SEAbVkFchg` | The commenter's channel ID |
| `authorUrl` | `https://www.youtube.com/@candycake9531` | The commenter's channel URL |
| `authorThumbnailUrl` | `https://yt3.ggpht.com/…` | The commenter's avatar |
| `authorIsVerified` | `false` | The commenter has a verified badge |
| `isPinned` | `false` | The creator pinned the comment |
| `voteCountText` | `291K` | Likes exactly as YouTube displays them |

**About the numbers.** YouTube shows comment likes rounded ("291K", "2.3K"), so `voteCount` is that rounded number
converted to an integer and `voteCountText` keeps the original text. Below 1,000 likes the number is exact. The same
rounding applies to `replyCount` once a thread passes 1,000 replies. `commentsCount` is exact: it comes from the video's
comment header, not from a rounded label.

### How to use YouTube Comments Scraper

1. Click **Try for free** and open the **Input** tab.
2. Paste one or more YouTube video URLs or Shorts URLs into **YouTube video URLs**.
3. Set **Maximum comments per video**, choose **Top comments** or **Newest first**, and decide whether to include replies.
4. Click **Start**. Download the comments from the **Output** tab, or fetch them via API.

#### Run it from your code

```bash
curl -X POST "https://api.apify.com/v2/acts/xmolodtsov~youtube-comments-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": [{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}], "maxComments": 200, "sortCommentsBy": "NEWEST_FIRST"}'
```

The JavaScript and Python Apify clients work the same way: `client.actor("xmolodtsov/youtube-comments-scraper").call(input)`.

#### Use it from an AI agent

Connect any MCP client (Claude, Cursor, VS Code and others) to `https://mcp.apify.com/?tools=xmolodtsov/youtube-comments-scraper`
and ask for the comments of a video in plain language.

### Pricing

You pay only for results: **$0.50 per 1,000 results** on the free plan and less on paid Apify plans. Every comment and
every reply is one result. Videos with comments turned off, unavailable videos and retries cost nothing.

| Apify plan | Price per 1,000 results |
|---|---|
| Free | $0.50 |
| Bronze (Starter) | $0.45 |
| Silver (Scale) | $0.40 |
| Gold (Business) | $0.40 |

Platinum and Diamond plans pay the Gold price. Example: 10,000 comments and replies cost $4.50 on Bronze.

#### Is it free?

Yes, you can try it on the free Apify plan. There it returns up to **10 results per run** and allows **5 runs per
calendar month**. The developer sets this limit, not Apify. It keeps the Actor fast and affordable for paying users.
Any paid Apify plan removes all limits.

### Input

Configure the run in the [Input tab](https://apify.com/xmolodtsov/youtube-comments-scraper/input-schema).

| Field | Default | What it does |
|---|---|---|
| `startUrls` | required | Video URLs as `{ "url": "…" }` items: `watch?v=`, `/shorts/`, `youtu.be/`, `/live/`, `/embed/` |
| `maxComments` | `100` | Maximum results per video. Replies count toward it |
| `sortCommentsBy` | `TOP_COMMENTS` | `TOP_COMMENTS` or `NEWEST_FIRST` |
| `includeReplies` | `true` | Also scrape replies, each as its own row |
| `maxRepliesPerComment` | `10` | At most this many replies per comment; `0` = every reply |
| `oldestCommentDate` | none | Only comments posted on or after a date (`2026-01-31`) or within an age (`7 days`, `2 weeks`) |
| `proxyConfiguration` | Apify datacenter | Change only to use residential or your own proxies |

Example:

```json
{
    "startUrls": [
        { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
        { "url": "https://www.youtube.com/shorts/aNI2jv7lBPQ" },
        { "url": "https://youtu.be/NiCgcUTL9_Q" }
    ],
    "maxComments": 500,
    "sortCommentsBy": "TOP_COMMENTS",
    "includeReplies": true,
    "maxRepliesPerComment": 20
}
```

**The date filter.** YouTube shows comment times only as relative text ("3 days ago", "2 weeks ago"), never as a
timestamp. With `oldestCommentDate` set, the Actor sorts newest first and stops at the first comment that is clearly
older than your date. The boundary is as precise as YouTube's text: "2 weeks ago" can mean 14 to 20 days, so comments
right at the edge can be slightly older than the date you asked for. A pinned comment is skipped by the filter but never
ends the run early.

### Output

Each result is one comment or one reply. A real example from the run above:

```json
{
    "author": "@candycake9531",
    "comment": "Is everyone going to ignore the fact that Rick Astley looks like a twelve year old boy but has a uniquely deep voice?",
    "cid": "Ugxzbv_ZeZXNRcfwsSF4AaABAg",
    "replyCount": 675,
    "replyToCid": null,
    "voteCount": 291000,
    "authorIsChannelOwner": false,
    "publishedTimeText": "6 years ago",
    "type": "comment",
    "hasCreatorHeart": false,
    "videoId": "dQw4w9WgXcQ",
    "pageUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "commentsCount": 2459315,
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "authorChannelId": "UCNLgzvqrGzFi5SEAbVkFchg",
    "authorUrl": "https://www.youtube.com/@candycake9531",
    "authorThumbnailUrl": "https://yt3.ggpht.com/ytc/AIdro_mEO82VrM8XtyGrBUkJgbAYgpAmDpUZixd1QvK9kyA=s88-c-k-c0x00ffffff-no-rj",
    "authorIsVerified": false,
    "isPinned": false,
    "voteCountText": "291K"
}
```

A reply has `"type": "reply"`, `"replyToCid": "Ugxzbv_ZeZXNRcfwsSF4AaABAg"` and `"replyCount": 0`.

The **Overview** table in the Output tab shows the key fields at a glance:

![YouTube Comments Scraper output: comments and replies with likes, reply counts and creator hearts](https://api.apify.com/v2/key-value-stores/2DxCOvbMjhvK3S1qP/records/youtube-comments-scraper-output.png)

### Guarantees and failure semantics

- **You never pay for errors.** The dataset holds only real comments and replies. A video with comments turned off, a
  deleted or private video, or a wrong ID produces no rows. The run's status message names each of these videos and
  the run still **SUCCEEDS**, because YouTube answered.
- **Blocked runs fail loudly.** Every request is tried up to 3 times; each retry uses a fresh proxy IP of the same kind.
  If YouTube gives no valid answer for a video after that and the run has no results at all, it ends **FAILED** with a
  reason code at the start of the status message (`blocked`, `quota`, `timeout`, `network`, …), so your integration
  knows to retry. If other videos returned results, the run succeeds and the status message names the video that
  failed.
- **Format changes fail loudly too.** If YouTube changes its page format so that a video's comments can no longer be
  read while it still reports comments, that video counts as unanswered with the code `outdated` instead of returning
  an empty result.
- **Partial videos are flagged.** When a later page or a reply thread fails after retries, you keep everything scraped
  so far and the status message lists the video as incomplete.
- **No duplicates.** Each comment is returned once per run, and a video listed twice (for example as a URL and as an ID)
  is scraped once.
- **Your spending limit is respected.** With a maximum charge per run set, the Actor stops cleanly when it is reached.
- **No silent proxy switches.** The Actor uses the proxy you chose for the whole run.

Run statistics (requests, failures by reason, data transfer, per-video counts) are saved in the `STATISTICS` record of
the run's key-value store.

### Integrations

- **API:** start runs and fetch results from any language with the
  [Apify API](https://apify.com/xmolodtsov/youtube-comments-scraper/api) or the JavaScript and Python clients.
- **AI agents (MCP):** connect via the Apify MCP server at `https://mcp.apify.com/?tools=xmolodtsov/youtube-comments-scraper`.
- **n8n, Make, Zapier:** use the Apify node or app to run the Actor and pass comments on to a sheet, CRM or Slack.
- **Schedules and webhooks:** collect new comments every day on a schedule and get notified when results are ready.
- **Google Sheets and Excel:** export the dataset directly, or sync it with the Apify integration.

### More scrapers from this developer

**TikTok:** [TikTok Search Scraper](https://apify.com/xmolodtsov/tiktok-search-scraper): videos and creators for any keyword, pay per result · [TikTok Profile Scraper (Pay Per Result)](https://apify.com/xmolodtsov/tiktok-profile-scraper): profiles, followers and latest posts by username · [TikTok Comments Scraper](https://apify.com/xmolodtsov/tiktok-comments-scraper): comments and full reply threads from any video · [TikTok Hashtag Scraper](https://apify.com/xmolodtsov/tiktok-hashtag-scraper): videos for any hashtag, with views, likes and music · [TikTok Sound & Music Scraper](https://apify.com/xmolodtsov/tiktok-sound-scraper): videos that use a sound or song

**Social & news:** [Reddit Search Scraper](https://apify.com/xmolodtsov/reddit-scraper): posts by keyword, subreddit or author · [Google News Scraper](https://apify.com/xmolodtsov/google-news-scraper): Google News results as clean full-text articles

**E-commerce:** [Prom.ua Product Search Scraper](https://apify.com/xmolodtsov/prom-ua): Prom.ua product search results, no browser needed · [Amazon Product Search & Bestsellers Scraper](https://apify.com/xmolodtsov/amazon-search-scraper): search results, Best Sellers and product details from Amazon

**Maps & leads:** [Google Maps Scraper](https://apify.com/xmolodtsov/google-maps-scraper): places, leads and emails from Google Maps

**Ads:** [Facebook Ad Library Scraper (Meta Ads Library)](https://apify.com/xmolodtsov/facebook-ads-library-scraper): ads from the Meta Ad Library, with EU reach and payers

**Video:** [YouTube Transcript Scraper](https://apify.com/xmolodtsov/youtube-transcript-scraper): transcripts, subtitles and captions from YouTube videos · [YouTube Shorts Scraper](https://apify.com/xmolodtsov/youtube-shorts-scraper): Shorts of any channel with exact views, likes and duration · [YouTube Channel Scraper](https://apify.com/xmolodtsov/youtube-channel-scraper): every video of a channel, with channel stats · [YouTube Search Scraper](https://apify.com/xmolodtsov/youtube-search-scraper): search results and videos for any keyword

### FAQ

#### Do I need a YouTube API key or an account?

No. The Actor reads the same public comment data a logged-out visitor sees on YouTube. There is no API key, no daily
quota and no Google Cloud project to set up.

#### Do I need proxies?

No. The Actor uses Apify's datacenter proxy by default, which works for YouTube comments. You can switch to residential
proxies or your own under **Advanced**; the Actor then uses that choice for the whole run.

#### Does it scrape YouTube Shorts comments?

Yes. Paste a Shorts URL (`https://www.youtube.com/shorts/…`). Shorts rows keep the Shorts URL in `pageUrl`.

#### Why did I get fewer results than the maximum?

The video has fewer comments than you asked for, the date filter stopped the run, duplicates were removed, or the free
plan capped the run at 10 results. Replies count toward the maximum. The Actor takes at most 10 replies per comment by
default so you get a spread of threads; set **Maximum replies per comment** to 0 for every reply. YouTube also hides some comments (held for
review or removed as spam), so the rows can be a little fewer than `commentsCount`.

#### Why are like counts rounded?

YouTube itself shows comment likes rounded ("12K") and does not publish the exact number. The Actor converts that text
to a number in `voteCount` and keeps the original in `voteCountText`, so you can tell exact small numbers from rounded
large ones.

#### Can I get the exact date of a comment?

YouTube shows only relative times ("3 days ago"), and that is what `publishedTimeText` holds. Use the
**Oldest comment date** filter to keep recent comments only; read its note above about precision at the edge.

#### Can I scrape all comments of a video?

Yes. Set **Maximum comments per video** to a number above the video's comment count, and set **Maximum replies per comment** to 0. A video with hundreds of thousands
of comments takes a while; with **Newest first** and a date filter you can collect only what is new since your last run.

#### Is it legal to scrape YouTube?

This Actor collects only publicly available comments and does not log in or access private information. Scraping
public data is generally legal, but comments are personal data (usernames, avatars, opinions), which regulations such
as the GDPR and the CCPA protect. Collect only what you need, keep it secure, and do not use it to target individuals.
If you are unsure whether your use case is legitimate, consult your lawyers. You are responsible for complying with
YouTube's terms and the laws that apply to you.

### Support

Found a bug, need a field or have a question? Open an issue in the **Issues** tab. Please include the run ID; the
`STATISTICS` record of the run usually tells us what happened.

# Changelog

This Actor's version history is a separate document: https://apify.com/xmolodtsov/youtube-comments-scraper/changelog.md

# Actor input Schema

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

Videos to scrape comments from. Accepts watch URLs (https://www.youtube.com/watch?v=…), Shorts URLs (/shorts/…), youtu.be short links and /live/ or /embed/ URLs. Via API, send each one as an object with a url key. Each video is scraped once, even if listed twice.

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

Stop after this many results per video. Replies count toward this number, like comments. On the free Apify plan a run returns at most 10 results in total.

## `sortCommentsBy` (type: `string`):

YouTube's own comment order: Top comments (the default on YouTube) or Newest first.

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

Also scrape the replies under each comment. Each reply is its own result (type "reply", replyToCid = the comment it answers) and counts toward the maximum.

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

At most this many replies per comment, so you get a spread of threads instead of a few huge ones using up the maximum. Set 0 for every reply.

## `oldestCommentDate` (type: `string`):

Optional. Only comments posted on or after this date: a date like 2026-01-31, or an age like "7 days", "2 weeks", "3 months". Sorts newest first automatically. YouTube shows only relative times ("2 weeks ago"), so the boundary is as precise as that text: comments near the edge may be a little older than the date.

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

Optional. Apify datacenter proxy by default, which works for YouTube comments. Change this only to use residential proxies or your own proxies.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxComments": 10,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeReplies": true,
  "maxRepliesPerComment": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One item per YouTube comment and one per reply: text, author, likes, reply count, pinned and creator-heart flags, the video's title and exact comment total.

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

// Run the Actor and wait for it to finish
const run = await client.actor("xmolodtsov/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=dQw4w9WgXcQ" }],
    "maxComments": 10,
    "maxRepliesPerComment": 2,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("xmolodtsov/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=dQw4w9WgXcQ"
    }
  ],
  "maxComments": 10,
  "maxRepliesPerComment": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call xmolodtsov/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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