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

Scrape YouTube comments and replies from videos and Shorts in bulk: comment text, author, likes, reply count, publish time, pinned and creator-heart flags. Sort by top or newest, filter by date, export to CSV, JSON or Excel. No API key or login.

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

## Pricing

from $0.70 / 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

## YouTube Comments Scraper: Replies, Likes & Authors

**YouTube Comments Scraper** extracts comments and replies from any YouTube video or Short. You get the comment text, author, author channel, likes, reply count, publish time, and pinned and creator-heart flags. Sort by **Top comments** or **Newest first**, keep only recent comments, and export everything to **JSON, CSV, Excel, HTML or XML**.

You don't need a YouTube account, Google API key or quota. It's a fast **YouTube Data API alternative** for comment analysis, sentiment research and audience insights.

### What does YouTube Comments Scraper do?

- 💬 **Scrape and download YouTube comments** in bulk from video URLs (`watch?v=`, `youtu.be/`, `/live/`), Shorts URLs (`/shorts/`) or plain video IDs.
- ↩️ **Scrape replies** as separate items, each linked to its parent comment with `replyToCid`.
- 🔃 **Sort** by top comments or newest first, just like on YouTube.
- 📅 **Filter by date** to keep only comments from the last N days or since a given date.
- 📌 **Detect pinned comments, creator hearts and channel-owner replies.**
- ⚡ **Run fast and cheap:** no browser, thousands of comments per minute.

### What YouTube comment data can you extract?

| Field | Description |
|---|---|
| `comment` | Full comment text |
| `cid` | Comment ID |
| `type` | `comment` or `reply` |
| `replyToCid` | Parent comment ID (for replies) |
| `author`, `authorChannelId`, `authorChannelUrl`, `authorAvatarUrl` | Who wrote it |
| `authorIsChannelOwner`, `authorIsVerified`, `authorIsArtist` | Author badges |
| `voteCount` | Likes on the comment |
| `replyCount` | Number of replies |
| `publishedTimeText`, `isEdited` | When it was posted, as shown on YouTube ("3 days ago") |
| `isPinned`, `hasCreatorHeart` | Pinned by the creator / hearted by the creator |
| `videoId`, `title`, `pageUrl`, `commentsCount` | The video the comment belongs to |

### How to scrape and download YouTube comments

1. Click **Try for free**.
2. Paste one or more **YouTube video or Shorts URLs**.
3. Set **Max comments per video** and choose the **sort order**.
4. Optionally turn on **Include replies** and set a **date filter**.
5. Click **Start**, then download the comments or send them to your tools.

#### Input example

```json
{
  "startUrls": [
    { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    { "url": "https://www.youtube.com/shorts/-jOxfEwifis" }
  ],
  "maxComments": 500,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeReplies": true,
  "maxRepliesPerComment": 20
}
```

#### Output example

```json
{
  "cid": "UgzKYksqeQ5gA3t0g0F4AaABAg",
  "type": "comment",
  "comment": "I Rick rolled my entire French class because we had to study a city in France...",
  "author": "@grustache4569",
  "authorChannelId": "UCKrzgYonJnMd0Dk7zQXjYXw",
  "authorIsChannelOwner": false,
  "voteCount": 108000,
  "replyCount": 692,
  "replyToCid": null,
  "publishedTimeText": "6 years ago",
  "isEdited": true,
  "isPinned": false,
  "hasCreatorHeart": false,
  "videoId": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "pageUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "commentsCount": 2400000
}
```

If a video can't be scraped, you get an error item instead of a silent gap: `INVALID_INPUT`, `VIDEO_UNAVAILABLE`, `COMMENTS_TURNED_OFF`, `NO_COMMENTS`, `NOT_FOUND` or `BLOCKED`. **Error items are never charged.**

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

You pay per comment or reply saved. Proxies and platform usage are included.

| Apify plan | Price per 1,000 comments |
|---|---|
| Free | $1.50 |
| Starter (Bronze) | $1.20 |
| Scale (Silver) | $1.00 |
| Business (Gold) | $0.70 |
| Platinum | $0.70 |
| Diamond | $0.70 |

On the Free plan, Apify's monthly free credits cover about 3,300 comments. Set a **maximum cost per run** and the scraper stops cleanly when it's reached.

### Why use this YouTube comments scraper?

