# YouTube Comments Scraper: Replies, Shorts, Channels (`datacraft-tools/youtube-comments`) Actor

Scrape YouTube comments and replies from videos, Shorts or a channel's latest uploads via the official API. Keyword, likes and date filters. Fast, never blocked.

- **URL**: https://apify.com/datacraft-tools/youtube-comments.md
- **Developed by:** [Datacraft Tools](https://apify.com/datacraft-tools) (community)
- **Categories:** Social media, Videos, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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: Replies, Shorts, Channels

Export **YouTube comments and replies** from any public video, **Shorts** or a **channel's latest uploads**. Built on the **official YouTube Data API**, so it's fast, stable and never blocked.

### Features

- **Videos, Shorts and channels.** Paste video or Shorts links, or add channels (`@mrbeast`) to collect comments from their latest N videos.
- **Replies included.** Turn on `includeReplies` to get every reply thread, linked to its parent comment.
- **Filters.** Keep only comments containing your keywords, with at least N likes, or posted after a given date.
- **Top or newest.** Sort by top comments or newest first.
- **Rich rows.** Each comment includes the author, author channel, likes, reply count, dates and a direct comment link, plus the **video title, channel, views and total comment count**.
- **No setup.** Works out of the box. For very large jobs you can add your own free YouTube API key.

### Use cases

- Sentiment and audience research, and AI or LLM analysis of feedback
- Finding questions, complaints and content ideas
- Brand and product mention tracking in reviews and unboxings
- Giveaway winner selection and community moderation

### Input example

```json
{
  "videoUrls": ["https://www.youtube.com/shorts/abc123def45"],
  "channels": ["@mkbhd"],
  "latestVideosPerChannel": 3,
  "maxCommentsPerVideo": 1000,
  "includeReplies": true,
  "keywords": ["battery", "price"]
}
```

### Output example

```json
{
  "videoTitle": "iPhone Review",
  "channelTitle": "Marques Brownlee",
  "videoViews": 3500000,
  "author": "@someone",
  "text": "The battery life is insane",
  "likes": 1203,
  "replyCount": 14,
  "isReply": false,
  "publishedAt": "2026-11-12T15:01:22Z",
  "commentUrl": "https://www.youtube.com/watch?v=…&lc=…"
}
```

### Pricing

A small fee per run start plus a fee per comment saved. There are no monthly fees.

# Actor input Schema

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

YouTube video, Shorts or youtu.be links, or 11-character video IDs.

## `channels` (type: `array`):

Channel handles (@mrbeast), URLs or IDs. Comments are collected from each channel's latest videos.

## `latestVideosPerChannel` (type: `integer`):

How many of the newest uploads to take from each channel.

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

Top-level comments scanned per video (replies come on top when enabled).

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

Top comments (YouTube relevance) or newest first.

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

Also collect all replies to each comment.

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

Caps replies per comment (popular comments can have thousands).

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

Only keep comments containing any of these words (case-insensitive).

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

Only keep comments with at least this many likes.

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

Only comments posted on or after this date (YYYY-MM-DD).

## `youtubeApiKey` (type: `string`):

Optional. A shared key is used by default; add your own free key from console.cloud.google.com for very large runs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "channels": [],
  "latestVideosPerChannel": 5,
  "maxCommentsPerVideo": 500,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "keywords": [],
  "minLikes": 0
}
```

# Actor output Schema

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

No description

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datacraft-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=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("datacraft-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=dQw4w9WgXcQ"
  ]
}' |
apify call datacraft-tools/youtube-comments --silent --output-dataset

```

## MCP server setup

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