# YouTube Comments Scraper (`maged120/youtube-comments-scraper`) Actor

Extracts YouTube comments and replies with authors, likes, reply counts and timestamps — fast, no browser, no login.

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

## Pricing

from $7.00 / 1,000 results

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?

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

**Extract every comment and reply from any YouTube video** — author, likes, reply counts, timestamps, pinned and hearted flags — as clean, structured rows you can export to JSON, CSV or Excel. No login, no browser, no cookies to supply.

### What does YouTube Comments Scraper do?

This Actor collects **public comments and their replies** from any [YouTube](https://www.youtube.com) video: regular videos, Shorts, and past live streams. For each comment you get the full text, the author's handle and channel link, like count, reply count, relative publish time, and whether the comment is pinned, verified, or hearted by the creator.

It is built for speed. A purpose-built extraction path pulls comments directly in structured form — no headless browser, no page rendering — so a typical run returns **hundreds of comments in seconds** instead of minutes, at a fraction of the compute cost.

Running on the Apify platform means you also get scheduling, a REST API, webhooks, ready-made integrations (Google Sheets, Slack, Zapier, Make), and automatic retries — so comment collection can run on autopilot.

### Why use YouTube Comments Scraper?

- **Audience research** — find out what your viewers actually ask for, in their own words.
- **Sentiment & brand monitoring** — track how people react to a launch, a review, or a competitor's video.
- **Content ideas** — the most-liked comments on a popular video are a ranked list of what your audience cares about.
- **Community management** — pull every comment on your latest upload into a spreadsheet and triage replies.
- **Creator & influencer vetting** — check whether engagement looks organic before you spend on a placement.
- **Academic & market research** — build large, structured comment datasets without writing a scraper.
- **Training data** — collect real-world conversational text at scale.

### How to use YouTube Comments Scraper

1. Click **Try for free** / open the Actor in Apify Console.
2. Paste one or more YouTube video links into **YouTube Videos**. Full URLs, Shorts links, `youtu.be` links, or bare video IDs all work.
3. Set **Max Top-Level Comments per Video** — start with 100 to see the shape of the data.
4. Choose **Top comments** or **Newest first**, and decide whether you want **replies** included.
5. Click **Start** and watch the results fill the **Output** tab.
6. Export to JSON, CSV, Excel, or pull the results from the API.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | array | — | Video URLs or IDs. Watch, Shorts, live and `youtu.be` links accepted. |
| `maxComments` | integer | 100 | Top-level comments per video. `0` = unlimited. |
| `maxPages` | integer | 0 | Comment pages per video (~20 comments per page). `0` = no page limit. |
| `sortBy` | string | `top` | `top` (most engaged) or `newest` (most recent first). |
| `includeReplies` | boolean | `true` | Also collect replies under each comment. |
| `maxRepliesPerThread` | integer | 10 | Replies per comment thread. `0` = unlimited. |
| `proxyConfiguration` | object | disabled | Optional. Only needed for very large jobs. |

```json
{
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/shorts/abcdefghijk"
    ],
    "maxComments": 500,
    "maxPages": 0,
    "sortBy": "newest",
    "includeReplies": true,
    "maxRepliesPerThread": 10
}
```

### Output

Every result is a flat row, ready for a spreadsheet. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

One `video_summary` row per video:

```json
{
    "entityType": "video_summary",
    "videoId": "dQw4w9WgXcQ",
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "channelName": "Rick Astley",
    "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
    "totalComments": 2454657,
    "sortedBy": "top",
    "scrapedAt": "2026-08-20T18:33:39.331463+00:00"
}
```

One `comment` row per comment and per reply:

```json
{
    "entityType": "comment",
    "videoId": "dQw4w9WgXcQ",
    "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "commentId": "Ugzge340dBgB75hWBm54AaABAg",
    "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugzge340dBgB75hWBm54AaABAg",
    "text": "can confirm: he never gave us up",
    "author": "@YouTube",
    "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
    "authorChannelUrl": "https://www.youtube.com/@YouTube",
    "authorAvatar": "https://yt3.ggpht.com/3s6evpq...=s88-c-k-c0x00ffffff-no-rj",
    "isVerified": true,
    "isChannelOwner": false,
    "publishedTime": "1 year ago",
    "likeCount": 303000,
    "likeCountText": "303K",
    "replyCount": 1000,
    "isPinned": true,
    "pinnedBy": "Pinned by @RickAstleyYT",
    "heartedByCreator": true,
    "replyLevel": 0,
    "parentCommentId": null,
    "scrapedAt": "2026-08-20T18:33:39.331555+00:00"
}
```

#### Data fields

| Field | Description |
|---|---|
| `text` | Full comment text |
| `author` | Author handle, e.g. `@YouTube` |
| `authorChannelId` / `authorChannelUrl` | Author's channel ID and link |
| `authorAvatar` | Author profile image URL |
| `isVerified` | Author has a verified channel |
| `isChannelOwner` | Comment was written by the video's own channel |
| `publishedTime` | Relative publish time as shown on YouTube |
| `likeCount` / `likeCountText` | Likes as a number and as displayed (`303K`) |
| `replyCount` | Replies on the thread |
| `isPinned` / `pinnedBy` | Pinned comment flag and the pinning creator |
| `heartedByCreator` | Creator gave the comment a heart |
| `replyLevel` | `0` for a top-level comment, `1` for a reply |
| `parentCommentId` | Parent comment ID for replies |
| `commentUrl` | Direct link that opens the comment on YouTube |

#### Dataset views

- **Comments** — the default table: text, author, likes, replies, timestamps.
- **Authors** — author-centric columns for outreach and engagement analysis.
- **Videos** — one row per video with total comment count and any errors.

### How much does it cost to scrape YouTube comments?

You are charged per result, and every comment, reply, and video summary is one result.

| Job | Results | Notes |
|---|---|---|
| 1 video, 100 comments, no replies | ~101 | Quick sample of a video's reaction |
| 1 video, 500 comments + 10 replies each | up to ~5,500 | Deep dive on one upload |
| 10 videos, 200 comments each, no replies | ~2,010 | Channel-wide sweep |

These levers keep the bill exactly where you want it:

- **`maxComments`** caps top-level comments per video.
- **`maxPages`** caps how deep the Actor pages into a video's comment list — whichever limit is reached first stops that video.
- **`maxRepliesPerThread`** caps replies collected under each comment.
- **`includeReplies: false`** removes replies entirely — usually the biggest share of results.

Replies are billed like comments: each reply is its own row, linked to its comment through `parentCommentId`.

Because the Actor uses no browser, compute cost per result is very low.

### Tips

- Use **Newest first** for monitoring runs on a schedule, and **Top comments** for research on older videos.
- Turn replies off for a first pass, then re-run with replies only on the videos that matter.
- `maxComments: 0` means unlimited — on a video with millions of comments that run will take a long time and produce a very large dataset. Set a cap unless you truly want everything.
- Schedule a daily run on your own uploads and pipe the output into Google Sheets or Slack for instant community alerts.
- No proxy is needed for normal use. Only enable it if you run unusually large jobs.

### FAQ

**Do I need a YouTube account or API key?**
No. The Actor works with public data only and needs no login, cookies, or API quota.

**Does it get around the YouTube Data API quota?**
It does not use the official API at all, so daily quota limits do not apply to your runs.

**Can it scrape comments on Shorts and live streams?**
Yes. Shorts, regular videos, and past live streams with comments enabled all work.

**Why is `likeCount` a round number like 303000?**
YouTube itself displays abbreviated like counts (`303K`) on comments. `likeCountText` keeps the original display value, and `likeCount` is its numeric form.

**What happens if a video has comments disabled?**
That video gets a single `error` row explaining it, and the run continues with the remaining videos.

**Is scraping YouTube comments legal?**
This Actor collects only publicly visible information. You are responsible for how you use the data — in particular, take care with personal data and follow GDPR/CCPA and YouTube's Terms of Service. Do not use the output for spam or harassment.

### Support

Found a bug or need an extra field? Open an issue on the Actor's **Issues** tab. Custom scraping solutions are available on request.

# Actor input Schema

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

Videos to scrape comments from. Paste full URLs (watch, Shorts, live or youtu.be links) or bare video IDs — all are accepted.

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

Maximum number of top-level comments to collect per video. Set to 0 for unlimited (can be very large on popular videos).

## `maxPages` (type: `integer`):

Maximum number of comment pages to load per video (roughly 20 top-level comments per page). Set to 0 for no page limit. Whichever runs out first — this or the comment limit — stops the video.

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

Order in which comments are collected. 'Top comments' returns the most engaged-with comments first, 'Newest first' returns the most recent.

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

Also collect replies to each comment. Turn this off to scrape top-level comments only and cut the result count.

## `maxRepliesPerThread` (type: `integer`):

Maximum replies to collect for each comment thread. Set to 0 for unlimited. Ignored when replies are turned off.

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

Optional proxy settings. Not required for normal use — enable only if you run very large jobs and start seeing rate limiting.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxComments": 100,
  "maxPages": 0,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerThread": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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"
    ],
    "maxComments": 100,
    "maxPages": 0,
    "maxRepliesPerThread": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("maged120/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"],
    "maxComments": 100,
    "maxPages": 0,
    "maxRepliesPerThread": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("maged120/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"
  ],
  "maxComments": 100,
  "maxPages": 0,
  "maxRepliesPerThread": 10
}' |
apify call maged120/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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