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

Scrape comments and replies from any YouTube video or Short: text, author, likes, reply count, pinned and hearted flags, sorted by top or newest. No login or API key.

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

## Pricing

$0.50 / 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 & likes

Extract comments from any **public YouTube video or Short** — no YouTube account, no API key, no daily quota. Paste video links and get clean, structured data: comment text, author name and channel link, like count, reply count, publish time, and whether the comment is pinned or hearted by the creator. Turn on *Include replies* to get the full conversation.

**Pay only for what you get: $0.50 per 1,000 comments.** No monthly rental, no start fees.

### What can you do with it?

- 💬 **Audience research** — read what viewers actually say about a product, topic or competitor, sorted by the most liked comments.
- 📈 **Sentiment analysis & AI pipelines** — feed thousands of comments into your LLM, BI tool or spreadsheet to find pain points, questions and feature requests.
- 🔔 **Monitor new comments** — sort by *Newest first* and run on a schedule to catch fresh questions, complaints or spam on your own videos.
- 🎯 **Find engaged fans and creators** — every comment comes with the author's channel link, verified badge and like count.
- 🏆 **Run giveaways** — export every commenter of a video, then pick winners fairly.
- 🧪 **Academic and market research** — collect public discussions around videos for analysis.

### How to use

1. Add one or more videos: `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, `https://youtu.be/dQw4w9WgXcQ`, `https://www.youtube.com/shorts/CEJXqm2eiJ0`, or just the video ID `dQw4w9WgXcQ`.
2. Choose how many comments you want per video, the sort order (*Top comments* or *Newest first*) and whether to include replies.
3. Click **Start**. Download the results as JSON, CSV, Excel or HTML, or connect them to Make, Zapier, n8n, Google Sheets or your API.

### Input example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/CEJXqm2eiJ0"
  ],
  "maxCommentsPerVideo": 500,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 10
}
```

### Output example

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelTitle": "Rick Astley",
  "commentId": "Ugzge340dBgB75hWBm54AaABAg",
  "text": "can confirm: he never gave us up",
  "author": "@YouTube",
  "authorChannelId": "UCBR8-60-B28hp2BmDPdntcQ",
  "authorUrl": "https://www.youtube.com/@YouTube",
  "authorAvatarUrl": "https://yt3.ggpht.com/3s6evpqAiDU9tQR4sC2siJippbH2RWVPnwHgyl4V0th2iuQz0VDQZbUhQBGmsxLYo-mjG6TqZQ=s88-c-k-c0x00ffffff-no-rj",
  "isVerifiedAuthor": true,
  "isChannelOwner": false,
  "likes": 325000,
  "replyCount": 962,
  "publishedTimeText": "1 year ago",
  "isEdited": false,
  "isPinned": true,
  "isHearted": true,
  "isReply": false,
  "parentCommentId": null,
  "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugzge340dBgB75hWBm54AaABAg",
  "scrapedAt": "2026-10-09T15:20:00+00:00"
}
```

A reply looks the same, with `"isReply": true` and `"parentCommentId": "Ugzge340dBgB75hWBm54AaABAg"`.

#### All fields

| Field | Description |
|---|---|
| `videoId`, `videoUrl`, `videoTitle`, `channelTitle` | The video the comment belongs to |
| `commentId`, `commentUrl` | Unique comment ID and a direct link that opens the video with the comment highlighted |
| `text` | Full comment text with line breaks and emoji |
| `author`, `authorChannelId`, `authorUrl`, `authorAvatarUrl` | Commenter's handle, channel ID, channel link and profile picture |
| `isVerifiedAuthor` | The commenter has a verified badge |
| `isChannelOwner` | The comment was written by the video's creator |
| `likes` | Like count as a number (YouTube shows rounded values, e.g. `1.2K` → `1200`) |
| `replyCount` | Number of replies to the comment |
| `publishedTimeText`, `isEdited` | Relative publish time as shown on YouTube (e.g. `2 days ago`) and edit flag |
| `isPinned`, `isHearted` | Pinned by the creator / got a creator heart ❤ |
| `isReply`, `parentCommentId` | `true` for replies, with the ID of the comment being replied to |
| `scrapedAt` | When the comment was collected (ISO 8601, UTC) |

### Pricing

Pay-per-result: **$0.0005 per comment** ($0.50 per 1,000 comments). Replies are counted as comments. Platform usage is included. Cap the cost of any run with *Max total charge* in the run options — the scraper stops cleanly when the cap is reached.

### FAQ

**Do I need a YouTube account, API key or quota?** No. The scraper reads the same public comments anyone can see in a browser. There is no YouTube Data API quota to worry about.

**Does it work with Shorts and live streams?** Yes. Shorts URLs, `youtu.be` links, live and embed URLs and plain video IDs are all accepted. Live chat messages are not comments and are not included.

**Can I get all comments of a video?** Yes — set *Max comments per video* to `0`. Very large videos have millions of comments, so use *Max total charge* to stay within budget. YouTube itself may stop serving very old comments deep in the list.

**Why don't I get exact like counts?** YouTube only shows rounded numbers for popular comments (e.g. `325K`). We convert them to integers; small counts are exact.

**Why is the date relative ("2 days ago")?** That's what YouTube shows publicly. Use `scrapedAt` together with `publishedTimeText` to estimate the date.

**What happens with removed, private or comment-disabled videos?** They are skipped with a clear warning in the log, and the rest of the run continues. You are not charged for them.

**Is it legal?** It collects only publicly available information. You are responsible for using the data in line with YouTube's terms and the laws that apply to you, including data-protection rules such as GDPR when you process personal data like commenter names.

### Related tools by DataKiln

- [Telegram Channel Scraper — posts, views & reactions from public channels](https://apify.com/datakiln/telegram-channel-scraper)
- [YouTube Channel Email Finder — creator emails, socials & stats](https://apify.com/datakiln/youtube-channel-email-finder)
- [Podcast Email Finder — host emails from Apple Podcasts RSS feeds](https://apify.com/datakiln/podcast-email-finder)
- [TikTok Profile & Email Finder — bio, stats & contacts](https://apify.com/datakiln/tiktok-profile-email-finder)
- [Website Contact Extractor — emails, phones & socials from any website](https://apify.com/datakiln/website-contact-extractor)

### Support

Found a bug or need a field that's missing? Open an issue on the **Issues** tab — we usually reply within 24 hours.

# Actor input Schema

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

YouTube videos to scrape. Paste watch URLs (https://www.youtube.com/watch?v=…), youtu.be links, Shorts URLs (https://www.youtube.com/shorts/…), live URLs or plain 11-character video IDs.

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

How many comments to save from each video, replies included. Set 0 to get all comments.

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

'Top comments' returns the most liked/relevant comments first (like YouTube's default). 'Newest first' returns the latest comments first — best for monitoring.

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

Also save the replies to each comment. Replies are returned as separate items with isReply = true and parentCommentId, right after their parent comment, and count toward the per-video limit.

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

When replies are included: how many replies to save for each comment. Keeps a single viral thread from using up the whole per-video limit. Set 0 to get all replies.

## `maxConcurrency` (type: `integer`):

How many videos and requests to process at the same time.

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

Not required — YouTube comments work without a proxy. Turn on Apify Proxy only if you see blocking on very large runs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 100,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "maxConcurrency": 5
}
```

# Actor output Schema

## `comments` (type: `string`):

All scraped comments and replies as structured JSON items.

## `commentsTable` (type: `string`):

Comments in the overview table view.

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

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

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

```

## MCP server setup

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