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

Scrape YouTube comments and replies: text, author, channel, likes, reply count, pinned/hearted flags and date. Videos and Shorts. No API key, no login.

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

## Pricing

from $1.00 / 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 & Authors

Scrape **YouTube comments** and replies from any public video or Short. Each row has the comment text, author handle and channel ID, like count, reply count, pinned and hearted-by-creator flags, whether the author is the video's channel, relative and approximate date, and a direct comment link. Top or newest order. No YouTube API key, no quota, no login.

### Why this YouTube comments scraper

- **No API key, no quota.** Reads the same comment data YouTube's web player loads.
- **Replies included (optional).** Thread replies with `parentCommentId`, capped per comment.
- **Creator signals.** `isPinned`, `isHeartedByCreator` and `authorIsChannelOwner` make it easy to find what the creator engaged with.
- **Videos and Shorts.** Paste watch, youtu.be, /shorts/ or /live/ links, or bare video IDs.
- **Fair pricing.** $0.001 per comment + $0.002 per run. 1,000 comments cost about $1.

### Use cases

- **Audience research and sentiment**: what viewers love or hate about a product, creator or ad.
- **Brand and competitor monitoring**: track comments on competitor launches and reviews.
- **Lead generation**: find commenters asking for a product or service.
- **AI and RAG**: feed real comment threads to an LLM for summaries or topic mining.

### Input examples

50 top comments on one video:

```json
{ "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"], "maxComments": 50 }
```

Newest comments on several videos and Shorts:

```json
{ "videoUrls": ["https://youtu.be/9bZkp7q19f0", "https://www.youtube.com/shorts/VIDEO_ID"], "maxComments": 200, "sortBy": "newest" }
```

Comments with replies:

```json
{ "videoUrls": ["dQw4w9WgXcQ"], "maxComments": 300, "includeReplies": true, "maxRepliesPerComment": 10 }
```

### Sample output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "channelName": "Rick Astley",
  "commentId": "UgwPwTibxdgqCHZxktd4AaABAg",
  "text": "My algebra teacher said that this was a link to the test answers",
  "author": "@bdr8823",
  "authorChannelId": "UCdi6tGxvFvTRGe-7dAn7m7w",
  "authorUrl": "https://www.youtube.com/channel/UCdi6tGxvFvTRGe-7dAn7m7w",
  "authorIsChannelOwner": false,
  "authorIsVerified": false,
  "likeCount": 72000,
  "likeCountText": "72K",
  "replyCount": 691,
  "publishedTimeText": "7 years ago",
  "publishedAtApprox": "2019-11-13T17:33:54Z",
  "edited": false,
  "isPinned": false,
  "isHeartedByCreator": false,
  "isReply": false,
  "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=UgwPwTibxdgqCHZxktd4AaABAg",
  "videoCommentCountText": "2,462,121 Comments",
  "scrapedAt": "2026-11-13T17:33:54Z"
}
```

### FAQ

**Do I need a YouTube Data API key?** No, and there is no 10,000-unit daily quota.

**Are like counts exact?** YouTube shows rounded counts for popular comments (e.g. 73K); we return both the number and the text.

**Why is the date approximate?** YouTube only shows relative dates ("7 years ago"); `publishedAtApprox` converts that to a timestamp.

**Do replies count toward maxComments?** Yes, so your cost stays predictable.

**What if comments are turned off?** The video is skipped with a log message and you are not charged for it.

# Actor input Schema

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

YouTube video or Shorts links (watch?v=, youtu.be/, /shorts/) or 11-character video IDs.

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

Maximum comments per video (replies count toward it). Default 50 = about $0.05 per video.

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

Comment order.

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

Also scrape replies under each comment.

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

Used when replies are on.

## `maxResults` (type: `integer`):

Optional overall cap across all videos. 0 = no cap.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxComments": 50,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "maxResults": 0
}
```

# Actor output Schema

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

All records from this run in the default dataset, shown with 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"
    ],
    "maxComments": 50
};

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

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

```

## MCP server setup

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