# YouTube Comments Scraper: Videos, Shorts, Channels & Replies (`murch1k/youtube-comments-scraper`) Actor

Scrape YouTube comments and replies from videos, Shorts, channels and playlists: text, likes, reply count, author, verified/creator flags, pinned and hearted comments, video title and stats. Top or newest first. No API key, no browser. Pay per comment.

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

## Pricing

$1.50 / 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.

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 — Comments & Replies from Videos, Shorts, Channels and Playlists

Export **YouTube comments and replies** in bulk: comment text, **likes, reply count, author name, channel ID, avatar, verified / channel-owner / artist badges, pinned and hearted-by-creator flags**, posting time, plus the **video title, channel and view count** on every row.

Paste videos, **Shorts**, **channels** or **playlists** — channels and playlists are expanded into their latest videos automatically. No YouTube API key, no quota, no login and no browser.

### Features

- **Videos, Shorts, channels and playlists** in one input. Give `@mkbhd` and get comments from the channel's latest N videos.
- **Top or Newest first.** Use *Newest* to monitor new comments on your own or competitors' videos.
- **Replies included on request**, as separate rows linked with `parentCommentId` — to rebuild threads, group by `parentCommentId`.
- **Rich flags:** `isPinned`, `isHeartedByCreator`, `authorIsChannelOwner`, `authorIsVerified`, `isEdited`.
- **Ready for analysis:** likes are numbers (`219K` → `219000`), the total comment count of each video is on every row, and `publishedAtApprox` turns "3 weeks ago" into a date.
- **Fast:** pure HTTP against YouTube's own web API; thousands of comments per minute with a small memory footprint.
- **Pay per comment**, with a hard cost cap (`maxResults`) and your Apify spending limit respected exactly.

### Use cases

- **Audience research & sentiment analysis** — feed comments into ChatGPT/Claude or a sentiment model.
- **Product feedback mining** from review and unboxing videos.
- **Influencer vetting** — check real engagement, creator replies and hearted comments.
- **Lead generation** — find people asking for a product or service in comments of niche videos.
- **Community management** — export new comments daily (`sortBy: newest`).
- **Giveaways** — collect every commenter of a video.

