# YouTube Comments Scraper - Export Comments, Authors & Likes (`santhej/youtube-comments-scraper`) Actor

Scrape and export YouTube comments for any video: comment text, author name, channel ID and avatar, verified and creator flags, numeric like and reply counts, and creator hearts. No YouTube API key and no quota. $0.50 per 1,000 comments, JSON/CSV.

- **URL**: https://apify.com/santhej/youtube-comments-scraper.md
- **Developed by:** [Santhej Kallada](https://apify.com/santhej) (community)
- **Categories:** Videos, Social media
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per event

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?

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 — Comments, Authors & Likes

Scrape YouTube comments with **no YouTube API key and no quota**: full text, author name and channel ID, like counts, reply counts and publish time for any video. Paste watch URLs, `youtu.be` links, Shorts URLs or bare video IDs and export clean JSON/CSV. **$0.50 per 1,000 comments.**

Perfect for sentiment analysis, audience research, social listening, lead generation, community moderation and LLM training data.

### Features

- Accepts **any video identifier**: `watch` URLs, `youtu.be`, Shorts links or 11-character IDs.
- **Full comment data**: text, author, author channel ID, verified/creator badges, likes, reply count, publish time.
- Parsed **numeric like counts** ("1.2K" → `1200`) *and* the raw display text.
- **Bulk**: up to 100 videos per run, 10–5,000 comments per video, with polite, rate-limit-friendly paging.
- **Residential proxy** support to avoid IP blocks.
- **No YouTube Data API key, no quota, no login** — and videos with comments disabled are reported as error rows and never charged.
- Top-level comments (Top comments order). Replies are not fetched, but every row carries its `reply_count` so you can see engagement at a glance.

### Input

| Field | Type | Description |
|---|---|---|
| `videos` | array | Video URLs or 11-char IDs, one per line. Max 100. **Required.** |
| `maxCommentsPerVideo` | integer | Top-level comments to return per video (10–5000). Default `100`. |
| `proxyConfiguration` | object | Residential proxy recommended (default). |

#### Example input

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/9bZkp7q19f0"
  ],
  "maxCommentsPerVideo": 500
}
```

### Output

One row per comment, plus one summary row per video.

#### Comment row (`record_type: "comment"`)

| Field | Description |
|---|---|
| `video_id` | The video the comment belongs to |
| `comment_id` | Unique comment ID |
| `text` | Full comment text |
| `author` | Display name (e.g. `@someuser`) |
| `author_channel_id` | Author's `UC…` channel ID |
| `author_is_verified` | Verified badge |
| `author_is_creator` | Comment by the video's creator |
| `likes` / `likes_text` | `1200` / `"1.2K"` |
| `reply_count` | Number of replies on the thread |
| `published_time_text` | `"2 days ago"` |
| `position` | 1 = first comment returned |
| `scraped_at` | ISO timestamp |

#### Video summary row (`record_type: "video_summary"`)

`{ video_id, comments_scraped, requested, note? }` — one per video, so you always know how many comments each video actually yielded.

#### Example output

```json
{
  "record_type": "comment",
  "video_id": "dQw4w9WgXcQ",
  "comment_id": "UgzXK9…",
  "text": "This is a masterpiece.",
  "author": "@musicfan",
  "author_channel_id": "UCabc123…",
  "author_is_verified": false,
  "author_is_creator": false,
  "likes": 1200,
  "likes_text": "1.2K",
  "reply_count": 34,
  "published_time_text": "2 days ago",
  "position": 1
}
```

Videos with comments turned off come back as `{ "record_type": "error", "input": "…", "error": "…" }` — the run continues and you are **not** charged for them.

### Pricing

Pay per event — no subscription, no YouTube API quota to buy:

| Event | Price |
|---|---|
| Actor start | $0.001 per run |
| Comment | $0.0005 per comment (**$0.50 / 1,000**) |

**Example:** 5 videos × 200 comments = 1,000 comments = $0.001 + $0.50 = **$0.501**.

### FAQ

**Do I need a YouTube API key?** No. No API key, no OAuth, no quota. Paste videos and run.

**Which comments does it return?** Top-level comments in YouTube's "Top comments" order, up to your `maxCommentsPerVideo` limit.

**Are replies included?** Not as rows in this version — but each comment carries `reply_count`, so high-engagement threads are easy to spot.

**Are like counts exact?** They are what YouTube displays ("1.2K"), parsed to a number (1200). The raw text is always included.

**What about videos with comments disabled?** You get an error row for that video, the rest of the run continues, and you're not charged for it.

**Does it work on Shorts?** Yes — Shorts URLs are accepted and their comments scraped the same way.

### Related actors

- [YouTube Transcript Scraper](https://apify.com/santhej/youtube-transcript-scraper) — full captions/subtitles of any video as clean text.
- [YouTube Channel Scraper](https://apify.com/santhej/youtube-channel-scraper) — subscribers, stats and every upload of any channel.
- [YouTube Channel Email Scraper](https://apify.com/santhej/youtube-channel-email-scraper) — contact emails and social links from channels.

*Tags: youtube comments scraper, youtube comment export, comment sentiment analysis, youtube api alternative, youtube comments to csv, audience research, social listening, youtube engagement data, comment likes, bulk comment scraping*

# Actor input Schema

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

Videos to scrape comments from, one per line: watch URLs, youtu.be links, Shorts URLs or bare 11-character video IDs. Max 100 per run.

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

How many top-level comments to return per video (10–5000). Replies are not fetched; each comment row still reports its reply\_count.

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

Residential proxy is recommended to avoid YouTube IP blocks.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

One record per video with transcript text and metadata.

## `summary` (type: `string`):

Counts of videos processed and transcripts returned.

# 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"
    ],
    "maxCommentsPerVideo": 50
};

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

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

```

## MCP server setup

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