# YouTube Comments Scraper: Export to CSV or Excel (`leathered_latch/youtube-comments-scraper`) Actor

Export YouTube comments for any video: text, likes, reply count, date and a direct link. Top comments first, up to 2,000 per video. Names off by default. Pay per comment.

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

## Pricing

$1.40 / 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: comment text, likes and replies

Paste a video and get its comments back, one row each: the full text, when it was posted, likes, reply count and a direct link to the comment. Top comments first, in YouTube's own order. Up to 2,000 per video.

Commenter names are left out by default. You get what people said, which is what most comment analysis needs. If you have a lawful reason to need names, there's a switch for it.

Videos with comments turned off, missing videos and duplicates cost nothing.

### What you get

| Field | Example |
|---|---|
| `text` | Gonna flag this for nudity so I can rick roll the YouTube staff |
| `published` | 6 years ago |
| `likes` | 568K |
| `replyCount` | 715 |
| `isCreator` | false (true when the channel owner commented) |
| `commentId` | UgyEnXfdC-umwvTt8JF4AaABAg |
| `url` | link straight to the comment |
| `author` | null unless you turn names on |

#### Sample output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "commentId": "UgzKYksqeQ5gA3t0g0F4AaABAg",
  "author": null,
  "authorChannelId": null,
  "text": "I Rick rolled my entire French class because we had to study a city in France...",
  "published": "6 years ago (edited)",
  "likes": "104K",
  "replyCount": "595",
  "isCreator": false,
  "isVerified": false,
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgzKYksqeQ5gA3t0g0F4AaABAg"
}
```

### Quick start

1. Paste video links or 11-character video IDs into **Videos**, one per line.
2. Set **Max comments per video** (1 to 2,000).
3. Click **Start**.

The default input pulls 50 top comments from one well-known video and runs as-is.

### Use cases

- Read what viewers ask and complain about on your own videos, and on a competitor's.
- Run sentiment or topic analysis on the top comments of a product launch or review video.
- Mine questions for your next video or FAQ page.
- Spot when the creator replies, using `isCreator`.

### What happens when something goes wrong

A video with comments off, a deleted video or a bad link returns 0 rows and isn't charged. Paste the same video twice and you pay once. `RUN_SUMMARY` in the run's key-value store says what happened to each video.

### Pricing

Pay per comment delivered, plus Apify's small start fee per run. Set a maximum cost per run and the scraper stops at your limit.

### FAQ

**Why are likes "104K" and not exact?**
That's how YouTube shows comment likes to logged-out visitors. We pass them through as shown.

**Why is `author` empty?**
Names are off by default to keep personal data out of your dataset. Turn on **Include author names** if you need them.

**Does it get replies?**
It gives the reply count for each top-level comment. The reply text itself isn't collected.

**Something broke?**
Open an issue with the video link. I answer within a day.

### Limitations

- Top-level comments only, in YouTube's "Top comments" order.
- `published` is relative ("6 years ago"), the way YouTube shows it.
- Comment text is the commenter's own words. Quote it fairly; check before republishing it word for word.

### Export or use as an API

Download any run's results from the **Storage** tab as CSV, Excel, JSON or XML.

To call it from your own code, send your input to Apify's API and get the rows back in one request:

```
POST https://api.apify.com/v2/acts/leathered_latch~youtube-comments-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN
```

It also plugs into Make, Zapier and n8n through Apify's integrations, and AI agents can find and run it through Apify's MCP server.

### Your responsibility

How you use the output is your call, and so is the legal side of it. Copyright still covers any text you republish. If you turn on author names, treat them as personal data: if you store or publish them, privacy law (GDPR, CCPA and similar) applies to you. YouTube's own terms apply too. If you're unsure about a use, check with a lawyer first.

If you own content that shows up in these results and want it handled differently, open an issue on the Issues tab. We answer within 14 days.

### Data source and credit

Every row comes from YouTube (Google LLC). We don't own this data, and we don't take credit for it. The comments belong to the people who wrote them.

This tool reads only what YouTube shows to any logged-out visitor. No logins, no private data. Each row keeps a link back to the comment (the `url` field), so you can check any result and credit the source when you use it.

Not affiliated with, endorsed by or sponsored by YouTube or Google. All names and trademarks belong to their owners.

### Changelog

- **0.2** Author names off by default (`includeAuthor`).
- **0.1** First release.

# Actor input Schema

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

YouTube video links or 11-character IDs, one per line.

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

1 to 2,000. Top comments first (YouTube's default order).

## `includeAuthor` (type: `boolean`):

Off by default. Author names and IDs are personal data; turn this on only if you have a lawful reason to store them.

## Actor input object example

```json
{
  "videos": [
    "dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 50,
  "includeAuthor": false
}
```

# 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 = {
    "videos": [
        "dQw4w9WgXcQ"
    ]
};

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

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

```

## MCP server setup

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