# YouTube Comments & Replies Scraper (`automly/youtube-comments-replies-scraper`) Actor

Scrape YouTube comments and replies from any public video: comment text, author, channel ID, likes, reply count, date and reply threads. No login or API key. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/automly/youtube-comments-replies-scraper.md
- **Developed by:** [Automly](https://apify.com/automly) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.29 / 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 & Replies Scraper

### What is YouTube Comments & Replies Scraper?

**YouTube Comments & Replies Scraper** lets you **scrape the comments and replies of any public YouTube video or Short**. Paste video links, click **Start**, and download every comment with its author, likes, reply count, date and the full reply thread as Excel, CSV or JSON.

- 💬 **Comments and replies:** top-level comments plus the replies under them, each reply linked to its parent comment
- 🔝 **Top or newest:** sort as YouTube does, by top comments or newest first
- 📊 **Spreadsheet-ready:** one flat row per comment or reply
- 🔓 **No login:** no YouTube account, cookies or API key needed, and no daily quota

### What can YouTube Comments & Replies Scraper do?

- Scrape **up to 10,000 comments per video**, for as many videos as you like in one run
- Expand **reply threads** under each comment, with a limit you choose
- Get the newest comments first to **monitor a video's comment section** on a schedule
- Work with regular videos, **Shorts**, `youtu.be` short links and plain video IDs
- Export to Excel, CSV, JSON, HTML or XML, or send the results to Google Sheets, Make, Zapier and more

### What data can you extract from YouTube comments?

| | | |
|---|---|---|
| 💬 Comment text | 👤 Author handle | 🆔 Author channel ID |
| 👍 Likes | 🔁 Number of replies | ↪️ Parent comment (for replies) |
| 🕒 When it was posted | ✏️ Edited or not | 🎬 Video ID and link |

### How to scrape YouTube comments

1. [Create a free Apify account](https://console.apify.com/sign-up) (no credit card needed).
2. Open **YouTube Comments & Replies Scraper**.
3. Paste one or more YouTube video links.
4. Choose how many comments and replies you want per video.
5. Click **Start**, and download the comments when the run finishes.

### ⬇️ Input

| Setting | What it does |
|---|---|
| Video URLs or IDs | Links to YouTube videos or Shorts, or bare 11-character video IDs |
| Max comments per video | How many top-level comments to scrape from each video (up to 10,000) |
| Include replies | Also scrape the replies under each comment |
| Max replies per comment | How many replies to scrape under each comment (up to 1,000) |
| Sort comments by | **Top comments** or **Newest first** |
| Language | Language for YouTube's labels, such as the "2 days ago" text. Comments are never translated |

Example:

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/9bZkp7q19f0"
  ],
  "maxCommentsPerVideo": 500,
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "sortBy": "top"
}
```

Replies come on top of the comment limit: 500 comments with up to 20 replies each can give you up to 10,500 rows.

### ⬆️ Output

You get one row per comment or reply. Replies have `isReply: true` and `parentCommentId` set to the comment they answer.

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "commentId": "Ugzge340dBgB75hWBm54AaABAg",
  "parentCommentId": null,
  "authorName": "@YouTube",
  "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
  "text": "can confirm: he never gave us up",
  "likeCount": 320000,
  "publishedAt": "2025-09-27T12:33:51+00:00",
  "publishedTimeText": "1 year ago",
  "isEdited": false,
  "replyCount": 963,
  "isReply": false,
  "sortBy": "top",
  "fetchedAt": "2026-09-27T12:33:48+00:00"
}
```

Each run also saves a short report (`OUTPUT` in the key-value store) with the number of rows and any video that could not be read, with the reason.

### How can I use YouTube comment data?

- **Sentiment analysis:** see how viewers react to a product launch, trailer or ad
- **Audience research:** find the questions and pain points your audience writes about
- **Brand monitoring:** track what people say about your brand in comments on creators' videos
- **Content ideas:** mine the most-liked comments and replies for topics people want to see
- **Community management:** export new comments on your own videos on a schedule
- **Training data:** collect real conversation threads for classification or AI models

### ❓FAQ

#### How much does it cost to scrape YouTube comments?

You pay per comment or reply you get. See the **Pricing** tab for the current price. Every Apify account gets $5 of free usage each month, so you can try it at no cost.

#### How many comments can I get from one video?

Up to 10,000 top-level comments per video, plus up to 1,000 replies under each. You get as many as the video shows publicly; YouTube does not show comments that were held for review or removed.

#### Why are the dates approximate?

YouTube shows comment dates only as "2 days ago" or "1 year ago". You get that text in `publishedTimeText`, and `publishedAt` turns it into a date and time you can sort and filter. The older the comment, the less exact the date.

#### Why are like counts rounded?

YouTube shows likes above 1,000 rounded, such as "1.2K". You get them as numbers (1200) so you can sort them.

#### Can I scrape comments from YouTube Shorts?

Yes. Paste the Shorts link (`https://www.youtube.com/shorts/...`) like any other video.

#### What happens if a video has comments turned off?

The run skips it and carries on with the other videos. A video that does not exist or cannot be read is listed in the run's report with the reason.

#### Do I need a YouTube account or API key?

No. You don't need a YouTube account, cookies or a YouTube Data API key.

#### Is it legal to scrape YouTube comments?

This scraper only collects comments that anyone can see on YouTube without signing in. Comments can still contain personal data, which may be protected by laws such as GDPR, so only scrape it for a legitimate reason and ask a lawyer if you are unsure. You can read more in [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

YouTube Comments & Replies Scraper is an independent tool. It is not affiliated with, endorsed by or sponsored by YouTube or Google.

#### Something isn't working. What should I do?

Open the **Issues** tab and tell us the video link and what you expected. We usually reply within a day.

# Actor input Schema

## `videoUrls` (type: `array`):

Links to YouTube videos or Shorts, or bare 11-character video IDs, e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ or https://youtu.be/dQw4w9WgXcQ.

## `maxCommentsPerVideo` (type: `integer`):

How many top-level comments to scrape from each video (up to 10,000). Replies are added on top of this and set by 'Max replies per comment'.

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

Also scrape the replies under each comment.

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

How many replies to scrape under each comment (0 to 1,000). Ignored when 'Include replies' is off.

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

Top comments (as YouTube ranks them) or newest first.

## `language` (type: `string`):

Language for YouTube's labels, such as the 'x days ago' text, e.g. en, es, de. Comments are never translated.

## `proxyConfiguration` (type: `object`):

Proxy settings. The default works for most runs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 20,
  "includeReplies": true,
  "maxRepliesPerComment": 5,
  "sortBy": "top",
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `records` (type: `string`):

All comments and replies produced by this run.

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

Dataset presented using the dataset schema overview view.

# 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "maxCommentsPerVideo": 20,
    "maxRepliesPerComment": 5,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("automly/youtube-comments-replies-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 = {
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "maxCommentsPerVideo": 20,
    "maxRepliesPerComment": 5,
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automly/youtube-comments-replies-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/NPPeYdyM0kQkgYvUr/builds/FrAcW1I8yeiaE2xx1/openapi.json
