# YouTube Comments Scraper — Author, Likes, Replies & Text (`haketa/youtube-comments-scraper`) Actor

Scrape all comments from any YouTube video, channel or search in bulk. Get comment text, author, verified/creator flags, like count, reply count and timestamp — plus video title and channel. Fast, keyless YouTube comment export for research and sentiment analysis.

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

## Pricing

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

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 — Bulk Video, Channel & Keyword Comment Extractor

> **Extract thousands of YouTube comments in bulk from any video URL, channel handle, or search keyword.** Pull complete top-level comment threads with **author display name, channel ID, verified/creator badges, full comment text, numeric like count, reply count, relative timestamp, and parent video metadata** — structured for sentiment analysis, audience intelligence, content strategy, competitor benchmarking, and social listening. No YouTube Data API key, no Google Cloud quota limits, and no account login required.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-00C853?style=flat-square\&logo=apify)](https://apify.com/haketa/youtube-comments-scraper)
[![Keyless Extraction](https://img.shields.io/badge/Auth-No%20API%20Key%20Required-blue?style=flat-square)]()
[![Deep Pagination](https://img.shields.io/badge/Scale-1%2C000%2B%20Comments%20Pagination-orange?style=flat-square)]()
[![Data Formats](https://img.shields.io/badge/Export-JSON%20%7C%20CSV%20%7C%20Excel%20%7C%20API-purple?style=flat-square)]()
[![Live Data](https://img.shields.io/badge/Data-Real--Time%20Extraction-success?style=flat-square)]()

***

### ⚡ At a glance

| Capability | Details |
| --- | --- |
| **Target Platform** | [YouTube](https://www.youtube.com) (`youtube.com`, `youtu.be`, YouTube Shorts, `@channels`) |
| **Input Modes** | Topic dropdowns · Custom search keywords · Video URLs / 11-char IDs · Channel URLs / `@handles` |
| **Extracted Entities** | Comment text · Author name & channel ID · Verified & creator flags · Likes · Replies · Video context |
| **Sort Modes** | **Top comments** (highest engagement first) · **Newest first** (chronological real-time stream) |
| **Pagination & Scale** | Automatic deep continuation pagination — **1,000 to 100,000+ comments** per video or across multi-video searches |
| **Deduplication** | Built-in per-video and global deduplication by unique `commentId` (0% duplicate records) |
| **Authentication** | None required — 100% keyless public data extraction |
| **Export Formats** | JSON, JSONL, CSV, Excel (XLSX), XML, HTML Table, REST API, Webhooks |

***

### 🔎 Why scrape YouTube comments?

YouTube comment sections are the largest unfiltered focus group on the internet. Every product review, software tutorial, movie trailer, keynote broadcast, and competitor launch generates thousands of candid viewer reactions — questions, feature requests, bug reports, price objections, praise, and comparisons written in the audience's own language.

However, getting that **YouTube comment data** into a spreadsheet or analytics pipeline is notoriously difficult:

- **Infinite scroll traps data in the UI:** YouTube loads only ~20 comments at a time as you scroll manually, with no native export button.
- **Official API quota walls:** The YouTube Data API v3 requires a Google Cloud project, credential management, and strict daily unit quotas that quickly run out when collecting thousands of comments across channels.
- **Messy engagement numbers:** Abbreviated counters (`1.2K`, `220K`) and unlinked comment rows make downstream quantitative analysis painful without normalization.

This **YouTube comments scraper** solves all three problems. Point it at specific videos, entire `@channels`, or broad search keywords, and it automatically paginates through YouTube's comment feed, normalizes abbreviated like counts into clean integers alongside display text, attaches the parent video's title, channel, and view count to every single row, and exports an analysis-ready dataset in seconds.

***

### ✨ Key features of this YouTube data extractor

- 🎯 **Four flexible targeting modes in one actor:**
  1. **Popular Topics Dropdown:** Instant one-click presets (`iphone review`, `ai explained`, `world news`, `gaming`, `stock market`, `tech unboxing`, etc.).
  2. **Custom Search Keywords:** Discover trending videos for any brand, product, or niche query and extract their comments automatically.
  3. **Direct Video URLs & IDs:** Paste standard watch links (`youtube.com/watch?v=...`), short links (`youtu.be/...`), `/shorts/` links, or raw 11-character video IDs.
  4. **Channel URLs & Handles:** Pass `@mkbhd`, `youtube.com/@channel`, or `UC...` channel IDs to scrape comments across a creator's latest uploads.
- 🔄 **Unlocked 1,000+ deep pagination:** Follows continuation tokens page after page to extract hundreds or thousands of comments per video (`maxCommentsPerVideo` up to `100,000`) and scales across up to `10,000` videos per search source.
- 📊 **Normalized numeric & display metrics:** Converts shorthand counts like `220K` into exact numeric strings (`"220000"`) while preserving `likeCountText` (`"220K"`), and normalizes blank zero-like states to `"0"`.
- 👤 **Author & influencer signals:** Captures `author`, `authorChannelId` (`UC...`), `authorIsVerified` (`"true"`/`"false"`), and `authorIsCreator` (`"true"`/`"false"`) to spotlight verified voices and creator replies.
- 🎬 **Self-contained video context on every row:** When `includeVideoDetails` is enabled (default), every comment includes `videoId`, `videoUrl`, `videoTitle`, `channel`, and `videoViewCount` so exported CSVs and BI tables never lose context.
- ⚡ **High-speed parallel execution:** Configurable `maxConcurrency` (1–15 parallel video workers) with automatic IP rotation via Apify Proxy.

***

### 🎯 High-value use cases & B2B intelligence

#### 1. Brand Sentiment & Product Launch Monitoring

Track consumer reaction under hands-on reviews, unboxings, and comparison videos for your brand and your competitors. Measure positive vs. negative sentiment shifts within hours of a product release.

#### 2. Voice-of-Customer (VoC) & Feature Discovery

Mine thousands of viewer comments under category-leading tutorials and reviews to uncover recurring pain points, unmet customer needs, buyer objections, and exact phrasing for ad copy.

#### 3. Content Strategy & Video Topic Ideation

Filter comments containing question marks (`?`, `"how do you"`, `"can you make"`, `"part 2"`) sorted by highest `likeCount` to build a data-backed content calendar that answers what viewers are actively asking for.

#### 4. Influencer Vetting & Sponsorship Due Diligence

Before sponsoring a YouTube creator, scrape the last 20 videos on their channel (`channelUrls`) to audit real audience engagement, detect bot/spam comment patterns, and verify buyer intent in their community.

#### 5. AI, LLM & NLP Dataset Construction

Build large-scale, multi-topic conversational corpora labeled with engagement weights (`likeCount`, `replyCount`) and timestamp metadata for training sentiment classifiers, topic models, and summarization pipelines.

#### 6. Community Management & Crisis Auditing

Export complete comment logs from your organization's official YouTube channel or campaign videos for compliance archiving, moderation audits, and rapid FAQ response workflows.

***

### 📥 Input configuration

All input fields are optional. Running the actor with default/empty settings automatically collects a fast, diverse sample across trending topics.

| Parameter | Type | Default / Prefill | Description |
| --- | --- | --- | --- |
| `topics` | `array<string>` | Prefill: `["iphone review"]` | Select one or more curated topic presets from the dropdown to discover top videos and scrape their comments automatically. |
| `searchKeywords` | `array<string>` | Prefill: `["iphone 16 review"]` | Custom search queries in your own words (e.g., `"tesla model y review"`, `"notion tutorial"`). |
| `videoUrls` | `array<string>` | `[]` | Specific YouTube watch URLs, `youtu.be` links, `/shorts/` URLs, or 11-character video IDs. |
| `channelUrls` | `array<string>` | `[]` | Channel URLs, `@handles` (e.g., `@veritasium`), or `UC...` channel IDs to scrape comments from recent uploads. |
| `sortBy` | `string` | `"top"` | Sort order for comments: `"top"` (Most popular / highest engagement) or `"newest"` (Newest first). |
| `includeVideoDetails` | `boolean` | `true` | Attach `videoTitle`, `channel`, and `videoViewCount` to every comment record. |
| `maxCommentsPerVideo` | `integer` | Default `100` (Prefill `50`) | Maximum top-level comments to extract per video (`1` to `100,000`). Set to `1000+` for deep per-video pulls. |
| `maxVideosPerSource` | `integer` | Default `20` (Prefill `2`) | Maximum videos to discover per topic, search keyword, or channel (`1` to `10,000`). |
| `maxComments` | `integer` | Default `0` (Prefill `100`) | Optional global cap across the entire run. `0` = unlimited (governed by `maxCommentsPerVideo` × videos). |
| `maxConcurrency` | `integer` | `5` | Number of videos processed in parallel (`1` to `15`). |
| `proxyConfiguration` | `object` | `{ "useApifyProxy": true }` | Apify Proxy configuration. Enabled by default to rotate IPs and prevent rate-limiting on large runs. |

***

### 🛠️ Input recipes & examples

#### Recipe 1: Deep 1,000+ comment extraction from specific videos

Extract up to 2,500 top comments per video from specific YouTube URLs or IDs:

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/arj7oStGLkU"
  ],
  "sortBy": "top",
  "includeVideoDetails": true,
  "maxCommentsPerVideo": 2500,
  "maxComments": 5000
}
```

#### Recipe 2: Channel-wide audience audit (`@handle`)

Pull the 200 newest comments across each of the latest 15 videos from a target channel (3,000 comments total):

```json
{
  "channelUrls": ["@mkbhd"],
  "sortBy": "newest",
  "includeVideoDetails": true,
  "maxVideosPerSource": 15,
  "maxCommentsPerVideo": 200,
  "maxComments": 3000,
  "maxConcurrency": 5
}
```

#### Recipe 3: Multi-keyword market & competitor research

Discover 25 videos per search query and collect 100 comments from each video to build a 5,000-comment market intelligence dataset:

```json
{
  "searchKeywords": [
    "iphone 16 pro review",
    "samsung galaxy s24 ultra review"
  ],
  "sortBy": "top",
  "maxVideosPerSource": 25,
  "maxCommentsPerVideo": 100,
  "maxComments": 5000,
  "maxConcurrency": 8
}
```

***

### 📤 Output schema & field reference

Every dataset item represents **one unique YouTube comment** enriched with its parent video metadata. All fields are formatted as clean strings for zero-friction compatibility with CSV, Excel, Google Sheets, and SQL pipelines.

#### 💬 Comment Content & Engagement Fields

| Field | Type | Coverage | Description |
| --- | --- | --- | --- |
| `commentId` | `string` | 🟢 High (100%) | Unique YouTube comment identifier (used as primary deduplication key). |
| `text` | `string` | 🟢 High (~100%) | Full text content of the comment with whitespace normalized. |
| `likeCount` | `string` | 🟢 High (100%) | Normalized numeric like count as an integer string (e.g., `"220000"`, `"0"`). |
| `likeCountText` | `string` | 🟢 High (100%) | Human-readable like count as displayed on YouTube (e.g., `"220K"`, `"1.4K"`, `"0"`). |
| `replyCount` | `string` | 🟢 High (100%) | Total number of replies to this top-level comment (e.g., `"612"`, `"0"`). |
| `publishedTime` | `string` | 🟢 High (100%) | Relative publication timestamp (e.g., `"2 days ago"`, `"6 years ago"`, `"3 hours ago (edited)"`). |

#### 👤 Comment Author & Badge Fields

| Field | Type | Coverage | Description |
| --- | --- | --- | --- |
| `author` | `string` | 🟢 High (100%) | Author's YouTube handle or display name (stripped of leading `@`). |
| `authorChannelId` | `string` | 🟢 High (100%) | Unique YouTube channel ID (`UC...`) of the commenter. |
| `authorIsVerified` | `string` | 🟢 High (100%) | `"true"` if the commenter holds a verified YouTube badge, otherwise `"false"`. |
| `authorIsCreator` | `string` | 🟢 High (100%) | `"true"` if the comment was posted by the video uploader/creator, otherwise `"false"`. |

#### 🎬 Parent Video Context & Metadata Fields

| Field | Type | Coverage | Description |
| --- | --- | --- | --- |
| `videoId` | `string` | 🟢 High (100%) | 11-character YouTube video ID. |
| `videoUrl` | `string` | 🟢 High (100%) | Canonical watch URL (`https://www.youtube.com/watch?v=...`). |
| `videoTitle` | `string` | 🟢 High (~99%) | Full title of the YouTube video (populated when `includeVideoDetails: true`). |
| `channel` | `string` | 🟢 High (~99%) | Name of the YouTube channel that published the video. |
| `videoViewCount` | `string` | 🟢 High (~98%) | Numeric view count of the video at scrape time (e.g., `"1832861734"`). |
| `scrapedAt` | `string` | 🟢 High (100%) | ISO-8601 UTC timestamp indicating when the comment was extracted. |
| `error` | `string` | 🟡 Conditional | Present only if a run targets a single video where comments are disabled or unavailable. |

***

### 📋 Sample JSON output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channel": "Rick Astley",
  "videoViewCount": "1832861734",
  "commentId": "Ugw10bSluCDSZMIxUSB4AaABAg",
  "author": "LK-ht7qz",
  "authorChannelId": "UCHpvHTRSILoOFKWX5oFCYDA",
  "authorIsVerified": "false",
  "authorIsCreator": "false",
  "text": "Let’s put the meme aside, this is actually a banging song.",
  "likeCount": "220000",
  "likeCountText": "220K",
  "replyCount": "612",
  "publishedTime": "6 years ago",
  "scrapedAt": "2026-11-10T02:30:00.000Z"
}
```

***

### 🔁 Pagination, scale & deduplication

YouTube serves comments in batches of ~20 items per continuation request. This actor automatically extracts and follows every continuation cursor across both **video discovery** (search results and channel video tabs) and **comment threads**:

1. **Deep Per-Video Comment Pagination:** Set `maxCommentsPerVideo: 1000` (or up to `100000`) to walk hundreds of continuation pages on high-traffic videos without hitting artificial page caps.
2. **Multi-Source Scaling:** Combine multiple `topics`, `searchKeywords`, `channelUrls`, and `videoUrls` in a single run. Set `maxComments: 0` (or `5000+`) to collect thousands of comments across dozens of videos in parallel.
3. **Strict Two-Level Deduplication:** Comments are deduplicated per video and across the entire run by `commentId`, guaranteeing **0 duplicate records** even when the same video is discovered by overlapping search keywords.

***

### 💻 API & integration examples

#### cURL — Start a run and fetch CSV output

```bash
## 1. Start the actor run
curl -X POST "https://api.apify.com/v2/acts/haketa~youtube-comments-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "videoUrls": ["dQw4w9WgXcQ"],
    "maxCommentsPerVideo": 1000,
    "sortBy": "top"
  }'

## 2. Download the dataset as CSV
curl "https://api.apify.com/v2/acts/haketa~youtube-comments-scraper/runs/last/dataset/items?token=YOUR_APIFY_TOKEN&format=csv" > youtube_comments.csv
```

#### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("haketa/youtube-comments-scraper").call(run_input={
    "searchKeywords": ["iphone 16 review"],
    "maxVideosPerSource": 10,
    "maxCommentsPerVideo": 150,
    "maxComments": 1500,
    "sortBy": "top",
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(f"Extracted {len(items)} unique YouTube comments")
```

#### Node.js (`apify-client`)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('haketa/youtube-comments-scraper').call({
    channelUrls: ['@mkbhd'],
    maxVideosPerSource: 5,
    maxCommentsPerVideo: 250,
    sortBy: 'newest',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Saved ${items.length} comments`);
```

***

### 🗂️ Built-in topic presets reference

When you want an instant dataset without hunting for URLs, select one or more presets in `topics`:

| Topic Preset Value | Category Title | Typical Videos & Comment Signals |
| --- | --- | --- |
| `iphone review` | Phone reviews | Smartphone comparisons, camera tests, battery life & buyer feedback |
| `world news` | World news | Breaking global events, geopolitical debates & public opinion |
| `nba highlights` | NBA highlights | Game recaps, player performance discussions & sports fan sentiment |
| `premier league` | Premier League | Match highlights, tactical analysis & football club reactions |
| `new music` | New music | Official music videos, lyric discussions & artist fanbase engagement |
| `gaming` | Gaming | Gameplay walkthroughs, patch notes feedback & game review threads |
| `ai explained` | AI explained | LLM tutorials, AI news, developer tool comparisons & tech ethics |
| `movie trailer` | Movie trailers | Teaser reactions, box-office predictions & casting discussions |
| `cooking recipe` | Cooking recipes | Ingredient substitutions, kitchen tips & recipe success stories |
| `travel vlog` | Travel vlogs | Destination recommendations, itinerary questions & budget breakdowns |
| `workout routine` | Workout routines | Fitness form checks, routine results & coaching questions |
| `tech unboxing` | Tech unboxing | Hardware impressions, pricing objections & feature wishlists |
| `makeup tutorial` | Makeup tutorials | Shade matches, product longevity & skincare routine questions |
| `stock market` | Stock market | Earnings reactions, macro commentary & retail investor sentiment |
| `car review` | Car reviews | Owner reliability feedback, EV range discussions & trim comparisons |
| `podcast highlights` | Podcast highlights | Long-form interview takeaways, guest debates & timestamp highlights |

***

### 🔌 Workflow automation & BI integrations

Connect your extracted **YouTube comment data** directly into your analytics and automation stack:

1. **Google Sheets & Excel Dashboards:** Schedule daily or weekly runs in the Apify Console and sync the dataset to Google Sheets to track comment velocity, top questions, and average likes per comment across product launch videos.
2. **Make, Zapier & n8n Pipelines:** Trigger a webhook as soon as a run finishes (`ACTOR.RUN.SUCCEEDED`), filter for comments with `Number(likeCount) >= 50` or `authorIsVerified == "true"`, and post summaries to **Slack, Microsoft Teams, Discord, or Notion**.
3. **LLM & Sentiment Classification Pipelines:** Stream JSONL records into OpenAI, Anthropic Claude, or Gemini batch pipelines to tag each comment with sentiment (`Positive`, `Neutral`, `Negative`), intent (`Bug Report`, `Feature Request`, `Competitor Mention`, `Purchase Intent`), and topic clusters.
4. **Data Warehouses (BigQuery, Snowflake, PostgreSQL):** Partition by `scrapedAt` and join on `videoId` and `commentId` to track how individual comment like counts and reply counts grow over time.

***

### 💡 Pro tips for best results

- **Choose the right sort mode:** Use `sortBy: "top"` to capture high-signal, community-validated opinions with the most likes; use `sortBy: "newest"` for real-time monitoring after a launch or live event.
- **Scale horizontally or vertically:** For broad market sentiment across a niche, use `maxVideosPerSource: 25` and `maxCommentsPerVideo: 100`. For deep analysis of a single viral video, pass its URL in `videoUrls` and set `maxCommentsPerVideo: 5000` with `maxComments: 0`.
- **Filter influential commenters downstream:** Sort or filter your exported CSV/JSON on `authorIsVerified == "true"`, `authorIsCreator == "true"`, or `Number(likeCount) >= 100` to isolate key opinion leaders.
- **Keep Apify Proxy enabled:** Default datacenter proxy rotation keeps parallel requests fast, cost-effective, and resilient against rate limits during multi-thousand-comment runs.

***

### ⚠️ Known limitations

- **Top-level comments:** The actor extracts all top-level comments along with each comment's `replyCount` metric; nested sub-thread replies under a top-level comment are not expanded individually.
- **Disabled comment sections:** Videos that have comments turned off by the uploader (or restricted as "Made for Kids") cannot yield comments. When scraping multiple videos, the actor cleanly skips disabled videos so your dataset stays 100% populated with real comments.
- **Relative timestamps:** YouTube provides relative publication strings (`"3 days ago"`, `"1 year ago"`) rather than exact ISO timestamps on public comment feeds; combine `publishedTime` with `scrapedAt` for temporal bucketing.

***

### ❓ Frequently Asked Questions

#### Do I need a YouTube Data API key or Google login?

No. This actor is 100% keyless and requires no Google Cloud project, OAuth token, or cookies.

#### How many comments can I scrape in a single run?

You can extract from `50` comments on a quick test run up to **100,000+ comments** across single or multiple videos. Set `maxComments: 0` and increase `maxCommentsPerVideo` and `maxVideosPerSource` to scale freely.

#### Does it support YouTube Shorts and `@handle` URLs?

Yes. You can pass `/shorts/` links, `youtu.be/` short links, standard watch URLs, 11-character IDs, and `@handle` channel links.

#### How fast is the scraper?

Because it uses lightweight HTTP requests with parallel video concurrency (`maxConcurrency`), a typical run of 100–600 comments completes in **10 to 25 seconds**, and 1,000+ comments typically finish in under a minute.

#### Can I combine `topics`, `searchKeywords`, `videoUrls`, and `channelUrls` in one run?

Yes! The actor merges all video sources into a single deduplicated queue, so you can pass direct video URLs alongside search terms and channel handles in the same run.

#### How does deduplication work when two search keywords find the same video?

Video IDs are deduplicated during the discovery phase (`seen` video set), and individual comments are deduplicated both per video and globally by `commentId`. Even if multiple search queries surface the same trending video, it is scraped once and produces zero duplicate comments.

#### What happens if I run the actor with completely empty input (`{}`)?

An empty run automatically seeds a curated sample of popular topics (`iphone review`, `world news`, `nba highlights`, `new music`, `gaming`, `ai explained`, `movie trailer`, `cooking recipe`) and returns ~100 fresh comments so you never get an empty dataset.

#### What export formats are available?

Export directly from the Apify Console or REST API in **JSON, JSONL, CSV, Excel (XLSX), HTML table, or XML**, or connect directly to Google Sheets, Make, Zapier, n8n, Slack, and webhooks.

***

### 🔗 Related scrapers

- [YouTube Contact Scraper](https://apify.com/haketa/youtube-contact-scraper) — Extract channel business emails, social links, and subscriber metrics.
- [Patreon Scraper](https://apify.com/haketa/patreon-scraper) — Creator tiers, patron counts, and membership earnings data.
- [Bilibili Scraper](https://apify.com/haketa/bilibili-scraper) — Video, creator, and engagement data from Bilibili.
- [Xiaohongshu / RedNote Scraper](https://apify.com/haketa/xiaohongshu-rednote-scraper) — Posts, engagement, and creator insights.
- [Linktree Scraper](https://apify.com/haketa/linktree-scraper) — Creator bio links, social profiles, and contact channels.

***

### 📋 Changelog

| Version | Date | Highlights |
| --- | --- | --- |
| **v1.2** | `2026-11` | **Unlocked 1,000+ deep pagination & global cap control:** Added `maxComments` global cap (`0` = unlimited), raised continuation pagination guards to support 1,000–100,000 comments per video and up to 10,000 videos per source, added strict cross-video `commentId` deduplication, and optimized default prefill for sub-20s execution. |
| **v1.1** | `2026-11` | Normalized zero-like whitespace strings to `"0"`, added fallback view-count extraction, and improved proxy IP rotation on watch pages. |
| **v1.0** | `2026-05` | Initial release with topic presets, keyword video discovery, channel handle support, and top/newest comment sorting. |

# Changelog

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

# Actor input Schema

## `topics` (type: `array`):

Pick one or more popular topics and we'll find trending videos and pull their comments — no links or IDs needed. Just click Start to try it.

## `searchKeywords` (type: `array`):

Type any topic in your own words to discover videos and scrape their comments, e.g. "iphone 16 review" or your brand name.

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

Return the most popular comments first, or the newest ones first.

## `includeVideoDetails` (type: `boolean`):

Add the video title, channel name and view count to each comment row.

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

How many top-level comments to collect from each video. Set to 1000+ for deep per-video comment extraction.

## `maxVideosPerSource` (type: `integer`):

How many videos to collect for each selected topic, custom search term, or channel.

## `maxComments` (type: `integer`):

Optional overall cap on total comments collected across all videos. Set to 0 for no global limit (governed by Max comments per video).

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

Optional. Paste exact YouTube video links, youtu.be links, /shorts/ links or 11-character video IDs to scrape those videos directly.

## `channelUrls` (type: `array`):

Optional. Scrape comments from the latest videos of specific channels — paste channel links, @handles or channel IDs.

## `maxConcurrency` (type: `integer`):

How many videos to process in parallel. Higher is faster but heavier.

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

Apify Proxy. On by default (datacenter) so requests rotate IPs and avoid YouTube rate limits — recommended. You can switch groups or turn it off here.

## Actor input object example

```json
{
  "topics": [
    "iphone review"
  ],
  "searchKeywords": [
    "iphone 16 review"
  ],
  "sortBy": "top",
  "includeVideoDetails": true,
  "maxCommentsPerVideo": 50,
  "maxVideosPerSource": 2,
  "maxComments": 100,
  "videoUrls": [],
  "channelUrls": [],
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `videoId` (type: `string`):

Video ID

## `videoUrl` (type: `string`):

Video URL

## `videoTitle` (type: `string`):

Video title

## `channel` (type: `string`):

Channel name

## `videoViewCount` (type: `string`):

Video view count

## `commentId` (type: `string`):

Comment ID

## `author` (type: `string`):

Comment author

## `authorChannelId` (type: `string`):

Author's channel ID

## `authorIsVerified` (type: `string`):

Author is verified

## `authorIsCreator` (type: `string`):

Author is the video creator

## `text` (type: `string`):

Comment text

## `likeCount` (type: `string`):

Like count (number)

## `likeCountText` (type: `string`):

Like count as shown

## `replyCount` (type: `string`):

Reply count

## `publishedTime` (type: `string`):

When the comment was posted

## `error` (type: `string`):

Error, if any

## `scrapedAt` (type: `string`):

Timestamp

# 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 = {
    "topics": [
        "iphone review"
    ],
    "searchKeywords": [
        "iphone 16 review"
    ],
    "maxCommentsPerVideo": 50,
    "maxVideosPerSource": 2,
    "maxComments": 100,
    "videoUrls": [],
    "channelUrls": [],
    "maxConcurrency": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/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 = {
    "topics": ["iphone review"],
    "searchKeywords": ["iphone 16 review"],
    "maxCommentsPerVideo": 50,
    "maxVideosPerSource": 2,
    "maxComments": 100,
    "videoUrls": [],
    "channelUrls": [],
    "maxConcurrency": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/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 '{
  "topics": [
    "iphone review"
  ],
  "searchKeywords": [
    "iphone 16 review"
  ],
  "maxCommentsPerVideo": 50,
  "maxVideosPerSource": 2,
  "maxComments": 100,
  "videoUrls": [],
  "channelUrls": [],
  "maxConcurrency": 5
}' |
apify call haketa/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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