# YouTube Comments Scraper - Replies, Likes, Keyword Filters (`ai-lead-gen-tools/youtube-comments`) Actor

\[💰$0.10/1K] Scrape YouTube comments from videos, channels or a keyword search. Each row has text, likes, reply count, author, channel link, pin and heart flags and a bounded date interval, not a fake timestamp. Filter by likes, keywords and dates. A daily run emits only new comments. No login.

- **URL**: https://apify.com/ai-lead-gen-tools/youtube-comments.md
- **Developed by:** [Vladimir Che](https://apify.com/ai-lead-gen-tools) (community)
- **Categories:** Social media, Marketing, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 comment scrapeds

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 - Replies, Likes, Keyword Filters

Scrape comments from YouTube videos, a whole channel or a search query. No login, no YouTube API key, no proxy.

The source is YouTube's own comment panel read as a logged-out visitor. Replies are read from the same thread, in the same page loads.

### What you get

One row per comment. Every row carries the same field set, so the column layout is stable between runs.

| Group | Fields |
|---|---|
| Identity | `commentId`, `parentCommentId`, `videoId`, `isReply`, `depth` |
| Video | `videoTitle`, `videoChannelName`, `commentsTotalText` |
| Text | `text`, `isQuestion`, `isEdited` |
| Engagement | `likeCount`, `likeCountText`, `replyCount`, `replyCountText` |
| Author | `authorName`, `authorChannelId`, `authorChannelHandle`, `authorChannelUrl`, `authorAvatarUrl` |
| Flags | `isPinned`, `isHearted`, `isCreator`, `isNew` |
| Date | `publishedText`, `publishedAtFrom`, `publishedAtTo`, `publishedPrecision`, `publishedGranularity`, `publishedAmount` |
| Meta | `status`, `filterReason`, `scrapedAt` |

A real row, taken from `test/output-sample.json` and produced by a real run:

```json
{
  "commentId": "UgzpbEHkXtllIXxR-dZ4AaABAg",
  "parentCommentId": null,
  "videoId": "E7la7-dtfVM",
  "videoTitle": "This new startup can query anywhere you've been...",
  "videoChannelName": "@Fireship",
  "commentsTotalText": "1.3K",
  "text": "The irony of Flock suing the guy for keeping track of their camera's locations...",
  "publishedText": "2 months ago",
  "publishedAtFrom": "2026-08-11T01:13:23.365Z",
  "publishedAtTo": "2026-09-10T11:46:59.365Z",
  "publishedPrecision": "text-interval",
  "publishedGranularity": "month",
  "publishedAmount": 2,
  "isEdited": false,
  "likeCount": 5900,
  "likeCountText": "5.9K",
  "replyCount": 33,
  "replyCountText": "33 replies",
  "authorName": "@eleos5",
  "authorChannelId": "UCkTjIYUTgOEMAC6CVmpnPkw",
  "authorChannelHandle": "/@eleos5",
  "authorChannelUrl": "https://www.youtube.com/@eleos5",
  "authorAvatarUrl": "https://yt3.ggpht.com/oBAYumw6PjWMBOeJ4fCz9uDcK8iXMvQM4R-RpEPlwnrdYA8r_kbNtfIWjUZwePmd21LZBIS8=s176-...",
  "isPinned": false,
  "isHearted": false,
  "isCreator": false,
  "isReply": false,
  "depth": 0,
  "isQuestion": false,
  "isNew": null,
  "filterReason": null,
  "status": "ok",
  "scrapedAt": "2026-11-10T08:54:11.365Z"
}
```

Long fields are truncated with `...` in this sample. Output is available as JSON, CSV or Excel from the dataset tab.

### How to use it

1. Open this actor in the Apify Console.
2. Say what to read with one of three inputs: **Video URLs**, **Channel URL** or **Search query**. They combine.
3. Set the caps: `maxCommentsPerVideo` and `maxPagesPerVideo`.
4. Click Start, then export the dataset as CSV, Excel or JSON, or read it through the Apify API.

Three ways to say what to read:

- `videoUrls` - watch links, `youtu.be` links, Shorts, live links or bare video ids, up to 500.
- `channelUrl` - a channel link, an `@handle` or a `UC` id; the latest `videosLimit` videos are read.
- `searchQuery` - a keyword; the first `searchVideoLimit` videos of the result page are read.

A daily incremental run over a channel:

```json
{
  "channelUrl": "@fireship",
  "videosLimit": 10,
  "maxCommentsPerVideo": 500,
  "sortBy": "newest",
  "onlyNewSinceLastRun": true,
  "stateName": "fireship-daily"
}
```

Parameters, one to one with the input schema.

| Input | Default | Notes |
|---|---|---|
| `videoUrls` | `[]` | links, Shorts, live links or bare ids, up to 500 |
| `channelUrl` | empty | channel link, `@handle` or `UC` id |
| `videosLimit` | `10` | videos read from `channelUrl` |
| `searchQuery` | empty | keyword, reads the videos it returns |
| `searchVideoLimit` | `10` | videos taken from the search result page |
| `maxCommentsPerVideo` | `200` | cap on comments saved per video, replies included |
| `maxPagesPerVideo` | `20` | comment pages read, 20 comments per page |
| `maxRepliesPerComment` | `0` | replies per parent, `0` turns them off |
| `sortBy` | `top` | `top` relevance order or `newest` first |
| `includeReplies` | `true` | whether replies are saved at all |
| `maxDepth` | `1` | reply depth kept, 1 means one level below the parent |
| `minLikes` / `maxLikes` | `0` / none | filter on `likeCount` |
| `commentsSince` / `commentsUntil` | none | filter on the `publishedAtFrom` to `publishedAtTo` interval |
| `includeTerms` | `[]` | keep only comments containing at least one of these |
| `excludeTerms` | `[]` | drop comments containing any of these |
| `onlyQuestions` | `false` | keep only comments detected as questions |
| `excludeCreatorReplies` | `false` | drop comments written by the channel owner |
| `onlyNewSinceLastRun` | `false` | remember pushed ids and emit only unseen comments |
| `stateName` | empty | bucket for the memory, share it across runs of one schedule |
| `maxResults` | `0` | cap on paid rows for the whole run, `0` means no cap |
| `maxConcurrency` | `4` | videos read in parallel |
| `sameDomainDelaySecs` | `0.5` | minimum gap between two requests to youtube.com |
| `requestTimeoutSecs` | `30` | per-request timeout before a retry |
| `runBudgetSecs` | the run timeout | leave it empty and the run uses the whole timeout you set |
| `proxyConfiguration` | no proxy | not required, worth enabling on large runs |

#### Ready-made tasks

Four saved inputs, one per question this actor answers. Each one shows only the fields it needs, and each returns data on its first run.

| Task | Input | Question it answers |
|---|---|---|
| [YouTube Comments by Video: Text, Likes, Replies](https://apify.com/ai-lead-gen-tools/youtube-comments/examples/youtube-comments-by-video) | `videoUrls`, `maxCommentsPerVideo`, `sortBy` | what viewers say under one video, with likes and replies |
| [YouTube Channel Comments: Latest Videos Together](https://apify.com/ai-lead-gen-tools/youtube-comments/examples/youtube-comments-from-channel) | `channelUrl`, `videosLimit` | the comment volume across the latest videos of one channel |
| [YouTube Question Finder: Comments That Ask](https://apify.com/ai-lead-gen-tools/youtube-comments/examples/youtube-question-finder) | `searchQuery`, `onlyQuestions` | the comments that ask something, so unanswered questions surface |
| [YouTube Comment Monitor: Only New Each Day](https://apify.com/ai-lead-gen-tools/youtube-comments/examples/youtube-comment-monitor) | `channelUrl`, `onlyNewSinceLastRun` | only the comments this task has not delivered yet, for a daily schedule |

### Modes

The three inputs are not exclusive modes, they stack: a run can read a channel and a keyword at once.

| Input | What is requested | Rows |
|---|---|---|
| `videoUrls` | one comment panel per listed video | comments of those videos only |
| `channelUrl` | the channel Videos page, then the newest `videosLimit` videos | comments of the newest videos |
| `searchQuery` | the search result page, then the first `searchVideoLimit` videos | comments of the videos that rank for the keyword |

A video that yields no comments still leaves one row carrying the video level `status` and `reason`, so a silent video is visible in the dataset.

### Use cases

- **Audience research.** Export the top comments of a competitor's last ten videos and read the objections customers write in their own words.
- **Product feedback mining.** Run a keyword, keep only `onlyQuestions: true` rows, and get a list of unanswered questions about a topic.
- **Community moderation and lead triage.** Filter by `minLikes` to surface the comments that the audience already endorsed, then hand a shortlist to a moderator.
- **Creator outreach.** Collect the `authorChannelUrl` of commenters on niche videos to find small channels active in a topic.

### Cost

The price is **$0.10 per 1 000 comments**, which is $0.0001 per comment. The Store adds its 20 % margin, so a buyer pays $0.12 per 1 000. One `apify-actor-start` charge of $0.00005 applies per run.

You pay for a saved comment row with `status: ok` and a `commentId`. Nothing else is charged:

- `comments-disabled`, `no-comments`, `video-not-found`, `video-unavailable` and `fetch-failed` rows are free;
- `invalid-input` rows are free;
- `budget-exhausted` rows are free;
- rows dropped by a filter, and replies skipped by `includeReplies` or `maxRepliesPerComment`, are never written and never billed.

With `onlyNewSinceLastRun` a daily schedule pays only for comments it has not seen, which is what makes a per-comment price workable on a popular video.

### Honest limits

- **There is no absolute comment timestamp.** YouTube publishes only rendered age text, so `publishedAtFrom` and `publishedAtTo` bound the real date and `publishedPrecision` is always `text-interval`. `commentsSince` and `commentsUntil` work on that interval, and a comment whose age text cannot be parsed is never dropped by a date filter.
- **Like counts are abbreviated on the page.** `likeCount` is exact only below 1 000. `79K` becomes `79000`.
- **Replies arrive flat.** YouTube returns them without a depth marker, so `depth` is 1 for every reply and the parent is carried from the thread that was opened.
- **`depth` beyond one level is not reachable.** The panel does not expose a reply's own replies as a separate tree.
- **A pinned comment stays first** even with `sortBy: newest`. Do not read the first row as proof of freshness, use the interval.
- **`replyCount: null` means YouTube rendered no counter**, which in practice means zero replies.
- **`no-comments` does not prove comments are off.** A video with the panel on but every comment held for review reads as `no-comments`.

### FAQ

**Do I need a YouTube API key?**
No. The actor reads the public comment panel. There is no key and no quota.

**Can I scrape a whole channel?**
Yes, with `channelUrl` and `videosLimit`. It reads the newest videos of that channel, not the entire back catalogue, because cost grows with every video opened.

**How do I avoid paying twice for the same comments?**
Set `onlyNewSinceLastRun: true` and reuse one `stateName` across the runs of a schedule. The actor keeps the ids it already pushed and emits only unseen ones.

**Why is `publishedText` the only readable date?**
Because it is the only date YouTube publishes for a comment. The interval fields are derived from that text, and `publishedPrecision` says so instead of pretending to a timestamp.

**Are replies included in `maxCommentsPerVideo`?**
Yes. The cap counts saved rows, replies included, so a thread with many replies needs a higher value.

**What does `onlyQuestions` match?**
A question mark or a question word in the comment text. It is a heuristic on the text, not a model, so treat it as a filter, not a classifier.

**How do I keep a run cheap?**
Lower `maxCommentsPerVideo` and `maxPagesPerVideo`, use `sortBy: newest` with `onlyNewSinceLastRun` for schedules, and turn `includeReplies` off when you only need top level comments.

**Why does one video cost one free row?**
So a video with comments disabled or removed shows up in the dataset instead of vanishing. Those rows have a `status` other than `ok` and are not charged.

### Related actors

Other actors in the YouTube group, each with its own dataset and price:

- [YouTube Search Scraper](https://apify.com/ai-lead-gen-tools/youtube-search) - videos, Shorts, channels and playlists by keyword, with native filters.
- [YouTube Channel Contacts](https://apify.com/ai-lead-gen-tools/youtube-channel-contacts) - emails and social profiles of the channels behind the videos.
- [YouTube Channel Discovery](https://apify.com/ai-lead-gen-tools/youtube-channel-discovery) - find channels by keyword before reading their comments.
- [YouTube Similar Channels](https://apify.com/ai-lead-gen-tools/youtube-similar-channels) - channels close to a seed channel, for lookalike prospecting.

### Changelog

- 2026-11-12: published in the Store, pay per result with a free run start.
- 2026-11-10: first build on the platform.

# Actor input Schema

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

YouTube videos to read comments from. Accepts watch links, youtu.be links, Shorts and live links, or bare 11-character video ids. Up to 500 values.

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

Read comments from the latest videos of a channel. Accepts a channel link, an @handle or a UC channel id. Combined with `videosLimit`.

## `videosLimit` (type: `integer`):

How many of the channel's latest videos to read when `channelUrl` is set.

## `searchQuery` (type: `string`):

Find videos by a search phrase and read their comments. Combined with `searchVideoLimit`.

## `searchVideoLimit` (type: `integer`):

How many videos to take from the search results when `searchQuery` is set.

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

Upper bound of top level comments read from one video.

## `maxPagesPerVideo` (type: `integer`):

Upper bound of comment pages requested for one video. One page holds 20 comments.

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

How many replies to read under each comment. Zero means replies are not requested at all and cost nothing.

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

`top` reads the default relevance order. `newest` reads newest first, which makes the incremental mode and the date early-exit work.

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

When off, replies are dropped by a filter even if `maxRepliesPerComment` is above zero.

## `maxDepth` (type: `integer`):

Reply depth to keep. Top level comments are depth 0. YouTube returns replies flat, so depth 1 is the practical maximum.

## `minLikes` (type: `integer`):

Drop comments with fewer likes. Zero disables the filter.

## `maxLikes` (type: `integer`):

Drop comments with more likes. Empty disables the filter.

## `commentsSince` (type: `string`):

Keep comments whose publication interval overlaps this date or later. ISO date or datetime. YouTube shows comment age as text, so the real timestamp is a range, not a point: a comment is kept when its range reaches this date.

## `commentsUntil` (type: `string`):

Keep comments whose publication interval starts at or before this date. Same range semantics as `commentsSince`.

## `includeTerms` (type: `array`):

Keep only comments containing at least one of these words. Case insensitive. Empty means no word filter.

## `excludeTerms` (type: `array`):

Drop comments containing any of these words. Applied after the include list.

## `onlyQuestions` (type: `boolean`):

Keep comments containing a question mark.

## `excludeCreatorReplies` (type: `boolean`):

Drop replies written by the channel that owns the video.

## `onlyNewSinceLastRun` (type: `boolean`):

Remember the ids already emitted and push only comments not seen in previous runs. State lives in the named store and is addressed by `stateName` or by the inputs.

## `stateName` (type: `string`):

Name of the incremental state. Set the same value across runs of one schedule to keep them in one bucket.

## `maxResults` (type: `integer`):

Stop after this many comments. Zero means no limit.

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

How many videos are read in parallel.

## `sameDomainDelaySecs` (type: `number`):

Minimum gap between two requests to youtube.com, in seconds.

## `requestTimeoutSecs` (type: `integer`):

Timeout of one HTTP request, in seconds.

## `runBudgetSecs` (type: `integer`):

Soft time limit for the run, in seconds. When reached, the actor stops starting new requests and finishes with a partial result.

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

Optional Apify Proxy. Not needed for YouTube comments: the comment endpoint answers datacenter addresses.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=E7la7-dtfVM"
  ],
  "videosLimit": 10,
  "searchVideoLimit": 10,
  "maxCommentsPerVideo": 5,
  "maxPagesPerVideo": 1,
  "maxRepliesPerComment": 0,
  "sortBy": "top",
  "includeReplies": true,
  "maxDepth": 1,
  "minLikes": 0,
  "includeTerms": [],
  "excludeTerms": [],
  "onlyQuestions": false,
  "excludeCreatorReplies": false,
  "onlyNewSinceLastRun": false,
  "maxResults": 0,
  "maxConcurrency": 4,
  "sameDomainDelaySecs": 0.5,
  "requestTimeoutSecs": 30,
  "runBudgetSecs": 60,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per comment: text, likes, reply count, author and channel link, pin and heart flags, plus the bounded publication interval publishedAtFrom..publishedAtTo. Every field is always present, unknown values are null and never omitted, so the column set is stable between runs.

## `summary` (type: `string`):

Counters for the run: videos read, comments pushed and filtered out, pages and reply pages fetched, failures, the budget state and how many events were charged.

# 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=E7la7-dtfVM"
    ],
    "maxCommentsPerVideo": 5,
    "maxPagesPerVideo": 1,
    "runBudgetSecs": 60
};

// Run the Actor and wait for it to finish
const run = await client.actor("ai-lead-gen-tools/youtube-comments").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=E7la7-dtfVM"],
    "maxCommentsPerVideo": 5,
    "maxPagesPerVideo": 1,
    "runBudgetSecs": 60,
}

# Run the Actor and wait for it to finish
run = client.actor("ai-lead-gen-tools/youtube-comments").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=E7la7-dtfVM"
  ],
  "maxCommentsPerVideo": 5,
  "maxPagesPerVideo": 1,
  "runBudgetSecs": 60
}' |
apify call ai-lead-gen-tools/youtube-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ai-lead-gen-tools/youtube-comments"
        }
    }
}
```

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/NdIghNR6QEc9NfQt6/builds/dbdC3CazTpT1JRwcD/openapi.json
