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

Effortlessly scrape YouTube video comments (and their replies, if you need them). Directly target one or more YouTube videos or specify a YouTube channel and let the scraper discover the videos for you. Easy to use and economical to run.

- **URL**: https://apify.com/ultimate/youtube-comments-scraper.md
- **Developed by:** [Ultimate Insight](https://apify.com/ultimate) (community)
- **Categories:** Automation, Social media, Videos
- **Features:** Limited permissions
- **Stats:** 36 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.60 / 1,000 video 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?

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** is the fast and easy way to extract the full conversation around any YouTube video. Simply enter one or more video or channel URLs and specify the amount of data you need. Your result set will include a separate output file for each qualifying video, populated with detailed metadata for its viewer comments (and their replies, if required).
<br><br>

### 🔑 Key Features

- Target individual videos or bulk content from your designated channels
- Get detailed metadata for some or all of each video's comments (you set the limits)
- Optionally include detailed comment replies
- Fine-grained billing means you pay only for the data elements that you actually need
- Super-simple setup gives you maximum results for minimum effort
  <br><br>

### 💡 What Can You Do with YouTube Comments?

YouTube comments are full of unfiltered opinions and ideas. This scraper helps you tap into that conversation and turn it into something useful. Here are three simple ways you can put it to work:

#### Audience Research and Content Ideas

You are a creator looking for fresh inspiration that resonates with your audience.

Scrape comments from your own or competitors’ videos to uncover recurring questions, complaints, or suggestions. Feed this data into an AI assistant to summarize common themes and generate video ideas, titles, or outlines that directly address audience interests.

#### Product Feedback and Sentiment Tracking

You are a product team, marketer, or customer success manager seeking candid, unfiltered opinions.

Collect comments that mention your brand or product and run them through a sentiment analysis pipeline. This highlights praise, criticism, and emerging issues that may never appear in surveys or support tickets - giving you a more complete view of customer experience.

#### Community Engagement Insights

You are a brand or agency aiming to strengthen engagement with your audience.

Analyze comments to identify your most loyal fans, frequent contributors, or high-value discussions. Use this data to guide reply strategies, spotlight user-generated ideas, or even shape community-driven campaigns.
<br><br>

### 🚀 How to Scrape YouTube Comments

*YouTube Comments Scraper* is designed for simplicity and ease of use. To get started, you just need to configure a few basic settings in the Apify Console.

#### Step 1: Enter Target URLs

Start by providing a list of URLs that define the content you want to scrape.

![Screenshot: setting target page URLs](https://i.imgur.com/1RNIPHV.png)

For beginners, we recommend focusing on individual video URLs, although you can also target YouTube channels to scrape comments in bulk (see table below).

A single scraping run may mix multiple video and channel URLs.

##### Supported URL Examples

| URL Type | Example | How it Works |
| -------- | ------- | ------------ |
| **Video page URL** | `https://www.youtube.com/watch?v=VIDEO_ID` | Scrapes comments from one specific video. Each URL produces a separate scraping result. |
| **Channel home page URL** | `https://www.youtube.com/@CHANNEL_HANDLE`<br>`https://www.youtube.com/channel/CHANNEL_ID` | Scrapes comments from multiple videos on a channel. The number of videos is controlled by the `maxChannelVideos` setting. |

#### Step 2: Set a Video Crawl Limit

This step is not necessary if you are only directly targeting YouTube video URLs.

For channel URLs, configure how many videos the scraper should target. For example, setting a limit of `5` will scrape comments from the 5 most recent videos.

![Screenshot: a crawl limit](https://i.imgur.com/RBWXbJ1.png)

Video limits are **required when targeting channel URLs**. Leaving the value at zero means no videos will be scraped.

#### Step 3: Configure Comment and Reply Limits

Having specified which YouTube content you're targeting, and how many videos to scrape, you now need to set limits on commment and reply volume.

![Screenshot: setting comment scraping limits](https://i.imgur.com/C4rmJiC.png)

- `maxVideoComments` – the maximum number of comments to retrieve for each targeted video. You must set a value greater than `0`.
- `maxCommentReplies` – the maximum number of replies to fetch for each comment thread. Set to `0` if you only want top-level comments.

These limits help you control the size of your dataset and avoid unnecessary running costs.

#### Step 4: Launch the Scraper

Once your URLs and limits are set, simply launch the run using Apify’s standard interface. The scraper will crawl the designated videos, retrieve comments and replies according to your settings, and deliver your scraping results via the Apify Console.
<br><br>

### 💰 Understanding Running Costs

*YouTube Comments Scraper* uses Apify’s **Pay per Event (PPE)** pricing model. This means you are billed for each individual piece of data that the scraper processes, such as each video, comment, or reply that is saved. Instead of paying a flat fee, your costs scale with the amount of data you scrape. You never incur any Apify platform operating costs.

#### How Costs Work

Each scraping run generates a number of micro-charges based on the operations it performs and the data collected.

All billing calculations are handled automatically by the scraper and charged to your account by Apify; you do not need to calculate anything manually.

The main cost drivers for this scraper are the number of targeted videos, the number of comments per video and the number of replies per comment.

The complete pricing table for this scraper can be found on the Apify [pricing](https://apify.com/ultimate/youtube-comments-scraper/pricing) tab.

Note that we also participate in Apify's tiered pricing scheme, which means that you'll benefit from progressive discounts if you are on a higher-tier Apify plan.

#### Worked Example

Suppose you configure a run as follows:

- 10 videos from a channel
- 20 comments per video
- 10 replies per comment

The scraper would execute the run, subject to the following **maximum** charges:

1. **Video**: 10 videos
2. **Comments**: 20 comments × 10 videos = 200 comments
3. **Replies**: 10 replies × 200 comments = 2,000 replies

Your run cost would then be calculated based on the per-item PPE rates for video results, comments, and replies.

You are only charged for the **actual data results delivered**, so videos with fewer comments/replies than your configured limits would be charged less than the theoretical maximum.
<br><br>

### 🧪 Sample Output Data

A successful scraper run yields one or more JSON output files, each containing the comments/replies for a scraped video.

Each output file contains a single root-level JSON object, representing the video, with a nested object hierarchy that represents a subset or all of the video's viewer comments (and optionally their replies).

The number of scraped comments for each video and the number of replies for each comment will depend on your configured scraping limits.

```json
{
	"id": "99bgTARgKD8",
	"url": "https://www.youtube.com/watch?v=99bgTARgKD8",
	"publishDate": "2025-07-27T19:53:39.000Z",
	"title": "England vs. Spain UEFA Women's Euro 2025 Highlights | FOX Soccer",
	"comments": {
        "totalCount": 885,
        "comments": [
            {
                "id": "Ugxb_EVDe8bNFSYcBlR4AaABAg",
                "content": "What was your favorite moment from this match?",
                "publishedDate": "2025-07-28T00:00:00.000Z",
                "authorDisplayName": "@Foxsoccer",
                "isPinned": true,
                "isHearted": false,
                "hasDonation": false,
                "isCreator": true,
                "likeCount": 55,
                "replyCount": 3,
                "replies": [
                    {
                        "id": "Ugxb_EVDe8bNFSYcBlR4AaABAg.AL5Q-Hv6FIHAL5QX-pe8_B",
                        "content": "Kelly's winning penalty 🏴󠁧󠁢󠁥󠁮󠁧󠁿",
                        "publishedDate": "2025-07-28T00:00:00.000Z",
                        "authorDisplayName": "@richm23k",
                        "isPinned": false,
                        "isHearted": false,
                        "hasDonation": false,
                        "isCreator": false,
                        "likeCount": 37
                    },
                    {
                        "id": "Ugxb_EVDe8bNFSYcBlR4AaABAg.AL5Q-Hv6FIHAL5SXIct-fT",
                        "content": "Watching the women successfully score a good pen.",
                        "publishedDate": "2025-07-28T00:00:00.000Z",
                        "authorDisplayName": "@FlipJohn",
                        "isPinned": false,
                        "isHearted": false,
                        "hasDonation": false,
                        "isCreator": false,
                        "likeCount": 13
                    },
                    {
                        "id": "Ugxb_EVDe8bNFSYcBlR4AaABAg.AL5Q-Hv6FIHAL5SeW5JNHG",
                        "content": "Hampton's super save.",
                        "publishedDate": "2025-07-28T00:00:00.000Z",
                        "authorDisplayName": "@Muu0934",
                        "isPinned": false,
                        "isHearted": false,
                        "hasDonation": false,
                        "isCreator": false,
                        "likeCount": 12
                    }
                ]
            },
            {
                "id": "UgyD8-Y0kZ0TQauFymt4AaABAg",
                "content": "Chloe Kelly is HER!!!\n-Winning goal in the Euro 2022 Final.\n-Winning penalty in the 2023 Finalissima.\n-Winning penalty in the 2023 World Cup Round of 16.\n-Subs in and immediately sets up two clutch goals, plus scores her penalty to keep England alive in the Euro 2025 Quarterfinal.\n-Winning goal in the Euro 2025 Semifinal.\n-Winning penalty in the Euro 2025 Final.",
                "publishedDate": "2025-07-28T00:00:00.000Z",
                "authorDisplayName": "@nintendolegonbafan5413",
                "isPinned": false,
                "isHearted": true,
                "hasDonation": false,
                "isCreator": false,
                "likeCount": 381,
                "replyCount": 0
            }
        ]
    }
}  
```

<br><br>

### 🆘 Support & Feedback

We want you to enjoy the best possible experience while using *YouTube Comments Scraper*, so we're laser focused on providing the support you need, when you need it.

If you run into an obstacle, while configuring or using the scraper, please [raise an issue](https://apify.com/ultimate/youtube-comments-scraper/issues), and we'll give it our rapid attention. We treat bugs and breakages as an absolute priority, but we're also keen to help out with advice and guidance that will make your scraping task easier and more effective.

If you have any feedback that would help us to improve the product, we'd also love to hear from you.

And, if you find the *YouTube Comments Scraper* useful, we'd really appreciate it if you would leave us a quick rating/review (accessible via the **Reviews** tab in Apify Console). It really helps us to boost our Store visibility and keeps us motivated to continue working on new features. Thank you.
<br><br>

### 7️⃣ Meet the Magnificent Seven

Whatever your YouTube scraping needs, we’ve got you covered. Our expanding range includes both quick-start, task-specific scrapers and our all-encompassing *YouTube Ultimate Scraper*, which provides maximum flexibility for advanced users and complex use cases. We also have 3 exciting new additions coming soon.

<table>
<tr><td><img src="https://i.imgur.com/UrYixcn.png" width="250"></td><td><strong><a href="https://apify.com/ultimate/youtube-video-scraper">YouTube Video Scraper</a></strong><br><br>The fast and easy way to capture detailed metadata for YouTube videos and channels. Simply provide one or more video or channel URLs and set your data limits. Each result includes the video’s detailed metadata and, optionally, that of its associated channel.<br><br></td></tr>
<tr><td><img src="https://i.imgur.com/ETP9dvS.png" width="250"></td><td><strong><a href="https://apify.com/ultimate/youtube-comments-scraper">YouTube Comments Scraper</a></strong><br><br>Quickly extract the full conversation around any YouTube video. Enter video or channel URLs and define the amount of data you need. Each result contains viewer comments (and their replies, if required), helping you analyze audience engagement and sentiment for your own channels or those of your competitors.<br><br></td></tr>
<tr><td><img src="https://i.imgur.com/5y18kDn.png" width="250"></td><td><strong><a href="https://apify.com/ultimate/youtube-transcript-scraper">YouTube Transcript Scraper</a></strong><br><br>Retrieve complete transcripts for any YouTube video in seconds. Provide video or channel URLs, set your data limits, and choose your preferred format: timeline-based (segmented) or continuous text. Each result delivers the full transcript for a selected video.<br><br></td></tr>
<tr><td><img src="https://i.imgur.com/wr42jBh.png" width="250"></td><td><strong><a href="https://apify.com/ultimate/youtube-scraper">YouTube Ultimate Scraper</a></strong><br><br>The flagship of our YouTube scraping suite, <em>YouTube Ultimate Scraper</em> combines the functionality of all or our individual scrapers and more. It's ideal for users who need multiple data types (e.g., comments, transcripts, and metadata) in a single dataset, or greater control over targeting, filtering, and formatting. Our free onboarding service helps you to get started, even if your scraping needs are complex.<br><br></td></tr>
<tr><td><img src="https://i.imgur.com/zewJ2KF.png" width="250"></td><td><strong>YouTube Channel Insights</strong> (coming soon)<br><br>Gain a deep understanding of any YouTube channel’s commercial goals and strategies. This tool aggregates and analyzes channel metadata and external references to uncover insights such as linked social media profiles, owned domains, monetization models, content strategy, and key performance metrics (videos, views, subscribers, publishing tactics, engagement, and growth).<br><br></td></tr>
<tr><td><img src="https://i.imgur.com/QIDALKK.png" width="250"></td><td><strong>YouTube Channel Finder</strong> (coming soon)<br><br>Discover YouTube channels that match your specific criteria. This tool locates channels by keywords or hashtags, then filters them using advanced inference techniques (powered by <em>YouTube Channel Insights</em>), helping you find creators, brands, or niches aligned with your interests or campaigns.<br><br></td></tr>
<tr><td><img src="https://i.imgur.com/HlMyUKi.png" width="250"></td><td><strong>YouTube Monitor</strong> (coming soon)<br><br>A scheduled, stateful monitoring tool that tracks specified YouTube metrics over time, generates trend-based insights and reports, and raises alerts when user-defined thresholds or anomalies are detected — ideal for proactive channel health and competitor tracking.<br><br></td></tr>
</table>

All of our YouTube tools use Apify’s innovative Pay per Event (PPE) pricing model, so you only pay for the data you choose to collect. When multiple scrapers offer overlapping features, pricing remains consistent across tools, ensuring you always get the best value. Users on premium Apify plans also benefit from progressive discounts through Apify’s tiered pricing scheme.

# Changelog

This Actor's version history is a separate document: https://apify.com/ultimate/youtube-comments-scraper/changelog.md

# Actor input Schema

## `urls` (type: `array`):

The URLs of the YouTube video pages that you want to scrape comments for or other YouTube pages that you want to crawl to discover videos.

## `maxChannelVideos` (type: `integer`):

The maximum number of videos to be retrieved while crawling each target channel. Each video will be subsequently scraped to retrieve its comments.

## `maxVideoComments` (type: `integer`):

The maximum number of viewer comments to be retrieved while scraping each target video.

## `maxCommentReplies` (type: `integer`):

The maximum number of replies to be retrieved while scraping each target viewer comment.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/@Apify"
  ],
  "maxChannelVideos": 5,
  "maxVideoComments": 10,
  "maxCommentReplies": 0
}
```

# 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 = {
    "urls": [
        "https://www.youtube.com/@Apify"
    ],
    "maxChannelVideos": 5,
    "maxVideoComments": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("ultimate/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 = {
    "urls": ["https://www.youtube.com/@Apify"],
    "maxChannelVideos": 5,
    "maxVideoComments": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("ultimate/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 '{
  "urls": [
    "https://www.youtube.com/@Apify"
  ],
  "maxChannelVideos": 5,
  "maxVideoComments": 10
}' |
apify call ultimate/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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