# 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
- **Stats:** 3 total users, 1 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Comments Scraper — Author, Likes, Replies & Text

Scrape **all the comments** from any YouTube video — or a whole channel, or a search — in bulk. For every comment you get the **text, author, verified/creator flags, like count, reply count and timestamp**, alongside the **video title, channel and views.**

Fast, **keyless** and built for scale — the comment data you need for **audience research, sentiment analysis, moderation and content ideas.**

***

### Why this Actor?

Comments are where a video's audience actually talks — feedback, questions, praise, complaints and language you can't get anywhere else. But YouTube loads them a few at a time behind infinite scroll. This Actor collects them all in one run:

- **Every top‑level comment** on a video, up to your limit.
- **Author details** — name, channel ID, verified and creator flags.
- **Engagement** — like count and reply count per comment.
- **Timing** — when each comment was posted.
- **Video context** — title, channel and views on every row.

Point it at videos, a channel or a keyword and get a clean, analysis‑ready table.

***

### What you can do with it

- **Sentiment analysis** — feed comments into an LLM or classifier to gauge how an audience feels.
- **Audience & market research** — learn what viewers ask, want and complain about.
- **Content ideas** — mine top comments for questions and topics for your next video.
- **Competitor analysis** — see how audiences react to competitors' videos.
- **Moderation & brand safety** — review comments on your videos at scale.
- **Community insights** — find your most engaged fans and their questions.

***

### What you get — output fields

One record per comment:

| Field | Description |
| --- | --- |
| `videoId` | Video ID |
| `videoUrl` | Video URL |
| `videoTitle` | Video title |
| `channel` | Channel name |
| `videoViewCount` | Video view count |
| `commentId` | Comment ID |
| `author` | Comment author |
| `authorChannelId` | Author's channel ID |
| `authorIsVerified` | `true` if the author is verified |
| `authorIsCreator` | `true` if the author is the video's creator |
| `text` | Comment text |
| `likeCount` | Like count as a number |
| `likeCountText` | Like count as shown (e.g. `266K`) |
| `replyCount` | Number of replies |
| `publishedTime` | When the comment was posted (e.g. `2 years ago`) |
| `error` | Populated if the video has no comments |
| `scrapedAt` | ISO timestamp |

***

### Example output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video)",
  "channel": "Rick Astley",
  "commentId": "Ugw...",
  "author": "SomeViewer",
  "authorChannelId": "UC...",
  "authorIsVerified": "false",
  "authorIsCreator": "false",
  "text": "Petition to make this the national anthem of the internet",
  "likeCount": "148000",
  "likeCountText": "148K",
  "replyCount": "963",
  "publishedTime": "1 year ago",
  "scrapedAt": "2026-07-10T12:00:00.000Z"
}
```

***

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `videoUrls` | array | — | Videos to scrape comments from. |
| `searchKeywords` | array | — | Discover videos by keyword and scrape their comments. |
| `channelUrls` | array | — | Scrape comments from the latest videos of these channels. |
| `maxCommentsPerVideo` | integer | `100` | Top‑level comments per video. |
| `sortBy` | string | `top` | `top` or `newest`. |
| `includeVideoDetails` | boolean | `true` | Add video title, channel and views to each row. |
| `maxVideosPerSource` | integer | `20` | Videos per keyword/channel. |
| `maxConcurrency` | integer | `5` | Videos processed in parallel. |
| `proxyConfiguration` | object | off | Apify Proxy (for very large runs). |

Provide any combination of `videoUrls`, `searchKeywords` and `channelUrls`.

#### Comments from specific videos

```json
{
  "videoUrls": ["dQw4w9WgXcQ", "https://youtu.be/arj7oStGLkU"],
  "maxCommentsPerVideo": 500
}
```

#### Newest comments from a channel

```json
{
  "channelUrls": ["@mkbhd"],
  "maxVideosPerSource": 10,
  "sortBy": "newest"
}
```

#### Discover by topic

```json
{
  "searchKeywords": ["iphone 16 review"],
  "maxVideosPerSource": 20,
  "maxCommentsPerVideo": 200
}
```

***

### Use cases in detail

#### 1. Sentiment analysis

Pull hundreds of comments per video and run them through a sentiment model or LLM to measure how an audience reacts to a product, topic or campaign.

#### 2. Audience & market research

Comments are unfiltered voice‑of‑customer. Scrape them across a niche to learn the questions, objections and desires that come up again and again.

#### 3. Content ideas

The most‑liked comments and the most‑asked questions are a ready‑made content backlog for your next videos, posts or FAQs.

#### 4. Competitor analysis

See what audiences say on competitors' videos — what they love, what's missing — and use it to position your own content.

#### 5. Moderation at scale

Export the comments on your own videos to review, flag or archive them without scrolling forever.

#### 6. Community insights

Find your most engaged and highest‑liked commenters, and the questions worth answering.

***

### How to use it

1. Click **Try for free**.
2. Add **video URLs**, **search keywords**, or **channels**.
3. (Optional) Set `maxCommentsPerVideo`, `sortBy` and concurrency.
4. Click **Start**.
5. Export as **JSON, CSV, Excel** or **HTML table**, or via the Apify API.

***

### Calling from the API

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "videoUrls": ["dQw4w9WgXcQ"], "maxCommentsPerVideo": 200, "sortBy": "top" }'
```

