# YouTube Comments Scraper (comments, replies, likes, authors) (`tamnt67/youtube-comments-scraper`) Actor

YouTube comments scraper: comment text, author, likes, reply count, published time, pinned and hearted flags, plus YouTube replies with their parent comment. Takes video URLs or IDs, top or newest first, no API key. Use it for sentiment analysis of a video's audience.

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

## Pricing

from $0.30 / 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

## YouTube Comments Scraper (comments, replies, likes, authors)

Export the comments and replies of any YouTube video with no login and no API key, for $0.60 per 1,000 comments on the Free plan, down to $0.30 on higher plans.

Paste video URLs or IDs, choose top comments or newest first, decide whether to include replies, and get each comment as a clean record with text, author, likes, reply count, published time and flags for edited, hearted by the creator and pinned. There is no YouTube Data API quota to manage.

### What you can do with it

- **Run sentiment analysis.** Export thousands of comments as JSON or CSV and feed `text` into your sentiment model or an LLM.
- **Research your audience.** See what viewers ask, praise and complain about on your videos or a competitor's.
- **Monitor brand mentions.** Use "Newest first" on a schedule and compare `commentId` sets between runs to catch new comments.
- **Pick giveaway winners.** Export every comment on a giveaway video, then draw from the list.
- **Review moderation.** Find hearted, pinned and edited comments with `isHearted`, `isPinned` and `isEdited`.
- **Build AI training or evaluation data.** Get comment threads with `parentCommentId` linking each reply to its comment.

### Output fields

Each comment or reply is one record in the dataset. Example values below come from a real run on a Marques Brownlee video. Author values of private users are shown as "..." here.

