# YouTube Comments Scraper — Replies, Likes & Authors (`crawloop/youtube-comments-scraper`) Actor

Scrape YouTube video comments without login: text, author, likes, reply count, pinned/hearted flags, and optional reply threads. Sort by Top or Newest. Export JSON via API, Python, Node.js, or MCP.

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

## Pricing

from $0.69 / 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/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 — Replies, Likes & Authors

> Unofficial tool for publicly accessible YouTube comment data. YouTube and related trademarks belong to their respective owners. Not affiliated with, sponsored by, or endorsed by YouTube or Google. Provided for informational use only; users must comply with applicable terms and laws.

| Social listening | Product launches |
| :--- | :--- |
| YouTube Comments Scraper ◄── you are here | [Product Hunt Scraper](https://apify.com/crawloop/producthunt-scraper) |
| [Bluesky Scraper](https://apify.com/crawloop/bluesky-scraper) | Launches, reviews, comments, leaderboards |

**YouTube Comments Scraper** for Apify — scrape YouTube comments from public videos and Shorts into structured JSON: comment text, author handle and channel, like count, reply count, pinned / hearted flags, and optional reply threads. No YouTube login, no Data API quota. A practical **YouTube comments API alternative** for brand listening, sentiment, and moderation pipelines — run from **Python**, **Node.js**, **cURL**, or **MCP** / AI assistants and export the dataset as JSON / CSV / Excel.

### When to use

- Brand or product listening on a launch trailer, review video, or ad
- Sentiment / NLP datasets from high-engagement comment sections
- Export pinned creator statements and top fan threads with engagement metrics
- Batch several video URLs in one run until a shared `maxComments` cap
- Feed comments into CRM, Slack alerts, or agent workflows via Apify MCP

### When not to use

- Private, age-gated, or members-only videos (public Innertube only)
- Videos with **comments disabled** — the Actor fails with a clear status message
- Full channel crawls, search, transcripts, or video download — this Actor is **comments-only**

### Key features

- **Comments-first slice** — purpose-built YouTube comment scraper, not a bloated “everything” YouTube tool
- **Innertube continuations** — same `/youtubei/v1/next` feed the website uses when you scroll
- **No login / no API key** — Chrome-impersonated TLS via `curl_cffi`
- **Top or Newest** — switches sort when YouTube exposes the comments sort menu
- **Optional replies** — each reply is a flat dataset row with `parentCommentId`
- **Engagement fields** — likes, reply counts, `isPinned`, `isHearted`, verified / creator badges
- **Shorts + youtu.be** — watch URLs, Shorts, embeds, live paths, and bare 11-char video IDs
- **Proxy-ready** — Apify RESIDENTIAL when datacenter IPs hit a consent wall

### Input

| Parameter | Description |
|-----------|-------------|
| `videoUrls` | Watch / Shorts / youtu.be URLs or 11-char video IDs |
| `maxComments` | Dataset cap for the whole run (top-level + replies). `0` = unlimited (hard cap applies) |
| `sortOrder` | `top` (default) or `newest` |
| `includeReplies` | Fetch reply threads under each top-level comment |
| `maxRepliesPerComment` | Cap per thread when replies are on (default 10 if replies enabled and this is 0) |
| `hl` / `gl` | YouTube language and country (default `en` / `US`) |
| `requestDelaySecs` | Throttle between Innertube calls |
| `proxyConfiguration` | Optional Apify proxy (RESIDENTIAL recommended if blocked) |

Top comments only:

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "maxComments": 200,
  "sortOrder": "top",
  "includeReplies": false
}
```

With replies (flat rows):

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/dQw4w9WgXcQ"
  ],
  "maxComments": 500,
  "sortOrder": "newest",
  "includeReplies": true,
  "maxRepliesPerComment": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
```

### Output

One dataset row per comment or reply — ready for CSV export and PPE billing per result.

| Field | Description |
|-------|-------------|
| `type` | Always `comment` |
| `commentId` / `commentUrl` | Stable ID and deep link (`watch?v=…&lc=…`) |
| `videoId` / `videoUrl` | Source video |
| `text` | Comment body |
| `publishedTimeText` | Relative time from YouTube (e.g. `1 year ago`) |
| `likeCount` / `replyCount` | Parsed integers (+ raw `*Text` fields) |
| `authorDisplayName` / `authorChannelId` / `authorChannelUrl` | Author identity |
| `authorAvatarUrl` | Author avatar thumbnail |
| `authorIsVerified` / `authorIsCreator` / `authorIsArtist` | Badges |
| `isReply` / `replyLevel` / `parentCommentId` | Thread position |
| `isPinned` / `isHearted` | Pinned comment / creator heart when exposed |
| `sortOrder` / `scrapedAt` | Run metadata |

```json
{
  "type": "comment",
  "commentId": "Ugzge340dBgB75hWBm54AaABAg",
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "text": "can confirm: he never gave us up",
  "publishedTimeText": "1 year ago",
  "likeCount": 300000,
  "replyCount": 963,
  "authorDisplayName": "@YouTube",
  "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
  "authorChannelUrl": "https://www.youtube.com/@YouTube",
  "authorIsVerified": true,
  "isReply": false,
  "replyLevel": 0,
  "parentCommentId": null,
  "isPinned": true,
  "isHearted": true,
  "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugzge340dBgB75hWBm54AaABAg",
  "sortOrder": "top",
  "scrapedAt": "2026-08-13T18:13:00Z"
}
```

### Use cases

- Capture launch-video feedback for a product, game, or campaign drop
- Build moderation / spam samples from high-traffic uploads
- Compare Top vs Newest comment themes on the same video
- Enrich influencer or competitor research with audience language
- Pipe YouTube comments into an NLP or agent workflow via Apify dataset API / MCP

### Integration examples

#### Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('crawloop/youtube-comments-scraper').call({
  videoUrls: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'],
  maxComments: 100,
  sortOrder: 'top',
  includeReplies: true,
  maxRepliesPerComment: 5,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.slice(0, 3));
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient()
run = client.actor("crawloop/youtube-comments-scraper").call(
    run_input={
        "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
        "maxComments": 100,
        "sortOrder": "top",
        "includeReplies": True,
        "maxRepliesPerComment": 5,
    }
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items[:3])
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/crawloop~youtube-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls":["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],"maxComments":100,"sortOrder":"top","includeReplies":true}'
```

### MCP and AI assistants

Use this Actor from AI tools via [Apify MCP](https://docs.apify.com/platform/integrations/mcp).
Connect your Apify account, then call this Actor by its Store ID / name (`crawloop/youtube-comments-scraper`).

Example prompts:

- "Run YouTube Comments Scraper for https://www.youtube.com/watch?v=dQw4w9WgXcQ and return the top 50 comments as JSON"
- "Scrape newest YouTube comments with replies for this video list and summarize the top complaints"
- "Chain YouTube Comments Scraper then Bluesky Scraper to compare reaction themes across platforms"

### Suite next step

After exporting comments, run [Bluesky Scraper](https://apify.com/crawloop/bluesky-scraper) for cross-platform listening on the same brand keywords, or [Product Hunt Scraper](https://apify.com/crawloop/producthunt-scraper) when the video is tied to a launch day.

### FAQ

**How do I scrape YouTube comments without the official API?**\
This Actor reads the public Innertube comment continuation feed used by the website. No Data API key or OAuth.

**Do I need a YouTube login or cookies?**\
No for public videos. Enable Apify RESIDENTIAL proxy if you see consent walls or empty sections from datacenter IPs.

**Are replies included by default?**\
No. Set `includeReplies: true` and optionally `maxRepliesPerComment`. Each reply is a separate dataset row with `parentCommentId`.

**Can I scrape YouTube Shorts comments?**\
Yes. Shorts URLs and bare video IDs work the same as watch URLs.

**Why is Newest sort still Top?**\
Some comment headers omit the sort menu for logged-out sessions. The Actor logs a warning and keeps the default Top feed.

**What if comments are disabled?**\
The run fails with a clear status message for that video; no empty “success” dataset.

### Related Actors

| Actor | Use after / beside |
| :--- | :--- |
| [Bluesky Scraper](https://apify.com/crawloop/bluesky-scraper) | Cross-platform social listening |
| [Product Hunt Scraper](https://apify.com/crawloop/producthunt-scraper) | Launch-day comments and reviews |
| [Trustpilot Scraper](https://apify.com/crawloop/trustpilot-scraper) | Review / reputation parallel to video comments |

# Actor input Schema

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

YouTube watch / Shorts / youtu.be URLs, or bare 11-character video IDs. Comments are scraped for each video until maxComments is reached.

## `maxComments` (type: `integer`):

Hard cap on dataset rows for the whole run (top-level comments + replies). 0 = no cap (up to the Actor hard limit).

## `sortOrder` (type: `string`):

Top comments (default) or Newest first when YouTube exposes the sort menu on the comments header.

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

Fetch reply threads under each top-level comment. Each reply is a separate dataset row with parentCommentId set.

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

Cap on replies fetched per top-level comment when Include replies is on. Default 10 if includeReplies is true and this is 0.

## `hl` (type: `string`):

YouTube UI language for relative timestamps (e.g. en, de, es).

## `gl` (type: `string`):

YouTube country / region code (e.g. US, DE, GB).

## `requestDelaySecs` (type: `number`):

Throttle Innertube calls. Raise if you see HTTP 429.

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

Optional. Enable Apify RESIDENTIAL proxy if datacenter IPs hit consent walls or empty comment sections.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxComments": 100,
  "sortOrder": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 0,
  "hl": "en",
  "gl": "US",
  "requestDelaySecs": 0.35,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

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

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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

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

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

```

## MCP server setup

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