- **No YouTube API quota:** no API key, no Google Cloud project and no daily limit.
- **Complete threads:** replies are linked to their parent with `replyToCid`, and pinned comments, creator hearts and channel-owner replies are flagged.
- **Reliable:** blocked requests are retried automatically, and failed videos are reported as error items rather than missing rows.

### Use cases for YouTube comments

- **Sentiment analysis:** measure how viewers react to a product launch, ad or creator.
- **Audience research:** find the questions, pain points and language your audience uses.
- **Brand and competitor monitoring:** track mentions in comments under competitors' videos.
- **Influencer vetting:** check comment quality and engagement before a sponsorship.
- **AI training and RAG:** collect real conversational text for LLM pipelines and classifiers.

### YouTube Comments API: Python and JavaScript examples

You can call YouTube Comments Scraper from your own code with the [Apify API](https://docs.apify.com/api/v2) or the official clients.

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("api_creators/youtube-comments-scraper").call(run_input={
    "startUrls": [{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}],
    "maxComments": 1000,
})
for c in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(c["author"], c["voteCount"], c["comment"][:80])
```

**JavaScript:**

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('api_creators/youtube-comments-scraper').call({
    startUrls: [{ url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }],
    maxComments: 1000,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

You can connect results to **Google Sheets, Make, Zapier, n8n, Slack** and more through [Apify integrations](https://apify.com/integrations), or call the scraper from AI agents through the Apify MCP server.

**Need video data too?** [YouTube Scraper](https://apify.com/api_creators/youtube-scraper) gets views, likes, durations and channel stats, and can attach comments to each video.

### FAQ

#### Do I need a YouTube API key?

No. The scraper reads the same public comments any logged-out visitor sees. There's no API key or quota.

#### Can I scrape comments from many videos at once?

Yes. Add as many video or Shorts URLs as you like. They're processed in parallel (**Max concurrency**, 20 by default), and every comment includes `videoId` and `title`, so you can tell them apart.

#### How many comments can I scrape from one video?

Set **Max comments per video** (up to 1,000,000). The scraper collects as many as YouTube makes available for that video. If **Include replies** is on, replies come on top of this limit.

#### Do I need proxies to scrape YouTube comments?

No. Proxies are built in and included in the price.

#### Are like counts exact?

YouTube shows logged-out visitors exact like counts up to 999 and rounded figures above that (for example "25K"). The scraper converts those to numbers (25000).

#### Why are dates relative ("3 weeks ago")?

That's how YouTube displays comment times. The date filter uses them, so it's accurate to the unit shown (days, weeks, months).

#### Can I scrape comments from Shorts?

Yes. Paste the `/shorts/` URL like any other video.

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

The scraper collects only publicly available data and doesn't log in. Comments contain personal data, such as usernames, which is protected by the GDPR in the EU and by other laws around the world. Don't scrape it without a legitimate reason, and consult a lawyer if you're unsure. See [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

#### Something didn't work as expected?

Open an issue in the **Issues** tab and include the run link.

# Actor input Schema

## `startUrls` (type: `array`):

Videos or Shorts to scrape comments from: watch?v=, youtu.be/, /shorts/ or /live/ links, or plain 11-character video IDs.

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

Top-level comments to collect from each video. Replies (if enabled) don't count toward this limit.

## `sortCommentsBy` (type: `string`):

Same as YouTube's comment sort menu.

## `oldestCommentDate` (type: `string`):

Absolute date (YYYY-MM-DD) or relative like "7 days". With newest-first sorting the scraper stops as soon as it reaches older comments. Ages come from YouTube's relative times ("3 weeks ago"), so the cutoff is approximate.

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

Also scrape replies to each comment. Each reply is a separate dataset item with replyToCid pointing to its parent.

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

Limit replies collected for each comment.

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

Videos processed in parallel.

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

Leave empty to use the built-in proxies (included in the price). Custom proxy URLs entered here replace the residential one.

## `lightProxyConfiguration` (type: `object`):

Comment pages are requested through this cheaper proxy. Apify datacenter proxy works well; change it only if you have a reason to.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxComments": 100,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "maxConcurrency": 20,
  "lightProxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One item per comment or reply. Inputs that could not be scraped appear as error items.

## `overview` (type: `string`):

Main comment fields in a table view.

## `summary` (type: `string`):

Comments scraped, speed and traffic.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
        }
    ],
    "maxComments": 100,
    "lightProxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("api_creators/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 = {
    "startUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],
    "maxComments": 100,
    "lightProxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("api_creators/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 '{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxComments": 100,
  "lightProxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call api_creators/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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