Fetch the results (JSON or CSV):

```bash
curl "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs/last/dataset/items?token=YOUR_APIFY_TOKEN&format=csv"
```

***

### Tips for the best results

- **Use `top`** to get the most‑liked, most‑relevant comments; **`newest`** to monitor fresh reactions.
- **Raise `maxCommentsPerVideo`** for deep analysis, lower it to sample quickly across many videos.
- **Combine inputs** — pass videos, keywords and channels in one run.
- **Filter `authorIsVerified` or high `likeCount`** to focus on influential voices.
- **Enable proxy** for very large runs across many videos.

***

### Frequently asked questions

**Does it get replies too?**
It collects all top‑level comments with their reply counts. (Reply threads themselves can be added on request.)

**Can I choose top vs newest?**
Yes — set `sortBy` to `top` or `newest`.

**Why does a video return no comments?**
Some videos have comments turned off; those rows include an `error` note.

**Can I scrape a whole channel's comments?**
Yes — pass the channel in `channelUrls` and set `maxVideosPerSource`.

**How many comments can it handle?**
From a handful to hundreds of thousands, paginated automatically.

**Do I need an API key?**
No. Just add videos, keywords or channels and run.

**In which format can I export?**
JSON, CSV, Excel, HTML table, or via the Apify API.

***

### Responsible use

Comments and author names are personal data. You are responsible for using the output lawfully:

- Follow data‑protection laws (e.g. GDPR) when storing or processing comments and author information.
- Use the data for legitimate research, analytics and moderation purposes.
- Respect the platform's terms and each user's rights.

This Actor is provided for lawful research and analytics purposes. It does not provide legal advice.

***

### Support

Need reply threads, author avatars or extra fields? Open an issue from the Actor's page and describe what you need.

# 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. Lower this for faster, cheaper runs.

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

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

## `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. Off by default; enable it for very large runs or if you hit rate limits.

## Actor input object example

```json
{
  "topics": [
    "iphone review",
    "world news",
    "new music"
  ],
  "searchKeywords": [
    "iphone 16 review"
  ],
  "sortBy": "top",
  "includeVideoDetails": true,
  "maxCommentsPerVideo": 100,
  "maxVideosPerSource": 10,
  "videoUrls": [],
  "channelUrls": [],
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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",
        "world news",
        "new music"
    ],
    "searchKeywords": [
        "iphone 16 review"
    ],
    "maxCommentsPerVideo": 100,
    "maxVideosPerSource": 10,
    "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",
        "world news",
        "new music",
    ],
    "searchKeywords": ["iphone 16 review"],
    "maxCommentsPerVideo": 100,
    "maxVideosPerSource": 10,
    "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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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",
    "world news",
    "new music"
  ],
  "searchKeywords": [
    "iphone 16 review"
  ],
  "maxCommentsPerVideo": 100,
  "maxVideosPerSource": 10,
  "videoUrls": [],
  "channelUrls": [],
  "maxConcurrency": 5
}' |
apify call haketa/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=haketa/youtube-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/tLOjdqVWaaYi2rurp/builds/y5eJ7xbyRFyBvabZg/openapi.json
