# YouTube Comments Scraper API — Export Comments & Replies (`yugenox/youtube-comments-scraper`) Actor

YouTube comments scraper and API: export comments and replies from a video, Short, channel or search. One flat row per comment: text, author, likes, reply count, date, pinned and creator-heart flags. Top or newest. Comments your keyword or date filters remove are not charged. No login, no API key.

- **URL**: https://apify.com/yugenox/youtube-comments-scraper.md
- **Developed by:** [Yugenox Corp](https://apify.com/yugenox) (community)
- **Categories:** Social media, Videos, For creators
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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 Comments & Replies

Export YouTube comments to a spreadsheet, JSON or your own app. Paste any video or Shorts link (or a channel, or a search term) and get **one row per comment** — and, if you want, one row per reply — with the comment text, author, likes, reply count, date, and the pinned / creator-heart flags. Top comments or newest first. No login, no YouTube API key, no quota.

### What does YouTube Comments Scraper do?

- **Extracts every comment** from public YouTube videos, Shorts and live-stream replays — top comments (YouTube's default order) or newest first.
- **Exports replies too**: each reply is its own row, linked to its parent comment with `parentCommentId`, so threads are easy to rebuild.
- **Works from a channel or a search**: give a channel (`@mkbhd`) and it takes the latest videos; give a search term and it takes the top results — then exports their comments.
- **Filters before you pay**: keep only comments containing your keywords, or only comments newer than a date. Comments you filter out are not charged.
- **Flat, analysis-ready rows** — no nested arrays, so a video with 50,000 comments exports cleanly to CSV, Excel, Google Sheets or a database.

### Use cases

- **Sentiment analysis & audience research** — what viewers love, hate and ask about, at scale.
- **Product feedback mining** — find every comment mentioning a feature, a price or a bug on review videos.
- **Brand & community monitoring** — track what is said under your videos, your competitors' videos, or a whole niche.
- **Creator analytics** — top comments, pinned comments, creator replies and hearts, engagement per comment.
- **Training and research datasets** — clean comment text with dates and like counts.

### How to use it

1. Paste one or more **YouTube video URLs** (watch, youtu.be, Shorts, embed or live links all work) — or fill in **Channel** or **Search term**.
2. Choose **Max comments per video**, **Sort** (Top or Newest) and whether to **Include replies**.
3. Optional: add **keywords** and a **Newer than** date.
4. Click **Start** and download your comments as JSON, CSV, Excel or HTML, or read them through the Apify API.

### Input

| Field | What it does |
|---|---|
| `videoUrls` | Video links or IDs: `youtube.com/watch?v=…`, `youtu.be/…`, `youtube.com/shorts/…` |
| `channelUrl` | Optional channel link, `@handle` or channel ID — takes its latest videos |
| `searchTerm` | Optional search — takes the top results |
| `maxVideos` | Videos per channel / search (default 10) |
| `maxCommentsPerVideo` | Top-level comments per video (default 100, 0 = all) |
| `sort` | `top` (default) or `newest` |
| `includeReplies` / `maxRepliesPerComment` | Replies as their own rows (default off / 10 per comment, 0 = all) |
| `keywords` | Keep only comments containing any of these words |
| `newerThan` | Keep only comments newer than a date (`2026-10-01`) or an age (`7 days`, `3 months`) |
| `maxItems` | Maximum rows for the whole run (default 1,000) — you are never charged for more |

Example:

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "maxCommentsPerVideo": 200,
  "sort": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 20
}
```

### Output

One row per comment (trimmed real row):

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "commentId": "UgyyEqaBXOKgoi4cf7l4AaABAg",
  "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgyyEqaBXOKgoi4cf7l4AaABAg",
  "isReply": false,
  "parentCommentId": null,
  "text": "Ok let’s be honest here\nRick rolling is the one meme that will never die",
  "author": "@JetpackGamer456",
  "authorIsChannelOwner": false,
  "likeCount": 428000,
  "replyCount": 768,
  "publishedTimeText": "6 years ago (edited)",
  "publishedAtApprox": "2020-11-06T21:20:14.164Z",
  "publishedAtPrecision": "year",
  "isEdited": true,
  "isPinned": false,
  "isHeartedByCreator": false,
  "position": 2,
  "sort": "top",
  "videoCommentCount": 2461404,
  "source": "https://youtu.be/dQw4w9WgXcQ",
  "scrapedAt": "2026-11-07T08:15:25.920Z"
}
```

Also in every row: `channelUrl`, `authorChannelId`, `authorChannelUrl`, `authorIsVerified`, `authorIsArtist`. Replies have `isReply: true` and `parentCommentId` set.

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

Pay only for what you get:

- **$0.80 per 1,000 comments** ($0.0008 per comment or reply saved)
- **$0.0005 per video** whose comments were read (videos that are private, removed or don't exist are free)
- **$0.002 per run** start fee

So 1,000 comments from one video cost about **$0.80**; 100 comments from each of 10 videos about **$0.81**. Comments dropped by your keyword or date filters are never charged, and the run never charges more than **Max comments in total**.

### Tips

- **Only want fresh reactions?** Use Sort = Newest with Newer than = `7 days`: reading stops at the first older comment, so it is fast and cheap.
- **Monitoring a channel?** Put the channel in **Channel**, set Max videos to 5 and schedule the run daily.
- **Large exports**: set Max comments per video to 0 for all comments; raise the run's Timeout for videos with hundreds of thousands of comments.
- YouTube shows comment dates as "3 weeks ago", so `publishedAtApprox` is approximate — `publishedAtPrecision` tells you how precise (day, month or year).
- Like counts above 1,000 are rounded by YouTube itself ("428K").
- A comment with no written text (for example, only an image) has an empty `text`; the rest of its row (author, likes, replies, date) is filled in as usual.

### FAQ

**Is it legal to scrape YouTube comments?**
This actor reads only public comments that anyone can see on youtube.com without signing in. It does not log in, does not use cookies from any account and does not get around any access control. Scraping public data is generally lawful, but how you use it matters: if your dataset includes personal data (such as commenters' display names), privacy laws like the GDPR or CCPA may apply. Use the data for legitimate purposes and consult a lawyer if unsure.

**Does it access any private data?**
No. Only public comments on public videos. Private and unlisted-only data, members-only comments and anything behind a sign-in are never accessed. E-mail addresses and phone numbers that people type into comments are masked in the output.

**Do I need a YouTube API key or a Google account?**
No. There is no quota and nothing to set up.

**Can I get comments from YouTube Shorts?**
Yes — paste the Shorts link (`youtube.com/shorts/…`).

**Why did I get fewer comments than the video's comment count?**
YouTube's count includes replies and comments that were later deleted or held for review. Turn on Include replies to get the replies as rows too.

**What if comments are turned off?**
The run says so in its status message and moves on to the next video.

**Can I export to CSV or Excel?**
Yes — every row is flat, so the dataset downloads straight into CSV, Excel, JSON, XML or HTML.

# Actor input Schema

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

Videos to export comments from. Any YouTube link works: youtube.com/watch?v=…, youtu.be/…, youtube.com/shorts/…, embed and live links, or a bare 11-character video ID. Channel links pasted here are treated like the Channel field.

## `channelUrl` (type: `string`):

Optional: a channel link, @handle or UC… channel ID, e.g. "@mkbhd" or "https://www.youtube.com/@mkbhd". The run takes the channel's latest videos (see Max videos) and exports their comments.

## `searchTerm` (type: `string`):

Optional: search YouTube for this term and export the comments of the top results (see Max videos), e.g. "iphone 17 review".

## `maxVideos` (type: `integer`):

How many videos to take from the channel (newest first) or from the search results (most relevant first). Pasted video URLs are always all read.

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

Maximum top-level comments saved per video (replies are counted separately, see below). 0 = all comments.

## `sort` (type: `string`):

Top comments (YouTube's default order: most liked / most relevant first) or Newest first.

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

Also export the replies under each comment. Every reply is its own row, with parentCommentId pointing at the comment it answers.

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

Maximum replies saved under each comment when Include replies is on. 0 = all replies.

## `keywords` (type: `array`):

Optional: keep only comments (and replies) that contain at least one of these words or phrases (case-insensitive), e.g. "price", "battery". Comments that don't match are skipped and NOT charged.

## `newerThan` (type: `string`):

Optional: a date (2026-10-01) or an age ("7 days", "3 months", "1 year"). YouTube shows comment dates as "3 weeks ago", so a comment is dropped only when it is definitely older. With Newest first, reading a video stops at the first older comment. Dropped comments are not charged.

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

Maximum rows (comments + replies) for the whole run. You are never charged for more than this. 0 = no limit.

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

Apify Proxy (datacenter) is used by default and comes with every Apify plan, including the free one. You can also paste your own proxy URLs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxVideos": 10,
  "maxCommentsPerVideo": 20,
  "sort": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped comments and replies.

## `run` (type: `string`):

Status and statistics for this run.

## `report` (type: `string`):

RUN_REPORT: how the run ended, counts, requests and proxy use.

# 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,
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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