# YouTube Comments Scraper (`parseforge/youtube-comments-scraper`) Actor

Extract comments and replies from YouTube videos with optional AI-powered sentiment, emotion, toxicity, and language detection. No API key needed.

- **URL**: https://apify.com/parseforge/youtube-comments-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 117 total users, 13 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.50 / 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.
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?

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### YouTube Comments Scraper

**Scrape comments and replies from any YouTube video, up to a million per run.** Every comment comes with its text, author, likes, timestamp, and computed AI signals. No API key or OAuth. Export to CSV, JSON, Excel, or XML.

YouTube's official API requires an app registration, OAuth, and imposes strict quotas that limit how many comments you can pull. This Actor reads the public comment feeds directly, filtered by video URL, and returns each comment and reply in one fixed schema. Optionally, enable AI enhancement to get sentiment, emotion, toxicity, and language detection for every comment.

| Who uses it | What they scrape YouTube for |
|---|---|
| Content creators | Which topics or phrases spark the most engagement in their video comments. |
| Market researchers | What audiences are saying about a brand, product, or trend across multiple videos. |
| Community managers | Flag toxic or highly emotional comments for moderation or response. |
| Data analysts | Build sentiment and emotion datasets from public YouTube discussions. |

### What it does

This Actor collects comments and replies from YouTube videos by URL, and returns each one as a flat row with optional AI-powered analysis.

- 🧠 **AI-powered analysis:** Sentiment (positive/negative/neutral), emotion (joy, anger, sadness, etc.), toxicity score, and language detection per comment.
- 💬 **Replies included or excluded:** Choose to scrape only top-level comments or include nested replies up to a configurable depth.
- 📦 **Bulk extraction:** Scrape from multiple video URLs in one run, up to 1,000,000 comments total.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with YouTube data

**📈 Track audience sentiment on a product launch.**

A brand manager runs the scraper on review and unboxing videos, enables AI analysis, and exports the sentiment breakdown to decide on messaging adjustments.

**🔍 Moderate comments at scale.**

A community manager scrapes comments from a popular channel, filters by high toxicity scores, and prioritises moderation actions.

**📊 Build a training dataset for NLP models.**

A data scientist collects millions of YouTube comments with AI-generated labels (sentiment, emotion, language) to train a custom classifier.

**💡 Identify trending topics in a niche.**

A content creator scrapes comments from competitor videos, groups by common phrases, and plans their next video around what viewers are asking.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API limits** | Bypass YouTube's quota restrictions and OAuth setup. |
| **AI signals** | Get sentiment, emotion, toxicity, and language without extra tools. |
| **Full reply tree** | Optionally scrape nested replies with a configurable max per comment. |
| **Flat schema** | Every comment and reply is a single row, ready for analysis. |

### How it compares

Compared to the popular YouTube Scraper, this actor focuses specifically on comments and replies with built-in AI analysis.

| Feature | ParseForge | YouTube Scraper |
|---|---|---|
| Scrapes comments and replies | Yes | Not listed |
| AI sentiment analysis | Yes | Not listed |
| AI emotion detection | Yes | Not listed |
| AI toxicity scoring | Yes | Not listed |
| AI language detection | Yes | Not listed |
| Scrapes video metadata | Not listed | Yes |
| Scrapes channel info | Not listed | Yes |

### Configure the run

Drive the Actor from one or more YouTube video URLs (supports youtube.com/watch, youtu.be, and youtube.com/shorts). Filters run as each comment is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxItems": 10
}
```

A larger pull:

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0045 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.45 |
| 1,000 results | $4.50 |
| 10,000 results | $45.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [YouTube Comments Scraper](https://apify.com/parseforge/youtube-comments-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to YouTube through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/youtube-comments-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no comments?**

Check that the video URL is correct and publicly accessible. Some videos have comments disabled or are private. Also verify that maxItems is set high enough.

**The AI analysis is not running.**

Ensure the 'AI Enhancement' toggle is enabled in the input settings. AI analysis only runs when this option is turned on.

**Replies are not being scraped.**

Make sure 'Include Replies' is set to true. Also check that maxRepliesPerComment is not set to 0.

**The run is taking too long.**

Reduce maxItems or maxRepliesPerComment. AI analysis also increases run time; disable it if speed is critical.

**I get an error about invalid URL.**

Only use URLs in the formats: https://www.youtube.com/watch?v=..., https://youtu.be/..., or https://www.youtube.com/shorts/... Remove any extra parameters or playlist IDs.

### FAQ

| Question | Answer |
|---|---|
| Do I need a YouTube API key? | No. This scraper reads the public comment feeds directly, so no API key or OAuth is required. |
| Can I scrape comments from a live stream? | Yes, as long as the video is publicly accessible and has comments enabled. The scraper reads the current comment feed. |
| What video URL formats are supported? | Standard youtube.com/watch?v=..., youtu.be/..., and youtube.com/shorts/... URLs are all supported. |
| How many comments can I scrape per run? | Up to 1,000,000 comments per run, configurable via the maxItems field. |
| Does the AI analysis cost extra? | AI enhancement is an optional feature that uses processing time on the Apify platform. It may increase run duration and cost, but no separate API key is needed. |
| Can I scrape replies to comments? | Yes. Enable the 'Include Replies' option and set the max replies per comment (default 100, up to 1000). |
| What fields are returned for each comment? | Each comment row includes the comment text, author name, author channel URL, like count, published date, and if AI is enabled, sentiment, emotion, toxicity score, and detected language. |
| Can I scrape comments from multiple videos at once? | Yes. Provide multiple video URLs in the startUrls array, and the scraper will process them sequentially in one run. |
| Is there a limit on the number of videos I can input? | No hard limit, but the total comment count across all videos is capped by the maxItems setting. |
| What export formats are available? | You can export the dataset as CSV, JSON, Excel, or XML directly from the Apify platform. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Google LLC. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `startUrls` (type: `array`):

Enter YouTube video URLs to scrape comments from. Supports youtube.com/watch, youtu.be, and youtube.com/shorts URLs.

## `maxItems` (type: `integer`):

How many comments to collect per run.

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

Whether to include replies to comments. If false, only main comments will be scraped.

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

Maximum number of replies to fetch per comment. Only used when Include Replies is enabled.

## `aiEnhancement` (type: `boolean`):

Enable AI-powered analysis for each comment. Adds sentiment analysis, emotion detection, toxicity scoring, and language detection. Note: This uses AI processing and may increase run time.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxItems": 10,
  "includeReplies": true,
  "maxRepliesPerComment": 100,
  "aiEnhancement": false
}
```

# Actor output Schema

## `overview` (type: `string`):

Complete dataset with all comment fields including AI analysis

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

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

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

```

## MCP server setup

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