| Field | Example |
|-------|---------|
| `commentId` / `commentUrl` | UgxYp7cDZpNIQ6l1Bp14AaABAg / link that opens the video at that comment |
| `text` | Apple's been real quiet the last 8 days. |
| `authorName` / `authorChannelId` / `authorUrl` / `authorAvatar` | the commenter's @handle, channel ID, channel URL and avatar URL |
| `authorIsVerified` / `authorIsCreator` | false / false (true when the comment is by the video's creator) |
| `likeCount` / `replyCount` | 0 / 0 (numbers as YouTube shows them, rounded above 1,000, for example 19K becomes 19000) |
| `publishedTime` / `isEdited` | "1 hour ago" / false |
| `publishedAtApprox` | 2026-11-12T04:05:20.629Z (estimated from `publishedTime`, see below) |
| `isHearted` / `isPinned` | true when the creator hearted or pinned the comment |
| `isReply` / `parentCommentId` | false / null (for replies: true / ID of the top-level comment) |
| `videoId` / `videoUrl` | g6Die8gVFn0 / https://www.youtube.com/watch?v=g6Die8gVFn0 |
| `videoTitle` / `videoChannelName` | OLED iPad Mini is The Most Apple Product They've Ever Appled / Marques Brownlee |
| `videoViewCount` / `videoCommentCount` | 11745633 / 9700 |
| `position` / `scrapedAt` | 1 (order within the video in this run) / ISO timestamp |

YouTube gives only relative times such as "3 months ago". `publishedAtApprox` turns that into a date, so "3 months ago" is accurate to about a month. It is filled only when the interface language is `en`, otherwise it is null.

Download results as JSON, CSV, Excel or XML, or through the API.

### Example output

One real record from a run on `https://www.youtube.com/watch?v=g6Die8gVFn0` (author values replaced with "..."):

```json
{
  "videoId": "g6Die8gVFn0",
  "videoUrl": "https://www.youtube.com/watch?v=g6Die8gVFn0",
  "commentId": "UgxYp7cDZpNIQ6l1Bp14AaABAg",
  "commentUrl": "https://www.youtube.com/watch?v=g6Die8gVFn0&lc=UgxYp7cDZpNIQ6l1Bp14AaABAg",
  "parentCommentId": null,
  "isReply": false,
  "text": "Apple's been real quiet the last 8 days.",
  "authorName": "...",
  "authorChannelId": "...",
  "authorUrl": "...",
  "authorAvatar": "...",
  "authorIsVerified": false,
  "authorIsCreator": false,
  "publishedTime": "1 hour ago",
  "publishedAtApprox": "2026-11-12T04:05:20.629Z",
  "isEdited": false,
  "likeCount": 0,
  "replyCount": 0,
  "isHearted": false,
  "isPinned": false,
  "videoTitle": "OLED iPad Mini is The Most Apple Product They've Ever Appled",
  "videoChannelName": "Marques Brownlee",
  "videoViewCount": 11745633,
  "videoCommentCount": 9700,
  "position": 1,
  "scrapedAt": "2026-11-12T05:05:20.629Z"
}
```

### How to use

1. Paste one or more video URLs (`youtube.com/watch?v=...`, `youtu.be/...`, `/shorts/...`, `/live/...`) or bare 11-character video IDs into **Video URLs or IDs**.
2. Set **Max comments per video** (replies count toward this limit), pick **Top comments** or **Newest first**, and keep **Include replies** on to get threads, capped by **Max replies per comment**. Optionally set the **interface language** for texts such as "3 days ago".
3. Click **Start**. Comments appear in the dataset as they are fetched.

#### Example input

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=g6Die8gVFn0", "https://youtu.be/i-4o4QLugK4"],
  "maxCommentsPerVideo": 2000,
  "sortBy": "newest",
  "includeReplies": true,
  "maxRepliesPerComment": 100,
  "language": "en",
  "proxyConfiguration": { "useApifyProxy": true }
}
```

Tips:

- "Newest first" plus a scheduled run is an easy way to monitor new comments on your own or a competitor's videos. Compare `commentId` sets between runs.
- Turn **Include replies** off if you only need top-level comments. It is faster and every record is a top-level comment.
- If comments are disabled or the video is private or removed, the run logs a warning and moves on to the next video.
- The default Apify datacenter proxy works for YouTube. Switch to residential only if runs start failing.

### Pricing and cost examples

You pay per comment or reply saved to the dataset ("Comment" event). Platform usage and proxy traffic are already included in the per-comment price.

| Apify plan | Price per 1,000 comments |
|------------|--------------------------|
| Free (default price) | $0.60 |
| Bronze | $0.50 |
| Silver | $0.40 |
| Gold, Platinum, Diamond | $0.30 |

Cost examples on the Free plan:

- 100 comments ≈ $0.06
- 1,000 comments ≈ $0.60
- 10,000 comments ≈ $6.00 (≈ $3.00 on Gold and higher plans)

The Apify Free plan includes $5 of platform credit every month. If you spend it only on this Actor, that covers about 8,300 comments per month.

You are charged only for comments saved to the dataset. A video with comments disabled, or a private or removed video that returns no comments, saves nothing. A request that still fails after 4 attempts stops that video; comments already saved for it stay in the dataset and are charged, and nothing more is saved for it. Duplicate comments within a video, and duplicate video URLs in the input, are skipped before saving. To set a hard cap, enter a maximum total charge per run in the run options. The Actor stops as soon as that limit is reached.

### Use it via API, on a schedule, or from an AI agent

**JavaScript** (`npm install apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('tamnt67/youtube-comments-scraper').call({
    videoUrls: ['https://www.youtube.com/watch?v=g6Die8gVFn0'],
    maxCommentsPerVideo: 500,
    sortBy: 'top',
    includeReplies: true,
    maxRepliesPerComment: 50,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("tamnt67/youtube-comments-scraper").call(run_input={
    "videoUrls": ["https://www.youtube.com/watch?v=g6Die8gVFn0"],
    "maxCommentsPerVideo": 500,
    "sortBy": "top",
    "includeReplies": True,
    "maxRepliesPerComment": 50,
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

**cURL** (runs the Actor and returns the comments in one call):

```bash
curl -X POST "https://api.apify.com/v2/acts/tamnt67~youtube-comments-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["https://www.youtube.com/watch?v=g6Die8gVFn0"], "maxCommentsPerVideo": 200, "sortBy": "newest"}'
```

The sync endpoint waits for the run to finish, so use it for small runs and the client libraries for large ones.

**Schedules:** create an Apify Schedule for this Actor or a saved task to collect new comments on the same videos daily or hourly.

**AI agents:** the Apify MCP server at https://mcp.apify.com lets AI assistants such as Claude or Cursor run this Actor and read its results.

### FAQ

#### How much does YouTube Comments Scraper cost?

YouTube Comments Scraper costs $0.60 per 1,000 comments on the Free plan and $0.50, $0.40 or $0.30 per 1,000 on higher Apify plans. Replies are charged like comments. 1,000 comments cost about $0.60 on the Free plan, and the Free plan's $5 monthly credit covers about 8,300 comments.

#### How many comments do I get per video?

YouTube Comments Scraper returns up to `maxCommentsPerVideo` records per video, from 1 to 100,000, with replies counted in that total. The default is 100. YouTube returns about 20 top-level comments per request, and each comment's replies are capped by `maxRepliesPerComment` (default 50, also used when the field is missing, null or not a number; 0 means no replies).

#### How can I get more comments?

Raise `maxCommentsPerVideo` (up to 100,000) and `maxRepliesPerComment` (up to 10,000), and add more video URLs. YouTube Comments Scraper keeps paging until the video has no more comments or your limit is reached. Very large videos take a while because each page holds about 20 comments.

#### Can I run it on a schedule or through the API?

Yes. YouTube Comments Scraper works with Apify Schedules for daily or hourly runs, and with the Apify API through the JavaScript and Python clients or a single cURL call. It does not use the YouTube Data API, so there is no daily quota.

#### How fresh is the data?

YouTube Comments Scraper reads YouTube live at the time of each run. Nothing is cached. Like and reply counts are what YouTube shows at that moment, and every record has a `scrapedAt` timestamp.

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

YouTube Comments Scraper collects only publicly visible comments, without logging in. Comments and author names are personal data of the people who wrote them. You are responsible for how you use the data, including complying with YouTube's terms of service and with data protection laws such as GDPR. This is not legal advice.

### Limitations

- YouTube returns about 20 top-level comments per request; very large videos with hundreds of thousands of comments take a while.
- Comment text is returned as shown by YouTube in the chosen interface language; it is not translated.
- `likeCount`, `replyCount`, `videoViewCount` and `videoCommentCount` are parsed from the text YouTube shows, so counts above 1,000 are rounded (for example 9.7K becomes 9700).
- Published times are relative. `publishedAtApprox` is an estimate and is filled only for the `en` interface language.
- Video information (title, channel, views) can be empty if YouTube does not return it, for example for private, removed or age-restricted videos.
- Only one video's comments are read at a time; there is no channel-wide or search-based comment export.
- YouTube can change its site at any time. If the Actor stops returning data, report an issue and it will be fixed quickly.

### Changelog

- 1.0 update (2026-11-19): an API call that leaves out `videoUrls` no longer gets the example value added; the example is used only when the run has no input source at all.
- 1.0 (2026-11-19): a missing, null or invalid `maxRepliesPerComment` now means 50 replies per comment instead of silently fetching no replies.

### Integrations

Works with every Apify integration: API, webhooks, Zapier, Make, Google Sheets, Slack, n8n, LangChain and the Apify MCP server.

### Support

Found a problem or missing field? Report it in the Issues tab of this Actor.

# Actor input Schema

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

YouTube video URLs (youtube.com/watch?v=..., youtu.be/..., /shorts/...) or bare 11-character video IDs, one per line.

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

Total records per video, replies included. YouTube returns 20 top-level comments per page.

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

Top comments (YouTube's default ranking) or newest first.

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

Also fetch replies under each comment. Replies have isReply: true and parentCommentId.

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

Only used when replies are included.

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

Two-letter language code for texts such as "3 days ago" (en, de, fr, es, pt, ja, vi...).

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

Apify datacenter proxy works for YouTube. Switch to residential only if runs start failing.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=i-4o4QLugK4"
  ],
  "maxCommentsPerVideo": 100,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 50,
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Dataset with one record per comment or reply: text, author, likes, reply count, published time, hearted and pinned flags, video title.

## `commentsCsv` (type: `string`):

The same dataset exported as CSV.

# 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=i-4o4QLugK4"
    ],
    "maxCommentsPerVideo": 100,
    "maxRepliesPerComment": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tamnt67/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=i-4o4QLugK4"],
    "maxCommentsPerVideo": 100,
    "maxRepliesPerComment": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("tamnt67/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=i-4o4QLugK4"
  ],
  "maxCommentsPerVideo": 100,
  "maxRepliesPerComment": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call tamnt67/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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