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

Scrape comments from any public YouTube video without a login. Pass video URLs or IDs and get clean structured comment rows with author, like and reply counts, and text. Walks pagination up to your chosen limit.

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

## Pricing

from $0.30 / 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.
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

Scrape comments from any public YouTube video with no login and no API key. Pass video URLs or IDs and get clean, structured comment data: author, like count, reply count, full comment text, published time, and verified/creator flags. Pagination is walked automatically up to the limit you set.

### What it does

- **Extract comments by video.** Give it a watch link, a short link, a shorts link, or a bare 11 character video ID and it returns the full comment feed for that video.
- **Top or newest order.** Choose whether the most engaged comments or the most recent ones come first.
- **Deep pagination.** Walks page after page automatically until your `maxCommentsPerVideo` target is reached or the video runs out of comments.
- **Rich, normalized rows.** Every comment carries the author name, author channel, like count, reply count, whether the creator hearted it, verified and creator flags, published time, avatar, and the full comment text.
- **Multiple videos at once.** Queue a list of videos and process them in parallel.
- **Clean numeric counts.** Like and reply counts are returned as real integers (the original display form like "256K" is kept too).

No account, no password, no API key. Give it a list of videos and it returns structured rows ready for analysis or export to CSV, JSON, or Excel.

### Use cases

- **Audience research.** Read what viewers actually say under your videos or any channel in your niche to find recurring questions, objections, and language.
- **Sentiment and feedback monitoring.** Pull comments at scale to track reactions to a launch, a campaign, or a trending topic.
- **Lead generation.** Surface engaged commenters and their public channels for outreach lists.
- **Market and competitor analysis.** Mine the comment sections of videos in your market to understand demand, pain points, and what resonates.
- **Content ideation.** Find the most liked comments and the questions people ask most, then turn them into your next video or post.

### Input

| Field | Type | Description |
|---|---|---|
| `videos` | array | Video links or IDs to pull comments from. Full watch links, short links, shorts links, or bare 11 character IDs. Required. |
| `maxCommentsPerVideo` | integer | Cap on comments returned per video. Pagination is walked across pages until this is reached or the video has no more comments. Default 100. |
| `sortBy` | string | Comment order: `top` (most engaged first) or `newest` (most recent first). Default `top`. |
| `concurrency` | integer | How many videos to process in parallel. Default 5. |
| `proxyConfig` | object | Proxy settings. Residential proxy is the default and recommended option for the most reliable results. |

#### Example input

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

### Output

Each comment is one row. Example:

```json
{
  "type": "comment",
  "commentId": "UgxExampleCommentId",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgxExampleCommentId",
  "videoId": "dQw4w9WgXcQ",
  "videoTitle": "Example video title",
  "channelTitle": "Acme Channel",
  "authorName": "@example_user",
  "authorChannelId": "UCexampleChannelId",
  "authorChannelUrl": "https://www.youtube.com/channel/UCexampleChannelId",
  "likeCount": 1024,
  "replyCount": 12,
  "isHearted": false,
  "authorIsVerified": false,
  "authorIsCreator": false,
  "text": "An example comment.",
  "authorAvatar": "https://example.com/avatar.jpg",
  "publishedTimeText": "2 months ago",
  "likeCountText": "1K",
  "scrapedAt": "2026-01-01T00:00:00.000Z"
}
```

#### Key fields

- **`text`** is the full comment body.
- **`likeCount`** and **`replyCount`** are real integers. `likeCountText` keeps the original abbreviated display value (for example "256K") when one is shown.
- **`isHearted`** is true when the video's creator hearted the comment.
- **`authorIsVerified`** and **`authorIsCreator`** flag verified accounts and the channel owner.
- **`authorChannelUrl`** links straight to the commenter's public channel, handy for building outreach lists.
- **`url`** opens the comment in context on the video.

### FAQ

**Do I need a login, account, or API key?**
No. This scraper reads public comments only. There is nothing to sign in to and no key to manage.

**How many comments can I get per video?**
Set `maxCommentsPerVideo` to whatever you need. Pagination is walked across as many pages as required to reach your target. If a video has fewer comments than your cap, you get everything available.

**Is it free?**
Running the scraper uses Apify platform usage and any proxy you select, billed through your Apify account. Check the pricing tab on this page for the current model.

**How fast is it?**
Comments are paged continuously, and you can process several videos in parallel with the `concurrency` setting. Throughput depends on how many comments you request and your proxy.

**Which video link formats are supported?**
Full watch links, short links, shorts links, embed links, and bare 11 character video IDs all work.

**Why are some comments missing?**
Comments are only returned for videos that have comments enabled. Videos with comments turned off, or with no comments, return no rows for that video.

**Can I export the data?**
Yes. Results can be downloaded as JSON, CSV, or Excel, or pulled through the Apify API and integrations.

### Related actors

Part of the scraper suite by goat255:

- [YouTube Channel Scraper](https://apify.com/goat255/youtube-channel-scraper) - a channel's videos with metadata.
- [YouTube Transcript Scraper](https://apify.com/goat255/youtube-transcript-scraper) - transcripts and captions.

### Privacy

To improve our actors we collect anonymized usage telemetry (run stats and input patterns). No personal account data is collected.

# Actor input Schema

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

YouTube videos to pull comments from. Each entry is a full watch link, a short link, a shorts link, or a bare 11 character video ID. Example: https://www.youtube.com/watch?v=dQw4w9WgXcQ, https://youtu.be/dQw4w9WgXcQ, or dQw4w9WgXcQ.

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

Cap on comments returned per video. Pagination is walked across multiple pages until this is reached or the video has no more comments.

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

Comment order. Top puts the most engaged comments first. Newest puts the most recent first.

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

How many videos to process in parallel. Higher is faster but puts more load on proxies.

## `proxyConfig` (type: `object`):

Apify proxy. RESIDENTIAL is the default and recommended option for the most reliable results.

## Actor input object example

```json
{
  "videos": [
    "dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 100,
  "sortBy": "top",
  "concurrency": 5,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `comments` (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"
    ],
    "proxyConfig": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("goat255/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"],
    "proxyConfig": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("goat255/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"
  ],
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call goat255/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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