# YouTube Comments Scraper - Export Video Comments & Replies (`pipiagent/youtube-comments-scraper`) Actor

Scrape comments and replies of any YouTube video or Short: text, likes, reply count, author, pinned and hearted flags and publish time. Top comments or newest first. For sentiment analysis and research. No API key, no quota, no login.

- **URL**: https://apify.com/pipiagent/youtube-comments-scraper.md
- **Developed by:** [Frank0306](https://apify.com/pipiagent) (community)
- **Categories:** Social media, Videos, AI
- **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 results

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

Export the comments of any [YouTube](https://www.youtube.com) video or Short, with replies if you want them, without an API key and without the quota limits of the official YouTube Data API.

Use it for sentiment analysis, product and brand research, finding questions your audience asks, moderating your own channel, or building text datasets.

- **Comments and replies.** Turn on **Include replies** to get the full threads. Each reply links to its parent comment.
- **Top or newest first.** Top comments are in the order YouTube shows them; newest first is best for monitoring.
- **Useful fields.** Likes, reply count, author and author channel, pinned and "hearted by creator" flags, and a direct link to each comment.
- **No API key, no login and no proxy setup.**
- **Low price.** $1 per 1,000 comments.

### How to use it

1. Click **Try for free**.
2. Paste video links in **Video URLs**.
3. Choose top or newest comments, and whether you want replies.
4. Click **Start**, then download the results as JSON, CSV or Excel.

### Input example

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw", "https://youtu.be/dQw4w9WgXcQ"],
    "commentSort": "newest",
    "includeReplies": true,
    "maxItemsPerQuery": 2000
}
```

### Output example

```json
{
    "type": "comment",
    "commentId": "UgzuC3zzpRZkjc5Qzsd4AaABAg",
    "commentUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw&lc=UgzuC3zzpRZkjc5Qzsd4AaABAg",
    "videoId": "jNQXAC9IVRw",
    "videoTitle": "Me at the zoo",
    "isReply": false,
    "parentCommentId": null,
    "text": "We're so honored that the first ever YouTube video was filmed here!",
    "likeCount": 4800000,
    "likeCountText": "4.8M",
    "replyCount": 985,
    "publishedTimeText": "6 years ago",
    "publishedAtEstimated": "2020-09-30T21:48:05Z",
    "isPinned": true,
    "isHeartedByCreator": true,
    "authorName": "@SanDiegoZoo",
    "authorChannelUrl": "https://www.youtube.com/channel/UCC5NfQ6Mf0dq_eEwv4P_hWA",
    "authorIsVerified": true
}
```

### How much does it cost?

You pay per saved result: **$1.00 per 1,000 comments**. A reply counts as one result. There is no start fee and no monthly rental.

| Run | Results | Cost |
|---|---|---|
| 500 top comments of a video | 500 | $0.50 |
| 3,000 comments with replies | 3,000 | $3.00 |

Set a maximum charge per run in the run options and the Actor stops when it is reached.

### Limits you should know

- **Like counts are rounded by YouTube.** Large numbers come as "4.8M", so `likeCount` is rounded too.
- **Dates are estimates.** YouTube shows relative times such as "6 years ago". The Actor keeps that text and adds an estimated date in `publishedAtEstimated`.
- **Videos with comments turned off are skipped** with a warning, as are private and deleted videos.
- **Very large comment sections take time.** YouTube sends about 20 comments per page, so 10,000 comments take a few minutes.

### Related Actors

- [YouTube Shorts Scraper](https://apify.com/pipiagent/youtube-shorts-scraper): Shorts by keyword or channel, with views, likes and hashtags.
- [YouTube Channel Videos Scraper](https://apify.com/pipiagent/youtube-channel-videos-scraper): every upload of a channel.
- [YouTube Search Scraper](https://apify.com/pipiagent/youtube-search-scraper): videos by keyword, upload date and sort order.
- [YouTube Playlist Scraper](https://apify.com/pipiagent/youtube-playlist-scraper): every video of a playlist, in playlist order.
- [YouTube Scraper](https://apify.com/pipiagent/youtube-scraper): video details, comments with replies and channel profiles in one Actor.

### FAQ

**Is it legal?** The Actor collects only data that YouTube shows publicly to every visitor. Results can contain personal data such as usernames. Make sure you have a legitimate reason to process it, as required by the GDPR and similar laws.

**Something is broken or missing?** Open a ticket in the Issues tab. Issues are usually answered within a day.

# Actor input Schema

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

YouTube video URLs, youtu.be links, Shorts URLs or 11-character video ids.

## `maxItems` (type: `integer`):

Maximum number of comments and replies to save in this run. You are only charged for saved results.

## `maxItemsPerQuery` (type: `integer`):

Optional. Limits results for each video, so that one popular video does not use up the whole run. Replies count too.

## `commentSort` (type: `string`):

Top comments come in the order YouTube shows them. Newest first is best for monitoring.

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

Also saves the replies under each comment. Every reply counts as one result.

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

Optional. The Actor works without a proxy. Turn one on only if runs start failing with blocked requests.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxItems": 100,
  "commentSort": "top",
  "includeReplies": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Comments and replies saved by the run, one item each.

# 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=jNQXAC9IVRw"
    ]
};

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

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

```

## MCP server setup

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