# YouTube Comment Collector (`skcho/youtube-comment-collector`) Actor

Collect comments and replies for any list of YouTube video URLs, with configurable sort order and per-video limits. No channel crawl required.

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

## Pricing

from $1.00 / 1,000 results

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Comment Collector

Point it at video URLs. Get back every comment those videos will give up — author,
text, likes, reply counts, pinned status — as flat rows you can sort, filter and
chart immediately.

No channel crawl, no account, no cookies. Paste URLs, run.

### What a row looks like

```json
{
  "recordType": "comment",
  "videoId": "aircAruvnKk",
  "videoUrl": "https://www.youtube.com/watch?v=aircAruvnKk",
  "commentId": "UgxKREWxIgDrB0zhOwZ4AaABAg",
  "isReply": false,
  "parentCommentId": null,
  "authorName": "@SomeViewer",
  "authorChannelId": "UCabc123...",
  "authorIsChannelOwner": false,
  "text": "The animation at 4:12 finally made this click for me.",
  "likeCount": 1284,
  "replyCount": 17,
  "publishedTimeText": "2 years ago",
  "isPinned": false,
  "scrapedAt": "2026-08-26T04:07:52.104Z"
}
```

Replies come back as rows too, tagged `isReply` and linked by `parentCommentId`,
so a thread reassembles with one group-by.

### Input

| Field | Meaning |
|---|---|
| `videoUrls` | Watch, Shorts, youtu.be, embed links — or bare 11-character video IDs |
| `maxCommentsPerVideo` | Ceiling per video (see the limit below) |
| `includeCommentReplies` | Pull reply threads as well as top-level comments |
| `maxRepliesPerComment` | Replies taken from any one comment (default 10, `0` = no cap) |
| `commentSortBy` | `TOP_COMMENTS` or `NEWEST_FIRST` |

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "kYfNvmF0Bqw"
  ],
  "maxCommentsPerVideo": 200,
  "includeCommentReplies": true,
  "maxRepliesPerComment": 10,
  "commentSortBy": "TOP_COMMENTS"
}
```

### The one limit worth knowing before you buy

**YouTube stops handing out comment pages long before a thread is exhausted.**
This is a ceiling in YouTube's own pagination, not something an actor can code
around. Measured on a video whose header reports 79 comments:

```
first page  = 20 comments, more available
next page   = +9 comments  → 29 total, no more offered
```

So `maxCommentsPerVideo` is an **upper bound, not a promise**. Busy videos return
far more than quiet ones, and turning on `includeCommentReplies` roughly doubles
the rows you get back. If you need volume, spread the request across more videos
rather than expecting one video to fill a large quota.

We would rather you knew that here than discovered it after paying.

### Why replies are capped per comment

A viral comment can carry a thousand replies. Without a cap it consumes the
whole `maxCommentsPerVideo` budget on its own — a 120-row request came back as
**one comment and 119 of its replies**, which tells you nothing about the video.

`maxRepliesPerComment` defaults to **10**, so the same 120 rows come back as 13
different comments with their replies attached — a cross-section rather than a
single thread. Set it to `0` when you deliberately want one argument in full.

### Good for

- Reading the room on a launch, a review, a controversy
- Feeding sentiment or topic models with real audience language
- Finding your most-engaged commenters by like count
- Watching how the tone of replies shifts under a pinned comment

### Notes

- A video that fails is logged and skipped; the rest of the batch still runs.
- Every row carries `scrapedAt`, so repeat runs stay comparable.
- Results land in the default dataset — export as JSON, CSV, Excel, or pull them
  from the API.

# Actor input Schema

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

List of YouTube video URLs (watch/shorts/youtu.be) or bare 11-character video IDs to collect comments for.

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

Maximum comments (including replies, if enabled) to collect per video.

## `includeCommentReplies` (type: `boolean`):

Also collect replies to each top-level comment.

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

Cap on replies taken from any single comment, so one huge thread cannot consume the whole per-video budget. 0 = no cap.

## `commentSortBy` (type: `string`):

Sort order to fetch comments in.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=X-8K5GssZP0"
  ],
  "maxCommentsPerVideo": 50,
  "includeCommentReplies": true,
  "maxRepliesPerComment": 10,
  "commentSortBy": "TOP_COMMENTS"
}
```

# Actor output Schema

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

One row per comment or reply, with author, text, like and reply counts. Replies link to their parent through parentCommentId.

# 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=X-8K5GssZP0"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("skcho/youtube-comment-collector").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=X-8K5GssZP0"] }

# Run the Actor and wait for it to finish
run = client.actor("skcho/youtube-comment-collector").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=X-8K5GssZP0"
  ]
}' |
apify call skcho/youtube-comment-collector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,skcho/youtube-comment-collector"
        }
    }
}

```

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/SszeDPgoltrlElEdP/builds/l8JgvfS3gETBlbyZb/openapi.json
