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

Scrape YouTube comments and replies from any video: text, author, likes, reply count, date, pinned and creator heart, as a clean table. No API key or quota.

- **URL**: https://apify.com/jclabs/youtube-comments-scraper.md
- **Developed by:** [Julián Camilo López Sánchez](https://apify.com/jclabs) (community)
- **Categories:** Videos, Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.45 / 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?

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 is YouTube Comments Scraper?

YouTube Comments Scraper extracts **YouTube comments** from a list of videos. For every comment you get its **text, author, likes, number of replies, date, and whether the creator pinned it or gave it a heart**, and, if you want, **its replies right below it**. Counts come as numbers and dates as dates, ready to sort, filter or feed to an AI model.

Paste the videos as you copy them from YouTube, choose how many comments you want and in which order, and click **Start**. Download the results as **JSON, CSV, Excel, XML, HTML or RSS**, or read them through the **API**. Apify's Free plan gives you $5 of credit every month, enough for about 5,000 comments at no cost.

- Paste links, Shorts links, embed links or video IDs, in any mix: `https://www.youtube.com/watch?v=jNQXAC9IVRw`, `https://youtu.be/jNQXAC9IVRw` or `jNQXAC9IVRw`.
- Choose **Top comments** or **Newest first**, and how many replies to bring under each comment.
- Run it without a YouTube account, an API key or the daily quota of the YouTube Data API.
- Schedule it, start it from your code, or send the results to Make, Zapier, n8n and AI agents.

### What data can you extract from YouTube comments?

Each comment, and each reply, is one row with these 22 fields:

| Field | Description |
| --- | --- |
| `input` | The video as you wrote it in your list |
| `videoId` | The 11-character YouTube video ID |
| `videoTitle` | The video title |
| `position` | Place of the comment in its video, starting at 1. A reply carries the place of its comment |
| `replyPosition` | Place of the reply under its comment, starting at 1. Empty for a comment |
| `commentId` | YouTube's ID for the comment |
| `parentCommentId` | For a reply, the ID of the comment it answers. Empty for a comment |
| `url` | Link that opens the video with this comment highlighted |
| `text` | The comment in full, with its line breaks and emoji |
| `author` | The author's @handle |
| `authorChannelId` | The author's channel ID |
| `authorUrl` | Link to the author's channel |
| `authorAvatar` | Link to the author's profile picture |
| `authorVerified` | `true` if the author has YouTube's verified badge |
| `authorIsCreator` | `true` if the author is the channel that uploaded the video |
| `likes` | Likes as a number: `4800000`, not "4.8M" |
| `replies` | Replies to the comment as a number. Empty for a reply |
| `published` | How long ago it was posted, as YouTube says it: "2 months ago" |
| `publishedDate` | Date it was posted (see Limitations) |
| `edited` | `true` if YouTube marks the comment as edited |
| `pinned` | `true` if the creator pinned the comment to the top |
| `heartedByCreator` | `true` if the creator gave the comment a heart |

### How to scrape YouTube comments

1. Click **Try for free** at the top of this page and sign in to Apify. A free account is enough.
2. Under **Videos**, paste one or more videos, one per line.
3. If you want, change **Comments per video** (100 by default), the **Order** and **Replies per comment** (none by default).
4. Click **Start**. A thousand comments usually take less than a minute.
5. Open the **Output** tab to see the comments, then export them in the format you need.

### How much does it cost to scrape YouTube comments?

You pay **$1 per 1,000 comments** delivered, which is $0.001 per comment. A reply counts as a comment. There is no fee per run or per video, and a video that doesn't exist or has its comments turned off is not charged.

| Comments | Cost |
| --- | --- |
| 100 | $0.10 |
| 1,000 | $1 |
| 10,000 | $10 |
| 100,000 | $100 |

Paid Apify plans pay less for every comment:

| Apify plan | Per 1,000 comments |
| --- | --- |
| Free | $1 |
| Starter | $0.75 |
| Scale | $0.60 |
| Business | $0.45 |

Apify's Free plan includes $5 of credit every month, which covers about 5,000 comments. To cap your spending, set a maximum cost per run in the run options. The Actor stops as soon as it reaches that amount, you are never charged more, and the run log says which video it stopped short and how many were left out.

### Input

**Videos** is the only required field.

| Field | What it does | Default |
| --- | --- | --- |
| **Videos** (`videos`) | Videos to read, one per line: a link or an 11-character video ID | Required |
| **Comments per video** (`maxComments`) | The most rows to bring from each video, replies included, up to 100,000 | 100 |
| **Order** (`sort`) | `top` for YouTube's Top comments, `newest` for Newest first | `top` |
| **Replies per comment** (`repliesPerComment`) | How many replies to bring right after each comment. 0 brings none | 0 |

The same input in JSON, for runs started from the API:

```json
{
  "videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw", "https://youtu.be/0iSxQYgOPF4"],
  "maxComments": 50,
  "sort": "newest",
  "repliesPerComment": 5
}
```

### Output

Each comment is a row in the dataset, video by video in the order of your list, and each reply comes right after its comment. This is the pinned comment on the first video ever uploaded to YouTube:

```json
{
  "input": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "videoId": "jNQXAC9IVRw",
  "videoTitle": "Me at the zoo",
  "position": 1,
  "replyPosition": null,
  "commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "parentCommentId": null,
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgzuC3zzpRZkjc5Qzsd4AaABAg",
  "text": "We're so honored that the first ever YouTube video was filmed here!",
  "author": "@SanDiegoZoo",
  "authorChannelId": "UCC5NfQ6Mf0dq_eEwv4P_hWA",
  "authorUrl": "https://www.youtube.com/channel/UCC5NfQ6Mf0dq_eEwv4P_hWA",
  "authorAvatar": "https://yt3.ggpht.com/...",
  "authorVerified": true,
  "authorIsCreator": false,
  "likes": 4800000,
  "replies": 986,
  "published": "6 years ago",
  "publishedDate": "2020-11-22",
  "edited": false,
  "pinned": true,
  "heartedByCreator": true
}
```

A reply has the same fields, with `parentCommentId` set to the comment it answers and `replyPosition` set to its place under that comment. The same video written two ways, such as a link and its video ID, comes once and is charged once.

### Limitations

- **Top comments is YouTube's own selection.** On some videos it shows only a few featured comments. Choose **Newest first** to get every comment. In both orders a pinned comment stays at the top, as on YouTube.
- The count YouTube shows under a video includes replies, so it is usually higher than the number of comments.
- `likes` and `replies` are rounded the way YouTube shows them: 4.8M becomes 4,800,000.
- `publishedDate` is an estimate. YouTube only says "2 months ago", so the date is the day of the run minus that.
- A video that doesn't exist, is private, was removed or has its comments turned off has no rows and is not charged. The run log names each one. The first three read «not found», because YouTube doesn't tell a visitor without an account which of them it is. For the rest, the log gives the reason, in YouTube's own words when YouTube gives them («YouTube says: Comments are turned off.»).
- Comments that YouTube holds for review or that the creator hid are not shown to visitors, so they are not included.
- Only what YouTube shows without an account is read. Age-restricted videos show their comments only to signed-in viewers, so they come with no rows and are not charged.

### FAQ

#### Is it legal to scrape YouTube comments?

The Actor collects only public comments that YouTube shows to anyone, without logging in or getting around any block. Comments are personal data of the people who wrote them, and laws like the GDPR protect that data. Collect them only for a legitimate purpose, such as research or reading the feedback on your own videos, and ask a lawyer if you are unsure.

#### Can I use it as a YouTube comments API?

Yes. Every run can be started and read through the Apify API, and the **API** tab on this page has examples ready to copy in Python, JavaScript and cURL. Unlike the YouTube Data API, there is no daily quota and no Google project to set up.

#### Why did I get fewer comments than the count under the video?

The count includes replies, and on some videos **Top comments** shows only YouTube's featured comments. Choose **Newest first** and set **Replies per comment** to get as close as YouTube allows to the full count.

#### How do I get the comments of many videos at once?

Find the videos with [YouTube Search Scraper](https://apify.com/jclabs/youtube-search), or the latest videos of a channel with [YouTube Channel Scraper](https://apify.com/jclabs/youtube-channel-scraper), then paste their links or video IDs here, one per line.

#### What can I use YouTube comments for?

- Measure the reaction to a launch, a trailer or an ad with sentiment analysis.
- Find what viewers ask for in your niche: questions, complaints and ideas for the next video.
- Follow the feedback on your own videos, or on a competitor's, on a schedule.
- Build datasets for research or to train and evaluate AI models.
- Feed comments to an AI agent that summarizes, classifies or answers them.

### Support

Found a bug, or need a field that isn't there? Open an issue in the **Issues** tab with the input you used. The Actor is tested against YouTube every day, so a change on YouTube's side is spotted within a day.

# Actor input Schema

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

One video per line, as you copy it from YouTube: a link (https://www.youtube.com/watch?v=jNQXAC9IVRw, https://youtu.be/jNQXAC9IVRw, a Shorts or embed link) or its 11-character video ID. The same video written twice comes once.

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

The most rows to bring from each video, replies included. You pay only for the rows delivered.

## `sort` (type: `string`):

Top comments is YouTube's own pick of featured comments, which may leave many out. Newest first brings every comment, newest first. In both, a pinned comment stays at the top, as on YouTube.

## `repliesPerComment` (type: `integer`):

How many replies to bring right after each comment, in YouTube's order. 0 brings none. Replies count toward the comments per video and are charged as comments.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxComments": 100,
  "sort": "top",
  "repliesPerComment": 0
}
```

# Actor output Schema

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

One row per comment, video by video in the order of your list, with text, author, likes, replies, approximate date, pinned and creator heart.

# 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": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jclabs/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": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"] }

# Run the Actor and wait for it to finish
run = client.actor("jclabs/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": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ]
}' |
apify call jclabs/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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