# YouTube Comments Scraper (with Replies) (`pomlabs/youtube-comments-scraper`) Actor

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

## Pricing

$1.00 / 1,000 comment delivereds

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 (with Replies)

Get the comments and replies of any YouTube video or Short: text, author and channel ID, likes, reply count, creator heart, and when it was posted. Top comments or newest first. Paste one video or hundreds.

**No API key, no daily quota. You pay only for comments delivered: $0.001 per comment.** Videos with comments turned off and invalid links are listed with the reason and never charged.

### What you get

- **Comment text** with author handle, channel ID and avatar
- **Engagement**: likes (numbers, not "4.8M" text) and reply count
- **Replies** linked to their parent (`isReply`, `parentCommentId`), with a cap per comment so you get breadth, not one long thread
- **Creator heart** flag
- **Time**: the text YouTube shows ("6 years ago") and an approximate ISO date computed from it
- **Sort** like the YouTube comment section: top comments or newest first

### How it works

The Actor reads comments through the same internal endpoints the YouTube page uses, page by page, rotating IPs and retrying on another route if YouTube refuses. 4 videos run in parallel.

Our own test on 23 November 2026 with 40 random videos (up to 100 comments each): **1,597 comments**, and on every video the count matched the YouTube Data API (13 videos with 0 comments returned `no_comments`; videos with fewer than 100 comments returned all of them, minus replies above the per-comment cap).

### Input

| Field | Type | Description |
|---|---|---|
| `videos` | array of strings (required) | Watch URLs, youtu.be links, Shorts or 11-character IDs |
| `maxCommentsPerVideo` | integer | Comments + replies per video. Default `100` |
| `sortBy` | `top` or `newest` | Default `top` |
| `includeReplies` | boolean | Default `true` |
| `maxRepliesPerComment` | integer | Default `5`; `0` = no replies |

```json
{
  "videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw", "dQw4w9WgXcQ"],
  "maxCommentsPerVideo": 500,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 5
}
```

### Output

One item per comment or reply:

```json
{
  "videoId": "jNQXAC9IVRw",
  "videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "text": "We're so honored that the first ever YouTube video was filmed here!",
  "author": "@SanDiegoZoo",
  "authorChannelId": "UCC5NfQ6Mf0dq_eEwv4P_hWA",
  "likes": 4800000,
  "replyCount": 1000,
  "isReply": false,
  "parentCommentId": null,
  "heartedByCreator": true,
  "publishedTimeText": "6 years ago",
  "publishedAtApprox": "2020-11-23T08:06:25+00:00"
}
```

A video with comments turned off (not charged):

```json
{ "videoId": "CcOqmLHm6EA", "status": "no_comments", "error": "No comments (disabled, private or empty)" }
```

### Pricing

| Event | Price |
|---|---|
| Comment or reply delivered | $0.001 |

Set a maximum cost per run in the Apify console and the Actor stops cleanly when it is reached.

### Use cases

- Audience research: what viewers ask, praise and complain about
- Find the most liked and most repeated comments on competitors' videos
- Sentiment analysis and LLM pipelines over real audience language
- Monitor comments on your own channel

### Limits

- Likes and reply counts above 1,000 come rounded the way YouTube shows them (e.g. 4.8M becomes 4,800,000).
- The posted time is relative on YouTube; `publishedAtApprox` is computed from it, so older comments are approximate to the month or year.
- Only public videos.

### Related

- [YouTube Transcript Scraper](https://apify.com/pomlabs/youtube-transcript-scraper)

# Actor input Schema

## `videos` (type: `array`):

Watch URLs, youtu.be links, Shorts or the 11-character video ID. Duplicates are removed.

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

Comments + replies per video. You are charged per comment delivered.

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

Same options as the YouTube comment section.

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

Also return replies, marked with isReply and parentCommentId.

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

Caps replies under each comment so you get more distinct comments. 0 = no replies.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 100,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 5
}
```

# Actor output Schema

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

Dataset (overview view).

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

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

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

```

## MCP server setup

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