# YouTube Comments Scraper - Replies & Dates (`kaleidoscopelabs/youtube-comments-scraper`) Actor

Scrape YouTube comments and replies from any video or Shorts: comment text, author, channel, likes as numbers, reply count, date, pinned, hearted by the creator, edited. Top or newest first, a date filter, video details on request. Videos with comments off get a free record.

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

## Pricing

from $0.35 / 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 can YouTube Comments Scraper do?

**Scrape YouTube comments and replies from any video or Short: the text, the author, likes as numbers, the reply count, the date, and whether the creator pinned or hearted it, as JSON, CSV or Excel.**

[![Use it from your AI agent: copy the MCP setup prompt](https://assets.kaleidoscopelabs.io/afy/mcp/mcp-setup.5ac6bded.png)](https://mcp.apify.com/?tools=kaleidoscopelabs/youtube-comments-scraper)

![The top 10 comments of a lecture video as rows: likes as the page shows them and as numbers, replies, and days; the first is the channel's own pinned comment.](https://assets.kaleidoscopelabs.io/afy/yt-comments/hero.f39c97a4.png)

Give it links to videos or Shorts, or video IDs; it reads their comments as a signed-out visitor sees them, top comments or newest first, and you get one record per comment, and per reply when you ask for them. You pay $0.50 per 1,000 comments, and nothing for a video with comments off.

- 💬 **Comments and replies:** every comment with its text, author, channel, likes and reply count; replies with the comment they answer.
- 🔢 **Numbers you can sort:** likes as a number (1,300 for "1.3K") beside the page's own text, and the reply count.
- 📅 **Dates and a date filter:** each comment's day, from the page's "3 weeks ago", and only comments since a day or a span such as 7 days.
- 📌 **Pinned, hearted, by the creator:** whether the creator pinned a comment, gave it a heart, or wrote it.
- 🎬 **Video details on request:** one record per video with its title, channel, views, length and publish date, free.
- ✅ **Videos without comments are free:** comments off, a live chat, a private or removed video: one record that says which, in YouTube's words where it gives them, not charged.

Run it from Apify Console, through the API, on a schedule, or from an AI agent. The prefilled input reads 20 top comments of one video, for $0.01, in under 30 seconds, so you can see the output before a larger run.

| You want | Use | What it costs |
|---|---|---|
| A video's top comments | Its link or ID | $0.50 per 1,000 comments |
| Every comment of a video | Comments per video: 0 | $0.50 per 1,000 comments |
| Only comments since yesterday | Newest first, Comments published on or after: 1 day | The recent comments only |
| Threads with their replies | Include replies | Each reply is a comment |
| Which videos have comments off | Any input | Free: one record per video |

### What data do you get from a YouTube comment?

| Field | What it holds |
|---|---|
| `text` | The comment as written |
| `author`, `authorChannelId`, `authorUrl`, `authorThumbnail` | The author's name as the page shows it, channel, page and picture |
| `authorIsVerified`, `isCreatorComment` | A verified channel; the video's own channel |
| `likeCount`, `likeCountText` | Likes as a number, and as the page writes them |
| `replyCount` | The comment's replies |
| `publishedAt`, `publishedTimeText` | The comment's day (approximate, from the relative time) and the page's own text; `isEdited` |
| `isPinned`, `isHearted` | Pinned by the creator; given a heart by the creator |
| `commentId`, `parentCommentId`, `commentUrl` | The comment's ID, a reply's thread, and a link that opens it |
| `recordType` | comment, reply, or video |
| `videoId`, `pageUrl`, `sortBy`, `position` | The video, the order read, and the comment's place in it from 1 |
| `missing` | What the record lacks and why, such as a date the page's time does not give; empty on a whole record |

A video record has `status` (commentsOff, liveChat, unavailable, noComments, noCommentsSinceDate, commentsNotAllRead; with video details also commentsRead), `message` with YouTube's words where it gives them, and with video details `title`, `channelName`, `channelId`, `viewCount`, `durationSeconds`, `videoPublishedAt`, `uploadedAt`, `category` and `description`.

### How to use YouTube Comments Scraper

1. Create a free Apify account and open YouTube Comments Scraper in Apify Console.
2. In **YouTube video URLs**, enter the videos, one per line: a watch, youtu.be or Shorts link, or an ID.
3. Set **Comments per video** (0 for every comment) and **Sort by**: top comments or newest first.
4. If you want, set **Comments published on or after**, turn on **Include replies**, or **Include video details**.
5. Click **Start**, then download the comments as JSON, CSV, Excel or HTML, or read them through the API.

### How much does it cost to scrape YouTube comments?

YouTube Comments Scraper is priced per event, with no usage fees on top:

| Event | Price | When |
|---|---|---|
| Comment | $0.50 per 1,000 | each comment or reply stored |

Prices shown are for Apify's free plan; on paid plans they are up to 30% lower.

- **Charged:** each comment or reply stored.
- **Not charged:** a video record (comments off, a live chat, unavailable, no comments, video details); a video the run could not read (named by ID in RUN_PROGRESS); a run that stops on an input mistake (only the platform's start fee); a comment a restarted run had already stored.

The platform also charges $0.00005 when a run starts. Set a maximum total charge in the run options to cap a run: the Actor stops before it.

The recipes below, run on 2026-11-15 on one MIT OpenCourseWare lecture:

| Run | Records | Time | Cost |
|---|---|---|---|
| The video's top 100 comments | 100 comments | 31 s | $0.05 |
| Every comment, with its replies | 787 comments and 317 replies | 11 min | $0.55 |
| Comments of the last day, newest first | 1 comment | 6 s | $0.00055 |

### Input recipes

Each recipe is a complete input: paste it into the JSON tab of the input form, or send it through the API. Fields left out take their defaults. The table above gives each one's result.

**A video's top 100 comments:**

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

**Every comment, with its replies:**

![Every comment with its replies: the first 10 threads of a lecture, each reply under the comment it answers; 787 comments, 317 replies, 23 of them by the channel.](https://assets.kaleidoscopelabs.io/afy/yt-comments/replies.5aa28e07.png)

```json
{
  "startUrls": ["https://www.youtube.com/watch?v=J7DzL2_Na80"],
  "maxComments": 0,
  "includeReplies": true,
  "maxRepliesPerComment": 0
}
```

**Recent comments, every day** (schedule it daily; keep one record per `commentId` when you join the runs):

```json
{
  "startUrls": ["https://www.youtube.com/watch?v=J7DzL2_Na80"],
  "sortBy": "newest",
  "maxComments": 0,
  "oldestCommentDate": "1 day"
}
```

API and agent calls that leave `maxComments` out get up to 100 comments per video, replies included; 0 reads every comment. Comments published on or after takes a date such as 2026-01-31 or a span back from today such as 7 days.

| You see | Why, and what to do |
|---|---|
| A record with `recordType` video and no comments | The video has comments off, is a live stream, or is unavailable: `status` and `message` say which. Not charged |
| Fewer comments than the video's count | YouTube's count includes replies, and its list can be shorter than its count; set Include replies, and Comments per video 0 |
| No records, and the input's own message | Nothing was read or charged: correct the input as it says (RUN_SUMMARY's `inputError` names the kind, for a program) |

### Output example

![One comment record, shortened: the comment on its video, who wrote it, likes and replies as numbers, its day, and whether the creator pinned or hearted it.](https://assets.kaleidoscopelabs.io/afy/yt-comments/record.7cc94beb.png)

A comment from a run on 2026-11-15 (the channel's own, pinned) and a video record from one with video details on, on 2026-11-14:

```json
{
  "recordType": "comment",
  "videoId": "J7DzL2_Na80",
  "pageUrl": "https://www.youtube.com/watch?v=J7DzL2_Na80",
  "commentUrl": "https://www.youtube.com/watch?v=J7DzL2_Na80&lc=Ugw8PKP2yLKCnHtP3ud4AaABAg",
  "commentId": "Ugw8PKP2yLKCnHtP3ud4AaABAg",
  "text": "Audio channels fixed!",
  "author": "@mitocw",
  "authorChannelId": "UCEBb1b_L6zDS3xTUrIALZOw",
  "authorUrl": "https://www.youtube.com/@mitocw",
  "authorIsVerified": true,
  "isCreatorComment": true,
  "likeCount": 1300,
  "likeCountText": "1.3K",
  "replyCount": 29,
  "publishedTimeText": "7 years ago",
  "publishedAt": "2019-11-17",
  "isEdited": false,
  "isPinned": true,
  "isHearted": false,
  "sortBy": "top",
  "position": 1,
  "missing": []
}
```

```json
{
  "recordType": "video",
  "videoId": "Zezt6EsG9WE",
  "pageUrl": "https://www.youtube.com/watch?v=Zezt6EsG9WE",
  "status": "commentsOff",
  "message": "Comments are turned off. Learn more",
  "title": "NASA Moon Base: Rovers and Lunar Terrain Vehicles (October 2026 Update)",
  "channelName": "NASA",
  "channelId": "UCLA_DiR1FfKNvjuUpBHmylQ",
  "viewCount": 1059921,
  "durationSeconds": 557,
  "videoPublishedAt": "2026-10-20T08:02:15-07:00",
  "category": "Science & Technology",
  "missing": []
}
```

The run's default key-value store also holds **RUN_SUMMARY**: the comments stored, the videos without comments by kind, the videos whose answers could not all be read, the videos that could not be read, how the run ended and whether it is complete, and a Ref to quote if you report a problem. **RUN_PROGRESS** names, by ID, the videos the run could not read, kept up to date as the run goes.

The dataset has two views: Comments (the video, position, text, author, likes, replies, date, pinned, hearted, the link) and Videos (each video's status, message, title, channel, views, length and publish date).

### Integrations and API

- **Make, Zapier, n8n:** start a run with a video and get the comments when it finishes.
- **Google Sheets, webhooks, the Apify API and clients** for JavaScript and Python.
- **AI agents:** through Apify's MCP server, an agent can call the Actor as a tool.

```bash
curl -X POST "https://api.apify.com/v2/acts/kaleidoscopelabs~youtube-comments-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"startUrls": ["https://www.youtube.com/watch?v=J7DzL2_Na80"], "maxComments": 20}'
```

### Building on this Actor

- **Output stability:** fields are added, never renamed or removed without a new major version; every change is in the changelog with its date.
- **What a run's end means:** every video read ends in comments or a video record that says why it has none; a video that could not be read is counted in the run's last message and named in RUN_PROGRESS. A run that stores nothing because YouTube did not answer fails instead of succeeding empty. An input the Actor cannot read ends the run at once, nothing read or charged.
- **Cost per call:** one event, $0.50 per 1,000 comments; a video record is never charged; the run stops before your maximum total charge.
- **Notice:** price changes follow Apify's 14-day notice; retiring the Actor is announced here first.

### For AI agents

AI agents can call it through the Apify MCP server ([setup prompt for your agent](https://mcp.apify.com/?tools=kaleidoscopelabs/youtube-comments-scraper)). Connect an MCP client to `https://mcp.apify.com?tools=kaleidoscopelabs/youtube-comments-scraper` with your Apify API key, then ask, for example, "What do viewers say about https://www.youtube.com/watch?v=J7DzL2_Na80?"

- **Minimal input:** `{"startUrls": ["https://www.youtube.com/watch?v=J7DzL2_Na80"], "maxComments": 50}`.
- **Fields to read:** `text`, `likeCount`, `replyCount`, `publishedAt`, `isPinned`, `isHearted`; `recordType` to tell comments, replies and video records apart.
- **What to know:** a video with no comments gives one `video` record with `status`, never an empty result; an input mistake ends SUCCEEDED with an empty dataset and RUN_SUMMARY's `inputError` set.

### Tips

- **Try it cheap:** the prefilled input reads 20 comments; raise the count once the output looks right.
- **Newest first with a date stops early:** a video's reading ends at its first older comment. With top comments, older ones are skipped, but the whole list is read.
- **Daily runs overlap:** a comment shown as "1 day ago" is kept by two days' runs, as the page gives no exact time: keep one record per `commentId`.
- **The date applies to comments:** a comment older than the date is left out with its replies, even a reply written today.
- **Dates are approximate:** YouTube gives "3 weeks ago", not a date; `publishedAt` is the run's day less that, and the date filter keeps a comment near its edge rather than drop it: with 30 days, a comment shown as "1 month ago" is kept, though it can be up to two months old.
- **Very long lists take time:** one video's 1,104 comments and replies took 11 minutes; for a video with more than about 5,000, raise the run's timeout above its default hour.
- **Replies count toward Comments per video:** 100 with replies on is 100 comments and replies together.

Did it save you time? A rating on this page helps others find it; an Issue tells us what to fix.

### FAQ

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

The Actor reads comments that YouTube shows to every visitor of a public video, at a modest pace. YouTube's terms of service govern how its site is used, and how you use the comments is your responsibility: check the laws and terms that apply to you and the purpose you use them for.

#### Does it collect personal data?

The Actor reads public videos as a signed-out visitor sees them. Comments carry their authors' names, channels and pictures, and what people wrote, which can contain personal data. If you store or process such data, you are responsible for a lawful basis under the GDPR, KVKK or the laws that apply to you; ask a lawyer when in doubt.

#### Is there an official YouTube comments API?

YouTube's Data API gives comments with an API key and a daily quota of its own. This Actor needs no key of yours for YouTube: it reads what a public video's page shows, and gives likes as numbers and the pinned and hearted flags beside each comment.

#### Why are some comments missing?

YouTube's count includes replies, and with top comments it shows its featured comments: on one video counted at 901, top gave 580 comments and newest first 584, the rest being replies. A video with comments off, a live stream's chat, or a private video gives a video record that says so.

### Limits

- **Videos and Shorts only:** give each video's link; channels and playlists are not read yet.
- **Dates are approximate:** the page gives relative times only; a month counts as 30 days, a year as 365.
- **Likes above 1,000 are rounded,** as the page writes them ("1.3K").
- **Live chat** is not read; a live stream or premiere gives a video record.

### Other Actors

| Actor | Use it with this one to |
|---|---|
| [YouTube Transcript API & Scraper - Subtitles](https://apify.com/kaleidoscopelabs/youtube-transcript-scraper) | Read what the video says, beside what viewers say about it |

### Support and feedback

Open an issue on the Actor's Issues tab: we answer within 24 hours. If the Actor helps you, a review and a bookmark help others find it.

*YouTube Comments Scraper is an independent tool, not affiliated with, endorsed by or sponsored by Google LLC. YouTube is a trademark of Google LLC.*

# Changelog

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

# Actor input Schema

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

A YouTube video's URL (watch, youtu.be, Shorts, embed, live) or its 11-character ID. A line that is none of these is skipped and said in the log.

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

How many comments each video gives, replies included; 0 reads every comment.

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

The order the video's page shows its comments in: top comments first, or newest first.

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

Only comments published on or after this day: a date, or a span back from today such as 7 days (1 day is today). The page gives comments' times as "3 weeks ago", so the day is approximate near the edge. With newest first, a video's reading stops at its first older comment; with top comments, older ones are skipped.

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

Also read each comment's replies, a record each, with its thread's comment ID. Replies count toward Comments per video.

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

How many replies each comment gives when replies are included; 0 reads every reply.

## `includeVideoInfo` (type: `boolean`):

Add one record per video with its title, channel, views, length, publish date, category and description, and whether its comments were read. Not charged.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=J7DzL2_Na80"
  ],
  "maxComments": 20,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 50,
  "includeVideoInfo": false
}
```

# Actor output Schema

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

One record per comment, and per reply when asked, in the run's default dataset; a video record for each video without comments, and for every video with video details on.

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

What the run did: the comments stored, the videos without comments by kind, what could not be read, and the Ref to quote in an issue.

## `progress` (type: `string`):

The videos the run could not read, by their IDs: written as the run goes and at its end, so a run moved or resurrected counts them once.

# 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": [
        "https://www.youtube.com/watch?v=J7DzL2_Na80"
    ],
    "maxComments": 20,
    "sortBy": "top",
    "maxRepliesPerComment": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("kaleidoscopelabs/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": ["https://www.youtube.com/watch?v=J7DzL2_Na80"],
    "maxComments": 20,
    "sortBy": "top",
    "maxRepliesPerComment": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("kaleidoscopelabs/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": [
    "https://www.youtube.com/watch?v=J7DzL2_Na80"
  ],
  "maxComments": 20,
  "sortBy": "top",
  "maxRepliesPerComment": 50
}' |
apify call kaleidoscopelabs/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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