# YouTube Comments Scraper: Replies, Filters & AI Summary (`tacps126/youtube-comments`) Actor

YouTube comments and replies for any video, Short, playlist, channel or search: text, author, likes, replies, pinned and creator-hearted flags, dates. Top or newest, filters, only-new alerts and an AI summary of what viewers say.

- **URL**: https://apify.com/tacps126/youtube-comments.md
- **Developed by:** [Tapaswai Choudhary](https://apify.com/tacps126) (community)
- **Categories:** Social media, Videos, Automation
- **Security:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 comments

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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, Filters & AI Summary

Comments and replies from **any YouTube video, Short, playlist, channel or search**: text, author and channel, likes, reply count, pinned and creator-hearted flags, posting time and a direct link to each comment. Top comments or newest first, filters for likes and keywords, only-new alerts, and an optional **AI summary per video** of what viewers say.

**Built for** creators and channel managers, brands and agencies watching what people say about them, market and product researchers, data and AI teams building datasets, and AI agents.

### What you get

| Field | Meaning |
|---|---|
| `text`, `url` | The comment and a link straight to it |
| `author`, `authorChannelId`, `authorIsVerified`, `authorIsCreator` | Who wrote it (and whether it's the channel owner) |
| `likes`, `replyCount` | Engagement |
| `publishedTime`, `publishedAtEstimate`, `edited` | When (as YouTube shows it, and as a date) |
| `pinned`, `heartedByCreator` | Highlighted by the channel |
| `isReply`, `parentId` | Replies, linked to their comment |
| `videoId`, `videoTitle`, `channel`, `videoCommentCount` | The video |

With **AI summary** on, each video also gets a summary row: overall sentiment, the main themes, questions viewers ask, complaints, praise and follow-up video ideas.

### Why this Actor

- **Any source.** Videos, Shorts, playlists, channels (their latest videos) and searches in one run.
- **Replies included** on request, linked to their comment.
- **Filters.** Minimum likes, keywords (your brand or product), excluded words, posted in the last N days.
- **Only-new alerts.** Schedule it with *Newest first* and *Only new*: each run returns just the comments posted since the last one. Send them to Slack, email, Google Sheets or a webhook.
- **AI summary (optional)** per video, so you don't have to read thousands of comments.
- **Fast.** About 45 comments a second on one video, several videos at once.
- **For AI agents.** Callable as an MCP tool.

### How to use it

Top 200 comments with replies:

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

Watch a channel's latest videos for new comments that mention you:

```json
{
  "videos": ["https://www.youtube.com/@yourchannel"],
  "maxVideosPerSource": 5,
  "sortBy": "newest",
  "keywords": ["refund", "broken", "support"],
  "onlyNew": true
}
```

What viewers think of the top review videos for a product:

```json
{ "searchQueries": ["iphone 17 review"], "maxVideosPerSource": 5, "aiSummary": true }
```

### Pricing

**$1 per 1,000 comments** (replies count as comments) plus a small start fee per run. AI summaries, when you turn them on, are $0.02 per video, plus the model's tokens: about $0.0005 per summary with the default model (billed to your Apify account by Apify's AI gateway), or your provider's price with your own key. On the Apify free plan a run returns up to 100 comments.

### Good to know

- Public comments only, as anyone sees them on YouTube; nothing behind a sign-in.
- YouTube shows comment times as "3 days ago"; `publishedAtEstimate` turns that into a date, so treat it as approximate.
- Videos with comments turned off are listed in the run's warnings.
- Need another field? **Contact tacps126@gmail.com**.

# Actor input Schema

## `videos` (type: `array`):

YouTube video, Shorts, playlist or channel links (or video ids). Channels and playlists give their latest videos.

## `searchQueries` (type: `array`):

YouTube searches; the top videos of each are read.

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

How many videos each playlist, channel or search adds.

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

Top-level comments kept per video (replies come on top).

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

Newest first is best for monitoring.

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

Also return the replies to each comment kept.

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

Most replies kept per comment.

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

Only comments with at least this many likes.

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

Only comments containing one of these words, e.g. your brand or product.

## `excludeKeywords` (type: `array`):

Leave out comments containing any of these.

## `postedWithinDays` (type: `integer`):

Only comments from the last N days (YouTube shows relative times, so dates are estimates).

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

Most comments returned per run.

## `onlyNew` (type: `boolean`):

Schedule the Actor (with Newest first) and each run returns only comments earlier runs did not deliver: alerts for your videos, brand or competitors.

## `monitorName` (type: `string`):

Optional name for the "only new" history, so several monitors can run side by side.

## `tenantId` (type: `string`):

Optional label used to keep separate histories for different clients or teams.

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

Not needed in most runs; videos refused without a proxy are retried through one automatically.

## `aiSummary` (type: `boolean`):

Add one summary row per video: overall sentiment, themes, questions, complaints, praise and follow-up video ideas from the comments read.

## `aiProfile` (type: `string`):

Who you are, e.g. "Skincare brand watching review videos of our serum". Adds a fit score.

## `aiLanguage` (type: `string`):

Insights are written in this language, whatever the source language.

## `aiProvider` (type: `string`):

Which AI does the analysis. Apify needs no key: the model's tokens are billed to your Apify account by Apify's AI gateway (a fraction of a cent per call with the default model). Any other provider uses your own key and bills you there.

## `aiApiKey` (type: `string`):

Your own key for the provider above (not needed for Apify). Sent only to that provider, never stored.

## `aiModel` (type: `string`):

Model name. Apify: an OpenRouter id like anthropic/claude-sonnet-... or google/gemini-... (default: the newest Claude Haiku listed, a light model since it runs once per result). Anthropic: default claude-opus-5-5. Others: required.

## `aiBaseUrl` (type: `string`):

Only for "Other OpenAI-compatible API", e.g. http://localhost:11434/v1 for Ollama.

## `debug` (type: `boolean`):

Save extra diagnostics with the run (for support requests).

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxVideosPerSource": 10,
  "maxCommentsPerVideo": 100,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "maxItems": 1000,
  "onlyNew": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "aiSummary": false,
  "aiLanguage": "English",
  "aiProvider": "apify",
  "debug": false
}
```

# Actor output Schema

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

The produced items (default dataset items).

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

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

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

```

## MCP server setup

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