# YouTube Comments Scraper - Free Comment Extractor (`cryptosignals/youtube-comments-scraper`) Actor

Extract YouTube comment threads at scale. Returns one structured row per comment — text, author, channel URL, like count, reply count, relative publish time, plus flat reply rows linked by parentCommentId. Sort by top or new, cap comments per video, filter by minimum likes.

- **URL**: https://apify.com/cryptosignals/youtube-comments-scraper.md
- **Developed by:** [Web Data Labs](https://apify.com/cryptosignals) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 8 total users, 0 monthly users, 96.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 — Extract Comment Threads & Sentiment Data

Extract comment threads from any YouTube video at scale. Get structured JSON with comment text, author details, like counts, reply counts, timestamps and full reply threads — ready for sentiment analysis, brand monitoring and audience research.

***

### What you get

- **videoId** — YouTube video identifier
- **commentId** — Unique comment ID
- **text** — Full comment text content
- **author** — Display name of the commenter
- **authorChannelUrl** — Link to the commenter's YouTube channel
- **likeCount** — Number of likes on the comment
- **replyCount** — Number of replies to a top-level comment (`0` on reply rows)
- **publishedAt** — Age of the comment as YouTube renders it, e.g. `"1 year ago"` (relative text, not an ISO timestamp)
- **updatedAt** — Always `null`; this feed does not expose a comment edit timestamp
- **isReply** — `true` when the row is a reply to another comment
- **parentCommentId** — ID of the top-level comment the reply belongs to (`null` on top-level rows)

Replies are returned as **flat rows**, not nested objects — rebuild a thread by grouping on `parentCommentId`.

***

### Input parameters

| Field | Type | Description | Required |
|-------|------|-------------|----------|
| `videoUrl` | string | Full YouTube video URL | Yes (or `videoIds`) |
| `videoIds` | array | List of YouTube video IDs to process | No |
| `maxComments` | integer | Maximum comments to extract per video | No |
| `includeReplies` | boolean | Whether to include reply threads | No |
| `sortBy` | string | Sort order: `top` or `new` | No |
| `minLikes` | integer | Only return comments with at least this many likes | No |

Defaults and limits for every field are shown in the **Input** tab — it is generated from the Actor's own input schema, so it is always current.

***

### Example input

```json
{
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "maxComments": 100,
  "includeReplies": true,
  "sortBy": "top"
}
```

***

### Example output

A real row from a run of this Actor:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "commentId": "Ugzge340dBgB75hWBm54AaABAg",
  "text": "can confirm: he never gave us up",
  "author": "@YouTube",
  "authorChannelUrl": "https://www.youtube.com/@YouTube",
  "likeCount": 313000,
  "replyCount": 963,
  "publishedAt": "1 year ago",
  "updatedAt": null,
  "isReply": false,
  "parentCommentId": null
}
```

Reply rows have the same keys, with `isReply: true` and `parentCommentId` set to the top-level comment's ID.

If a video has comments disabled, the run finishes with zero items rather than an error.

***

### Use cases

**Brand sentiment monitoring**: Track what viewers say about your brand, product launch video, or sponsored content. Identify praise, complaints, and feature requests in bulk.

**Content moderation research**: Analyze comment toxicity, spam patterns, or policy violations across a channel. Feed data into classification models for automated moderation.

**Audience research**: Understand what resonates with your audience. Mine top-liked comments to discover which messages, jokes, or reactions your viewers amplify.

**Competitive analysis**: Scrape competitor video comments to understand their audience pain points and desires. Use insights to sharpen your own content and product positioning.

***

### Pricing

See the **Pricing** tab on this Actor's page for the current, authoritative pricing — it is the only place that is guaranteed to be up to date.

***

### Get started

[Run YouTube Comments Scraper on Apify](https://apify.com/cryptosignals/youtube-comments-scraper)

***

*Found this actor useful? [Leave a review](https://apify.com/cryptosignals/youtube-comments-scraper#reviews) - it helps a lot. Something broken? Report it on the [Issues tab](https://apify.com/cryptosignals/youtube-comments-scraper/issues).*

# Actor input Schema

## `videoUrl` (type: `string`):

Full YouTube video URL (required if videoIds is empty).

## `videoIds` (type: `array`):

List of YouTube video IDs to process.

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

Maximum comments to extract per video.

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

Whether to include reply threads.

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

Sort order: top or new.

## `minLikes` (type: `integer`):

Only return comments with at least this many likes.

## Actor input object example

```json
{
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoIds": [],
  "maxComments": 500,
  "includeReplies": true,
  "sortBy": "top",
  "minLikes": 0
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "videoIds": [],
    "maxComments": 500,
    "sortBy": "top"
};

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

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

```

## MCP server setup

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