# YouTube Comments Scraper — Comments & Replies Export (`cleandata-tools/youtube-comments-scraper`) Actor

YouTube comments scraper. Export comments and replies from videos and shorts with author, likes, reply count, date, and pinned and hearted flags. No API key. $0.40 per 1,000 comments.

- **URL**: https://apify.com/cleandata-tools/youtube-comments-scraper.md
- **Developed by:** [CleanData Tools](https://apify.com/cleandata-tools) (community)
- **Categories:** Social media, Videos, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.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 — Comments & Replies Export

**YouTube comments scraper** for videos and Shorts. Paste video URLs and export every **comment and reply** with the **author**, **likes**, **reply count**, **date**, and whether the comment is **pinned** or **hearted** by the creator. No YouTube API key, no login, no quota.

**$0.40 per 1,000 comments** ($0.0004 each, replies included). No start fee. Videos with comments turned off are free.

### What you can use it for

- Sentiment analysis and audience research on your own or competitors' videos
- Find questions, complaints, and feature requests in the comments
- Export giveaway entries and pick winners
- Collect training data or feed comments to ChatGPT, Claude, or your own LLM
- Track creator engagement: pinned comments, hearts, channel-owner replies

### Input

| Field | Default | What to put |
| --- | --- | --- |
| YouTube video URLs or IDs | one example video | `youtube.com/watch?v=…`, `youtu.be/…`, `/shorts/…`, `/live/…`, `/embed/…`, or bare 11-character video IDs. |
| Max comments per video | 100 | Stop after this many items per video. Replies count toward the limit. |
| Sort comments by | Top comments | `top` (YouTube's ranking, pinned comment first) or `newest`. |
| Include replies | on | Also fetch the replies under each comment. |
| Max replies per comment | 20 | Cap per thread, so the per-video limit goes mostly to top-level comments. |
| Proxy | Apify Proxy | Leave the default. |

Example:

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=uXuQF_PPg5U",
    "https://www.youtube.com/shorts/ai1gIWacf0I"
  ],
  "maxComments": 500,
  "sortBy": "top",
  "includeReplies": true
}
```

### Output

One dataset item per comment or reply. Export as JSON, CSV, Excel, or through the API. A real item from a test run (avatar URL shortened):

```json
{
  "video_id": "uXuQF_PPg5U",
  "video_title": "Randomness is a lie. Let me explain",
  "video_channel": "Veritasium",
  "comment_id": "UgxI0Hz7VFA_L1Kmn4J4AaABAg",
  "comment_url": "https://www.youtube.com/watch?v=uXuQF_PPg5U&lc=UgxI0Hz7VFA_L1Kmn4J4AaABAg",
  "parent_comment_id": null,
  "is_reply": false,
  "text": "Go to http://hostinger.com/veritasium and use code VERITASIUM to grab an additional 10% on top of the current sale!",
  "author": "@veritasium",
  "author_channel_id": "UCHnyfMqiRRG1u-2MsSQLbXA",
  "author_channel_url": "https://www.youtube.com/channel/UCHnyfMqiRRG1u-2MsSQLbXA",
  "author_avatar_url": "https://yt3.ggpht.com/…",
  "author_is_verified": true,
  "author_is_channel_owner": true,
  "likes": 96,
  "likes_text": "96",
  "reply_count": 18,
  "published_time_text": "4 days ago",
  "published_at_approx": "2026-11-19T10:01:20Z",
  "is_edited": false,
  "is_pinned": true,
  "pinned_text": "Pinned by @veritasium",
  "is_hearted": false,
  "hearted_by": null,
  "super_thanks": null,
  "position": 1,
  "status": "ok",
  "charged": true
}
```

| Field | Notes |
| --- | --- |
| `is_reply`, `parent_comment_id` | Replies point to the comment they answer. |
| `likes` | A number. YouTube rounds large counts (`3.5K`), so `likes` is 3500 and `likes_text` keeps the original. |
| `published_at_approx` | YouTube only shows relative time ("4 days ago"), so this date is approximate. `published_time_text` is the original. |
| `is_pinned`, `is_hearted`, `hearted_by` | Creator signals. |
| `author_is_channel_owner` | The video's own channel wrote it. |
| `super_thanks` | The Super Thanks amount when the comment has one. |

A video that returns nothing is listed once with `status: "error"` and `charged: false`: `comments_disabled_or_none`, `blocked_by_youtube`, or `invalid_input`.

### Pricing

Pay per event. You pay only for comments you receive.

| Event | Price |
| --- | --- |
| `comment` (one comment or reply) | **$0.0004** |

1,000 comments = **$0.40**. 10,000 comments = **$4**. 100,000 comments = **$40**. Set **Maximum cost per run** in the run options to cap spend; the Actor stops cleanly when it is reached.

### FAQ

**Do I need a YouTube Data API key?** No. The Actor reads the public comments the YouTube website shows, so there is no API quota.

**Does it work on Shorts?** Yes. Paste the `/shorts/…` URL.

**Can I get all comments on a video?** Set *Max comments per video* to the video's comment count. Very large threads take longer; YouTube serves about 20 comments per page.

**Why can the number of comments differ from the count YouTube shows?** YouTube's count includes held-for-review and removed comments that nobody can read publicly.

**How fast is it?** In a test run on Apify (Nov 23, 2026), 180 comments and replies from 3 videos took under 10 seconds.

**Is this legal?** The Actor reads only public comments. You are responsible for how you use the data, including YouTube's Terms of Service and privacy rules such as GDPR for personal data in comments.

### Credits

Comment fetching is adapted from [egbertbouman/youtube-comment-downloader](https://github.com/egbertbouman/youtube-comment-downloader) (MIT License, © Egbert Bouman), with proxy rotation and extra fields added.

### Support

Open an issue on the Actor's **Issues** tab with the run ID and a video URL.

# Actor input Schema

## `urls` (type: `array`):

Video (watch, youtu.be, shorts, live, embed) URLs or bare 11-character video IDs.

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

Stop after this many items per video. Replies count toward the limit.

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

Top comments (YouTube's default ranking, pinned comment first) or newest first.

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

Also fetch replies under each comment. Replies have is_reply = true and parent_comment_id set.

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

Cap on replies fetched under each comment, so the per-video limit is spent mostly on top-level comments. Set high to get full threads.

## `concurrency` (type: `integer`):

How many videos to read at once.

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

Apify Proxy spreads requests over several IPs and rotates when YouTube rate-limits one. The default works for most runs.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=uXuQF_PPg5U"
  ],
  "maxComments": 100,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 20,
  "concurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One dataset item per comment or reply.

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

Counts of videos, comments, replies, and errors.

# 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=uXuQF_PPg5U"
    ],
    "maxComments": 100,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cleandata-tools/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 = {
    "urls": ["https://www.youtube.com/watch?v=uXuQF_PPg5U"],
    "maxComments": 100,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("cleandata-tools/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 '{
  "urls": [
    "https://www.youtube.com/watch?v=uXuQF_PPg5U"
  ],
  "maxComments": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call cleandata-tools/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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