# YouTube Comments Scraper - Comments & Replies, No API Key (`criatolabs/youtube-comments-scraper`) Actor

Extract comments and replies from any YouTube video or Short: text, author, likes, reply count, pinned and hearted flags. No API key, no quota, no Actor fee.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 and replies, no API key

Extract comments and replies from any YouTube video or Short. You get the text, author, likes, reply count and the pinned and hearted flags.

There's **no Actor fee**: you only pay Apify platform usage. In our test that was **about $0.006 per 1,000 comments**. You also don't need a YouTube API key, and there's no daily quota.

### What you get

- 💬 **Every top-level comment**, sorted by *Top* or *Newest*, just like on YouTube
- ↩️ **Replies** (optional), linked to their parent with `parentCommentId`
- 👍 **Likes and reply counts**, plus flags for **pinned comments**, **hearted by the creator** and **the channel owner's own comments**
- 👤 **Author name, channel ID and URL, avatar and verified badge**
- 🔗 **A direct link to each comment** (`&lc=` URL)
- 🎬 **Regular videos, Shorts and youtu.be links**, or plain video IDs

### Tested at scale

In one run we collected **17,936 comments and replies from 10 videos**, with **0 failures, 0 duplicates and 0 blocks**. It used **$0.098** of platform usage.

### Use cases

- **Sentiment and audience research:** export thousands of comments to analyze what viewers love or hate.
- **Creator and brand monitoring:** track reactions to launches, ads and sponsored videos.
- **Lead and community discovery:** find active commenters and the channels behind them.
- **AI and LLM pipelines:** clean JSON ready for classification, summarization or RAG.

### Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/41UzbuW6wJs"
  ],
  "maxComments": 500,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 20
}
```

### Output

```json
{
  "videoId": "41UzbuW6wJs",
  "videoTitle": "Can A Robot Do My Chores?",
  "commentId": "UgzOP-p2wRIlb9NnBaZ4AaABAg",
  "text": "So excited to never do chores again",
  "author": "@MrBeast",
  "authorChannelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
  "authorIsChannelOwner": true,
  "authorIsVerified": true,
  "likes": 14000,
  "likesText": "14K",
  "replyCount": 899,
  "publishedTimeText": "3 days ago",
  "isEdited": false,
  "isPinned": true,
  "isHeartedByCreator": false,
  "isReply": false,
  "parentCommentId": null,
  "commentUrl": "https://www.youtube.com/watch?v=41UzbuW6wJs&lc=UgzOP-p2wRIlb9NnBaZ4AaABAg"
}
```

YouTube only shows rounded like counts (for example "14K"). `likes` is the number parsed from that text, and `likesText` keeps the original.

### Pricing

This Actor has no fee of its own: you pay only Apify platform usage. In our test, 17,936 comments cost $0.098, mostly for dataset storage. The free Apify plan covers hundreds of thousands of comments per month.

### More YouTube and trends tools from Criato Labs

- [YouTube Channel & Video Scraper](https://apify.com/criatolabs/youtube-channel-scraper): channel profiles, videos, Shorts, lives and keyword search
- [YouTube Transcript Scraper](https://apify.com/criatolabs/youtube-transcript-scraper): transcripts of videos or whole channels
- [Google Trends Batch Scraper](https://apify.com/criatolabs/google-trends-batch-scraper): up to 1,000 keywords per run, including YouTube Search trends

### FAQ

**Do I need a YouTube API key?** No. The Actor reads the same public data the YouTube website shows.

**Can I get all comments of a video?** Yes. Set `maxComments` to a large number. Very large videos can have millions of comments, so start small to estimate time and cost.

**What about videos with comments turned off?** They're skipped and counted as `disabled` in the run summary.

**Is it legal?** The Actor collects only publicly visible comments. Comments contain personal data such as usernames, so make sure your use complies with GDPR, LGPD and other applicable laws, and with YouTube's terms.

# Actor input Schema

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

YouTube video, Shorts or youtu.be links, or plain 11-character video IDs. One per line.

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

Top-level comments to collect per video (replies are counted separately).

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

Same options as on YouTube.

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

Also collect replies to each comment (marked with isReply and parentCommentId).

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

Only used when 'Include replies' is on.

## `language` (type: `string`):

Language for relative dates such as '2 days ago' (en, pt, es, de...). Comment text is never translated.

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

Apify Proxy is recommended for large jobs. The Actor rotates IPs automatically when YouTube rate-limits.

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

How many videos are processed at the same time.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxComments": 100,
  "sortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxConcurrency": 5
}
```

# Actor output Schema

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

One item per comment or reply.

## `runSummary` (type: `string`):

Videos processed, comments, replies and videos with comments disabled.

# 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("criatolabs/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"],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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