# YouTube Comments Scraper: Comments, Replies and Likes (`talcoe/youtube-comments`) Actor

This YouTube comments scraper takes video URLs and returns one record per comment with text, author, likes, reply count, pinned and hearted flags, sorted top or newest, with optional replies.

- **URL**: https://apify.com/talcoe/youtube-comments.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (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

from $3.00 / 1,000 results

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

### What does YouTube Comments Scraper: Replies, Likes and Authors do?

You paste video links. You get a table with one row per comment: the text, who wrote it, how many likes it has, how many replies sit under it, and when it was posted. Each row also says whether the comment is pinned, whether the creator hearted it, and whether it is a reply to another comment. Pick top or newest order, switch replies on or off, and set a limit per video so a run stays small. Pricing is per result.

### Data source

The Actor reads the public comment feed that YouTube serves to any visitor of a video page, with no login, so you see the comments as they are right now.

### Why use it?

- Brand and product monitoring: pull the newest comments on your videos or a competitor's and see what people say.
- Audience research: find the questions people ask most, sorted by likes.
- Creator outreach: spot the commenters with the most likes and open their channel from the author link.
- Moderation and support: export a video's comments to a sheet and work through them in one place.

It replaces copying comments by hand, and it saves you from keeping a browser extension running.

### How to use it

1. Open the Actor and add one or more video links.
2. Choose top or newest, decide on replies, and set the limit per video.
3. Click Start. Download results as JSON, CSV or Excel, or read them through the API.
4. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to get new comments on a timer.

### Input

| Field | Description |
|---|---|
| `videoUrls` | Watch links, youtu.be links, shorts links or 11 character video ids. Many videos per run. |
| `sortBy` | `top` (YouTube's featured order, the default) or `newest`. |
| `includeReplies` | Also return the replies under each comment. Replies count toward the limit and are billed as results. |
| `maxCommentsPerVideo` | Stop after this many records for each video. Default 50. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Apify proxy is recommended for larger runs. |

Example input:

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

### Output

Every record has the same shape:

```json
{
    "id": "Ugxzbv_ZeZXNRcfwsSF4AaABAg",
    "videoId": "dQw4w9WgXcQ",
    "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "commentId": "Ugxzbv_ZeZXNRcfwsSF4AaABAg",
    "text": "Is everyone going to ignore the fact that Rick Astley looks like a twelve year old boy but has a uniquely deep voice?",
    "authorName": "@candycake9531",
    "authorChannelId": "UCNLgzvqrGzFi5SEAbVkFchg",
    "authorChannelUrl": "https://www.youtube.com/@candycake9531",
    "likes": 293000,
    "likesText": "293K",
    "replyCount": 736,
    "publishedTimeText": "7 years ago",
    "publishedAtApprox": "2019-11-23T03:29:31.867Z",
    "isEdited": false,
    "isReply": false,
    "parentId": null,
    "isPinned": false,
    "isHearted": false,
    "isByCreator": false,
    "isVerified": false,
    "commentUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&lc=Ugxzbv_ZeZXNRcfwsSF4AaABAg",
    "scrapedAt": "2026-11-21T03:29:31.868Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Stable key, safe for deduplication between runs. Same as `commentId`. |
| `text` | The comment text. |
| `authorName`, `authorChannelUrl` | The commenter's handle and channel link. |
| `likes`, `likesText` | Like count. YouTube rounds large counts (293K), so `likes` is the rounded number and `likesText` is what the page shows. |
| `replyCount` | Replies under a top level comment. |
| `publishedTimeText` | Time as YouTube shows it ("3 months ago"). |
| `publishedAtApprox` | A date estimated from that text. Accuracy is as coarse as the text. |
| `isReply`, `parentId` | Whether it is a reply, and the top level comment it belongs to. |
| `isPinned`, `isHearted`, `isByCreator` | Pinned by the creator, hearted by the creator, written by the video's channel. |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per result returned. Set `maxCommentsPerVideo` and `maxResults` to cap any run.

### Limitations

- YouTube shows relative times only, so exact post dates are not available.
- Videos with comments turned off, and private or removed videos, return nothing. The run log names them.
- Like counts above 1,000 are rounded by YouTube.
- Comments held for review or hidden by the creator are not public and are not included.

### FAQ

**Is this legal?** The Actor reads comments that YouTube shows to any visitor without a login. You are responsible for how you use the data, including any personal data in it.

**Can I get all comments on a very popular video?** Set a high `maxCommentsPerVideo`. Runs on large videos take longer, so use Apify proxy for those.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

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

YouTube video links (watch, youtu.be, shorts or embed) or 11 character video ids. One run can cover many videos.

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

Top returns the featured order YouTube shows by default. Newest returns the most recent comments first.

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

Also return the replies under each comment. Replies count toward the per video limit and each one is billed as a result.

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

Stop after this many records for each video, replies included.

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

Hard stop for the whole run. You are billed per result, so this caps the cost.

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

Apify proxy is recommended for larger runs. Residential or datacenter both work for most videos.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "sortBy": "top",
  "includeReplies": false,
  "maxCommentsPerVideo": 50,
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "sortBy": "top",
    "includeReplies": false,
    "maxCommentsPerVideo": 50,
    "maxResults": 200,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/youtube-comments").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"],
    "sortBy": "top",
    "includeReplies": False,
    "maxCommentsPerVideo": 50,
    "maxResults": 200,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/youtube-comments").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"
  ],
  "sortBy": "top",
  "includeReplies": false,
  "maxCommentsPerVideo": 50,
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/youtube-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,talcoe/youtube-comments"
        }
    }
}
```

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/ogCr9nY1bdXXcAi9R/builds/zy3vVZl9r8wClqFcw/openapi.json
