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

DEPRECATED — use youtube-scraper (cryptosignals/youtube-scraper) instead. This actor is no longer maintained.

- **URL**: https://apify.com/cryptosignals/youtube-comments-scraper.md
- **Developed by:** [Web Data Labs](https://apify.com/cryptosignals) (community)
- **Categories:** Social media
- **Stats:** 8 total users, 1 monthly users, 100.0% 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?

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 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. Perfect for sentiment analysis, brand monitoring, and audience research. Priced per comment returned.

***

### 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
- **publishedAt** — ISO timestamp of when the comment was posted
- **updatedAt** — Timestamp of last edit (if edited)
- **isReply** — Boolean indicating if this is a reply to another comment
- **parentCommentId** — ID of the parent comment (for replies)

***

### 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 (default 500) |
| `includeReplies` | boolean | Whether to include reply threads | No (default true) |
| `sortBy` | string | Sort order: `top` or `new` | No (default `top`) |
| `minLikes` | integer | Only return comments with at least this many likes | No |

***

### Example input

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

***

### Example output

```json
[
  {
    "videoId": "dQw4w9WgXcQ",
    "commentId": "UgxJ7k2mNpQ8rLxbvZ14AaABAg",
    "text": "This song has been living rent-free in my head for 15 years and I have zero complaints.",
    "author": "MusicLover1987",
    "authorChannelUrl": "https://www.youtube.com/channel/UCabc123def456",
    "likeCount": 48291,
    "replyCount": 342,
    "publishedAt": "2021-06-14T09:22:13Z",
    "updatedAt": null,
    "isReply": false,
    "parentCommentId": null
  },
  {
    "videoId": "dQw4w9WgXcQ",
    "commentId": "UgxJ7k2mNpQ8rLxbvZ14AaABAg.9Kv2x",
    "text": "Same here! I clicked expecting to be rickrolled but stayed for the actual banger.",
    "author": "RetroVibes42",
    "authorChannelUrl": "https://www.youtube.com/channel/UCxyz789",
    "likeCount": 1204,
    "replyCount": 0,
    "publishedAt": "2021-06-15T14:05:30Z",
    "updatedAt": null,
    "isReply": true,
    "parentCommentId": "UgxJ7k2mNpQ8rLxbvZ14AaABAg"
  }
]
```

***

### 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

This actor uses **Pay Per Result** (PPE) pricing — you pay per comment record returned.

- Typical cost: approximately $0.005 per comment
- Example: 10,000 comments ≈ $50.00
- No monthly subscription required — pay as you go on Apify Free plan

***

### Get started

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

# 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/3DYSyS1ShNDtVcjvB/openapi.json