### Input

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.youtube.com/shorts/0e3GPea1Tyg",
    "@mkbhd"
  ],
  "maxCommentsPerVideo": 100,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "maxVideosPerChannel": 10
}
```

| Option | Default | Notes |
|---|---|---|
| `startUrls` | — | Video/Shorts URLs or IDs, channels (`@handle`, `/channel/UC…`), playlists. |
| `maxCommentsPerVideo` | 100 | Top-level comments per video; `0` = all. |
| `sortBy` | `top` | `top` or `newest`. |
| `includeReplies` | `false` | Replies become extra rows (`isReply: true`). |
| `maxRepliesPerComment` | 20 | Cap per thread. |
| `maxVideosPerChannel` | 10 | Latest videos taken from each channel/playlist. |
| `maxResults` | 0 | Cost cap for the whole run (comments + replies). |
| `maxConcurrency` | 10 | Videos in parallel. |
| `proxyConfiguration` | off | Only for very large runs that hit HTTP 429. |

### Output

#### Real output (default input)

First 2 of 40 records from a run with the prefilled input (3.7 s on a test machine; long values shortened here):

```json
[
  {
    "videoId": "0e3GPea1Tyg",
    "commentId": "UgzH8vliQSJKHQMGZjx4AaABAg",
    "text": "Like I said in the video, subscribe if you haven’t already and you could win $10,000!",
    "author": "@MrBeast",
    "authorChannelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
    "authorChannelUrl": "https://www.youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA",
    "authorAvatar": "https://yt3.ggpht.com/nxYrc_1_2f77DoBadyxMTmv7ZpRZapHR5jbuYe7PlPd5cIRJxtNNEYyOC0ZsxaDyJJzXrnJiuDE=s88-c-k-c0x00ffffff-no-rj",
    "authorIsVerified": true,
    "authorIsChannelOwner": true,
    "authorIsArtist": false,
    "likes": 1100000,
    "replyCount": 739,
    "publishedTimeText": "4 years ago",
    "publishedAtApprox": "2022-10-16T12:03:29.799Z",
    "isEdited": false,
    "isPinned": true,
    "isHeartedByCreator": false,
    "isReply": false,
    "parentCommentId": null,
    "commentUrl": "https://www.youtube.com/watch?v=0e3GPea1Tyg&lc=UgzH8vliQSJKHQMGZjx4AaABAg",
    "videoTitle": "$456,000 Squid Game In Real Life!",
    "videoUrl": "https://www.youtube.com/watch?v=0e3GPea1Tyg",
    "channelName": "MrBeast",
    "channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
    "videoViewCount": 973482287,
    "source": "https://www.youtube.com/shorts/0e3GPea1Tyg",
    "videoCommentCount": 660074,
    "scrapedAt": "2026-10-15T12:03:29.802Z"
  },
  {
    "videoId": "0e3GPea1Tyg",
    "commentId": "UgwDhFNTCbfck5apuUJ4AaABAg",
    "text": "Huge props to the set designers, everything was spot on!",
    "author": "@DoodleChaos",
    "authorChannelId": "UCnVimh35ecf46P_Bt-2AArg",
    "authorChannelUrl": "https://www.youtube.com/channel/UCnVimh35ecf46P_Bt-2AArg",
    "authorAvatar": "https://yt3.ggpht.com/ytc/AIdro_luPgVjRv0QRKfNIssTr6Tb21b7UvM84AQEc_nkrB9ZqLI=s88-c-k-c0x00ffffff-no-rj",
    "authorIsVerified": true,
    "authorIsChannelOwner": false,
    "authorIsArtist": false,
    "likes": 574000,
    "replyCount": 697,
    "publishedTimeText": "4 years ago",
    "publishedAtApprox": "2022-10-16T12:03:29.799Z",
    "isEdited": false,
    "isPinned": false,
    "isHeartedByCreator": false,
    "isReply": false,
    "parentCommentId": null,
    "commentUrl": "https://www.youtube.com/watch?v=0e3GPea1Tyg&lc=UgwDhFNTCbfck5apuUJ4AaABAg",
    "videoTitle": "$456,000 Squid Game In Real Life!",
    "videoUrl": "https://www.youtube.com/watch?v=0e3GPea1Tyg",
    "channelName": "MrBeast",
    "channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
    "videoViewCount": 973482287,
    "source": "https://www.youtube.com/shorts/0e3GPea1Tyg",
    "videoCommentCount": 660074,
    "scrapedAt": "2026-10-15T12:03:29.802Z"
  }
]
```

```json
{
  "videoId": "jNQXAC9IVRw",
  "commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "text": "San Diego Zoo",
  "author": "@SanDiegoZoo",
  "authorChannelId": "UC1aIs0qJ6R4o1dZQmwF8Hzw",
  "authorChannelUrl": "https://www.youtube.com/channel/UC1aIs0qJ6R4o1dZQmwF8Hzw",
  "authorAvatar": "https://yt3.ggpht.com/…",
  "authorIsVerified": true,
  "authorIsChannelOwner": false,
  "authorIsArtist": false,
  "likes": 1200000,
  "replyCount": 985,
  "publishedTimeText": "2 years ago",
  "publishedAtApprox": "2024-10-14T19:10:27.833Z",
  "isEdited": false,
  "isPinned": true,
  "isHeartedByCreator": true,
  "isReply": false,
  "parentCommentId": null,
  "commentUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "videoTitle": "Me at the zoo",
  "videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "channelName": "jawed",
  "channelId": "UC4QobU6STFB0P71PMvOGN5A",
  "videoViewCount": 443808773,
  "videoCommentCount": 10639435,
  "source": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "scrapedAt": "2026-10-13T19:30:00.000Z"
}
```

### Use with AI agents (MCP), LangChain, RAG & the API

This actor is a ready-made **tool for AI agents**: an LLM can call it, wait for the run and read clean JSON back.

**MCP server (Claude Desktop, Claude Code, Cursor, VS Code, any MCP client)** — add Apify's hosted MCP server with this actor enabled as a tool:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?tools=murch1k/youtube-comments-scraper",
      "headers": { "Authorization": "Bearer <APIFY_TOKEN>" }
    }
  }
}
```

**LangChain / LangGraph** (`pip install langchain-apify`, set `APIFY_API_TOKEN`):

