# Cheapest YouTube Comment Scraper (`epicscrapers/youtube-comments-scraper`) Actor

\[$0.5/1000] ✨ Cheapest YouTube Comment Scraper API. Get instant results and export to JSON/CSV. Useful for sentiment analysis and research.

- **URL**: https://apify.com/epicscrapers/youtube-comments-scraper.md
- **Developed by:** [Epic Scrapers](https://apify.com/epicscrapers) (community)
- **Categories:** Social media, Videos, Automation
- **Features:** Limited permissions
- **Stats:** 13 total users, 3 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.40 / 1,000 comments

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: export video comments and replies to CSV, JSON or Excel

YouTube Comments Scraper turns YouTube video URLs into a spreadsheet of comments. Each row is one comment or reply with its text, like count, author name and channel link, post time and the video it came from. It is built for creators, brand and community managers, researchers and ML teams who need comment data without the YouTube Data API quota.

- **Replies included.** Top-level comments and replies come in one dataset. `parent` is `root` for a top-level comment, otherwise the ID of the comment it answers.
- **Top or newest.** Set `sortCommentsBy` to `top` for the most engaged comments or `new` for the latest discussion.
- **You set the volume.** `maxCommentsPerUrl` limits comments per video. Use `0` to collect all of them.
- **Many videos per run.** Add as many video URLs as you like. Every row carries `video_id`, `video_url` and `video_title`.
- **Pay per comment, no login.** No API key or YouTube account. Prices drop with higher Apify plans. Export to JSON, CSV, Excel or Google Sheets.

**Scope:** This Actor collects comments from videos you name. For transcripts use [YouTube Transcript Scraper](https://apify.com/epicscrapers/youtube-transcript-scraper). For thumbnails use [YouTube Thumbnail Downloader](https://apify.com/epicscrapers/youtube-thumbnail-downloader) or [YouTube Thumbnail Search Scraper](https://apify.com/epicscrapers/youtube-thumbnail-search-scraper).

### What can you do with YouTube Comments Scraper?

| Goal                          | How                                                                                           |
| ----------------------------- | --------------------------------------------------------------------------------------------- |
| Sentiment analysis            | Run `text` through a classifier and weight by `like_count`.                                   |
| Find the best comments        | Sort by `like_count`, or collect with `sortCommentsBy: "top"`.                                |
| Monitor new feedback          | Schedule runs with `sortCommentsBy: "new"` and sort on `timestamp`.                           |
| Rebuild conversations         | Group rows by `parent` to reconstruct reply threads.                                          |
| Spot creator replies          | Filter `author_is_uploader` and `author_is_verified`.                                         |
| Find engaged commenters       | Count comments per `author_id` and open `author_url`.                                         |
| Build text datasets for LLMs  | Export `text` with `video_title` as context. Combine with video transcripts from [YouTube Transcript Scraper](https://apify.com/epicscrapers/youtube-transcript-scraper) or pages from [Webpage to Markdown](https://apify.com/epicscrapers/webpage-to-markdown). |

### How it compares

| What you need           | YouTube Comments Scraper         | YouTube Data API            | Manual copy-paste |
| ----------------------- | -------------------------------- | --------------------------- | ----------------- |
| Setup                   | Paste URLs                       | Google project, API key     | None              |
| Daily limits            | None set by the Actor            | Daily quota units           | Your time         |
| Replies                 | Included, linked by `parent`     | Extra calls                 | Click each thread |
| Export                  | JSON, CSV, Excel, API            | Build it yourself           | Manual            |
| Cost                    | Pay per comment                  | Free within quota           | Free              |

### Quick start

1. Click **Try for free** and sign in to Apify.
2. Add video URLs to **Start URLs**.
3. For a first run, set **Max Comments** to `20`.
4. Click **Start**, then export from the **Output** tab.

### Input

```json
{
    "startUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "sortCommentsBy": "top",
    "maxCommentsPerUrl": 100,
    "maxRepliesPerComment": 5
}
```

| Field                  | Type             | Default  | Effect                                                       |
| ---------------------- | ---------------- | -------- | ------------------------------------------------------------ |
| `startUrls`            | Array of strings | Required | YouTube video URLs (watch, youtu.be, Shorts, live) or IDs.   |
| `sortCommentsBy`       | String           | `"top"`  | `"top"` or `"new"`.                                          |
| `maxCommentsPerUrl`    | Integer          | `100`    | Maximum comments per video, replies included. `0` means all. |
| `maxRepliesPerComment` | Integer          | `5`      | Maximum replies under each comment. `0` skips replies.       |

### Output

```json
{
    "id": "Ugzge340dBgB75hWBm54AaABAg",
    "parent": "root",
    "text": "can confirm: he never gave us up",
    "like_count": 238000,
    "author_id": "UCBR8-60-B28hp2BmDPdntcQ",
    "author": "@YouTube",
    "author_thumbnail": "https://yt3.ggpht.com/...",
    "author_is_uploader": false,
    "author_is_verified": true,
    "author_url": "https://www.youtube.com/@YouTube",
    "is_favorited": true,
    "_time_text": "1 year ago",
    "timestamp": 1747180800,
    "video_id": "dQw4w9WgXcQ",
    "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "video_title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)"
}
```

Notes: `timestamp` is a Unix time in seconds and can be `null`. `_time_text` is a relative label for display, so sort on `timestamp`. `video_url` is the URL you supplied. `is_favorited` means the video owner hearted or favorited the comment. Missing values are `null`.

### Monitor YouTube comments over time with scheduled runs

Apify can run the Actor for you on a schedule and send the results wherever you need them.

#### 1. Save your input as a task

Open the Actor, set your video URLs and options, then click **Save as a new task**. A task is a saved input you can run again with one click or on a schedule.

#### 2. Schedule the task

In Apify Console, go to **Schedules**, click **Create new**, choose how often to run (for example daily at 06:00 in your time zone), and add your task. See [Schedules](https://docs.apify.com/platform/schedules) and [How to create a schedule](https://help.apify.com/en/articles/7120817-how-to-create-a-schedule).

Watch how to schedule an Actor:

https://www.youtube.com/watch?v=1jI7WcVQmwM

Or schedule a saved task:

https://www.youtube.com/watch?v=GRFW_Loo2dk

Common schedules:

| Use case | Frequency | Cron expression |
| -------- | --------- | --------------- |
| Moderation and brand monitoring (`new` sort) | Daily | `0 6 * * *` |
| Launch week feedback | Every 6 hours | `0 */6 * * *` |
| Weekly sentiment report | Weekly (Monday) | `0 6 * * 1` |

#### 3. Send the results to a spreadsheet

Connect Google in the task's **Integrations** tab to save every run to Google Sheets or Google Drive automatically:

https://www.youtube.com/watch?v=IFTeKdj6ZGM

#### 4. Compare runs

Every row has `id`, `video_id` and `timestamp`, so runs are easy to join:

- **New comments:** keep `id`s you have not seen before, or filter `timestamp` after your last run.
- **Engagement growth:** `like_count` per `id` over time.
- **Sentiment trend:** average sentiment of `text` per `video_id` and week.
- **Creator activity:** new rows with `author_is_uploader` set to `true`.

### FAQ

#### How many comments can I get?

Set `maxCommentsPerUrl` to `0` for all comments. Very large videos take longer and cost more, so start with a limit or set a maximum cost per run.

#### Does it include replies?

Yes. Replies are rows whose `parent` is another comment's `id`. They count toward `maxCommentsPerUrl`. `maxRepliesPerComment` (default `5`) caps replies under each comment so one long thread doesn't use up the limit; set it to `0` for top-level comments only, or raise it for full threads.

#### Why are there no results for a video?

Comments may be disabled, or the video may be private or unavailable. The Actor logs the reason, moves to the next URL and lists failed videos in the run's status message. Channel, playlist and search URLs are skipped; add the video URLs instead.

#### Do I need an API key or login?

No. The Actor uses Apify's residential proxies for you.

#### Can I scrape a whole channel?

No, it takes video URLs. Collect the URLs you want and paste them in.

#### Is it legal?

It reads publicly visible comments. You are responsible for complying with YouTube's terms and privacy laws such as GDPR when you store or analyze personal data.

### Cost

Pay per event: one comment is one event, plus Apify's start event. Comment prices by plan are $0.001 (Free), $0.0005 (Bronze) and $0.0004 (Silver and above), so $1, $0.50 and $0.40 per 1,000 comments. The start event is $0.01 per GB of memory, at least one. Check the **Pricing** tab for the current prices.

| Comments | Free plan | Bronze plan |
| -------- | --------- | ----------- |
| 1,000    | $1.01     | $0.51       |
| 10,000   | $10.01    | $5.01       |

### Related Actors

- [YouTube Transcript Scraper](https://apify.com/epicscrapers/youtube-transcript-scraper): captions and AI transcripts.
- [YouTube Thumbnail Downloader](https://apify.com/epicscrapers/youtube-thumbnail-downloader): download video thumbnails.
- [YouTube Thumbnail Search Scraper](https://apify.com/epicscrapers/youtube-thumbnail-search-scraper): thumbnails from YouTube searches.
- [Webpage to Markdown](https://apify.com/epicscrapers/webpage-to-markdown): web pages as clean Markdown for LLM pipelines.

### Support

Found a problem? Open an issue in the **Issues** tab and include the run ID and your input.

This Actor is not affiliated with, endorsed by or sponsored by YouTube or Google. YouTube is a trademark of Google LLC.

# Actor input Schema

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

YouTube video URLs (watch, youtu.be, Shorts, live or embed links) or 11-character video IDs. Channel, playlist and search URLs are skipped.

## `sortCommentsBy` (type: `string`):

Order in which YouTube returns comments.

## `maxCommentsPerUrl` (type: `integer`):

Maximum comments per video, counting top-level comments and replies. Enter 0 to scrape all comments.

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

Maximum replies to scrape under each top-level comment. Enter 0 to skip replies. Replies count toward Max Comments.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "sortCommentsBy": "top",
  "maxCommentsPerUrl": 100,
  "maxRepliesPerComment": 5
}
```

# 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": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "maxCommentsPerUrl": 100,
    "maxRepliesPerComment": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("epicscrapers/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": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "maxCommentsPerUrl": 100,
    "maxRepliesPerComment": 5,
}

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

```

## MCP server setup

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