```python
from langchain_apify import ApifyActorsTool, ApifyWrapper
from langchain_core.documents import Document

## 1) give the actor to an agent as a tool
tool = ApifyActorsTool("murch1k/youtube-comments-scraper")

## 2) or load results as Documents for a RAG index
loader = ApifyWrapper().call_actor(
    actor_id="murch1k/youtube-comments-scraper",
    run_input={"startUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw", "https://www.youtube.com/shorts/0e3GPea1Tyg", "@mkbhd"], "maxCommentsPerVideo": 100, "sortBy": "top", "includeReplies": True, "maxRepliesPerComment": 20, "maxVideosPerChannel": 10},
    dataset_mapping_function=lambda item: Document(page_content=item["text"], metadata={"url": item.get("url")}),
)
docs = loader.load()
```

**REST API — one synchronous call, dataset items in the response:**

```bash
curl -X POST "https://api.apify.com/v2/acts/murch1k~youtube-comments-scraper/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw", "https://www.youtube.com/shorts/0e3GPea1Tyg", "@mkbhd"], "maxCommentsPerVideo": 100, "sortBy": "top", "includeReplies": true, "maxRepliesPerComment": 20, "maxVideosPerChannel": 10}'
```

Also works with the Apify Python/JS clients, **Make, Zapier, n8n**, Google Sheets, webhooks and schedules. Export as JSON, CSV, Excel, XML or RSS.

**RAG tip:** For sentiment analysis or "what do viewers ask for?" summaries, group rows by `videoId` and pass `text` + `likes` to the model — high-like comments first.

### Pricing

- **$1.50 per 1,000 comments** ($0.0015 per comment).
- The prefilled input returns 40 comments → **$0.06**.
- Example: 1,000 comments → $1.50; 10,000 → $15.00. Set **Max results (cost cap)** to limit any run.

Videos with comments turned off cost nothing.

### Limitations

- YouTube shows like counts rounded above 1,000 (`219K`); the `likes` field carries that value as a number.
- `publishedAtApprox` is derived from YouTube's relative time ("3 weeks ago"), so it is approximate by design.
- Only public comments are collected. Please respect YouTube's terms and privacy laws when processing personal data such as author names.

### FAQ

**Do I need a YouTube Data API key?**
No. The actor reads YouTube's public web API, so there is no API quota and no key.

**Are replies included?**
Turn on `includeReplies`. Replies are separate rows linked to the parent with `parentCommentId`.

**Can I get comments from a whole channel?**
Yes. Give a channel URL or `@handle` and set `maxVideosPerChannel`; the actor takes the latest videos.

# Actor input Schema

## `startUrls` (type: `array`):

One per line: video or Shorts URLs (<code>youtube.com/watch?v=…</code>, <code>youtu.be/…</code>, <code>/shorts/…</code>), bare video IDs, channels (<code>@handle</code>, <code>/channel/UC…</code>) or playlist URLs. Channels and playlists are expanded into their latest videos.

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

Top-level comments per video. <code>0</code> = all comments.

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

<b>Top</b> = most relevant first (YouTube default). <b>Newest</b> = most recent first — best for monitoring.

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

Also scrape replies to each comment. Replies are separate rows with <code>isReply: true</code> and <code>parentCommentId</code>, and are billed like comments.

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

Only used when replies are included.

## `maxVideosPerChannel` (type: `integer`):

How many of the latest videos to take from each channel or playlist.

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

Stop after this many rows (comments + replies) in total. <code>0</code> = no limit.

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

How many videos are scraped at the same time.

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

Not needed in most cases. Enable Apify Proxy if you see HTTP 429 errors on very large runs.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.youtube.com/shorts/0e3GPea1Tyg"
  ],
  "maxCommentsPerVideo": 20,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "maxVideosPerChannel": 10,
  "maxResults": 0,
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `comments` (type: `string`):

No description

## `runStats` (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 = {
    "startUrls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "https://www.youtube.com/shorts/0e3GPea1Tyg"
    ],
    "maxCommentsPerVideo": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("murch1k/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 = {
    "startUrls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "https://www.youtube.com/shorts/0e3GPea1Tyg",
    ],
    "maxCommentsPerVideo": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("murch1k/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 '{
  "startUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.youtube.com/shorts/0e3GPea1Tyg"
  ],
  "maxCommentsPerVideo": 20
}' |
apify call murch1k/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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