# Youtube Comments Scraper (`supreme_coder/youtube-comment-scraper`) Actor

Scrape comments from any youtube video or shorts in bulk.

💰Cost: $0.2 per 1000 comments

- **URL**: https://apify.com/supreme_coder/youtube-comment-scraper.md
- **Developed by:** [Supreme Coder](https://apify.com/supreme_coder) (community)
- **Categories:** Social media, AI
- **Stats:** 514 total users, 100 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

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

### Overview

The YouTube Comment Scraper can extract comments from multiple YouTube shorts and videos at an affordable price. For related YouTube scrapers, the [YouTube Video Scraper](https://apify.com/supreme_coder/youtube-scraper) extracts comprehensive video metadata including titles, descriptions, and engagement metrics. To get video transcripts and subtitles, the [YouTube Transcript Scraper](https://apify.com/supreme_coder/youtube-transcript-scraper) extracts captions in multiple formats including SRT, VTT, and plain text.

For comment scrapers on other platforms, the [LinkedIn Comment Scraper](https://apify.com/curious_coder/linkedin-comment-scraper) collects comments from LinkedIn posts with author details. For Facebook, the [Facebook Comment Scraper](https://apify.com/curious_coder/facebook-comment-scraper) extracts comments from any accessible post including groups and pages. To scrape Twitter/X replies, use the [Twitter Replies Scraper](https://apify.com/curious_coder/twitter-replies-scraper) which captures all replies to specific tweets.

This actor collects the following information about the comments

- Comment text
- Author details
  - Channel ID
  - Displau name
  - Avatar URL
  - Is verified
- Comment ID
- Posted at time
- Likes count
- Dislikes count
- Replies count

### Features

### How to scrape Youtube comments

- Go to [Youtube comment scraper](https://apify.com/supreme_coder/youtube-comment-scraper) on the Apify platform
- Click the Try for free button
- Add youtube urls to scrape or upload a file with list of youtube video urls
- Click the Start button
- When the run has finished, click the Export button
- View and download your data

### Input

Here are sample inputs:

```json
{
    "count": 100,
    "urls": [
        {
            "url": "https://www.youtube.com/watch?v=2ydCvkxuNm4",
            "method": "GET"
        }
    ]
}
```

### Output

Here is the sample output of this actor:

```json
{
	"commentText": "This man deserves 10 kg Tomatoes 🍅🍅🍅🍅 for this video.😅",
	"author": {
		"channelId": "UCOvUqYdg774h5WqMaZIHbJw",
		"displayName": "@itisroasterG",
		"avatarThumbnailUrl": "https://yt3.ggpht.com/g2FhHstoHU4vo6o1lsnaT9MXemdMbFJvehZ_f1r9F3q1lnLu5ZptBrrxVZQ19pFyQxpoIEvNCA=s88-c-k-c0x00ffffff-no-rj",
		"isVerified": false,
		"isCurrentUser": false,
		"isCreator": false,
		"isArtist": false
	},
	"commentId": "UgwGOiO6AJjVBrhjmSl4AaABAg",
	"publishedTime": "1 year ago",
	"replyLevel": 0,
	"likeCountLiked": "5.3K",
	"likeCountNotliked": "5.3K",
	"replyCount": "85",
	"heartActiveTooltip": "❤ by TechBurner Shorts",
	"inputUrl": "https://www.youtube.com/shorts/EL5GxUuvFak"
}
```

### Integrations

You can use [Make](https://www.make.com/en/register?pc=growthhack) to integrate Youtube comment scraper to any other SaaS platform by designing your own automation flows.

### Youtube comments API

The actor stores results in a dataset. You can export data in various formats such as CSV, JSON, XLS, etc.
You can scrape and access data on demand using API. For more information, Go to [Youtube comment scraper API integration](https://apify.com/supreme_coder/youtube-comment-scraper/api/endpoints) page

### How much will it cost me to scrape Youtube comments ?

This scraper costs $0.3 per thousand Youtube comments.
You can scrape upto 16,000 Youtube comments per month with Apify starter plan

### Is it legal to scrape Youtube ?

Our scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our scrapers, when used for ethical purposes by Apify users, are safe.
However, you should be aware that your results could contain personal data. Personal data is protected by the [GDPR](https://docs.apify.com/academy/get-most-of-actors/actor-readme#:~:text=protected%20by%20the-,GDPR,-in%20the%20European) in the European Union and by other regulations around the world.
You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/)

### Your feedback

We’re always working on improving the performance of our Actors. So if you’ve got any technical feedback for this scraper or simply found a bug, please create an issue on the actor’s [Issues](https://apify.com/supreme_coder/youtube-comment-scraper/issues) tab in Apify Console

# Changelog

This Actor's version history is a separate document: https://apify.com/supreme_coder/youtube-comment-scraper/changelog.md

# Actor input Schema

## `urls` (type: `array`):

List of youtube video/shorts URLs to scrape comments

## `count` (type: `integer`):

Leave this field empty if you want to scrape all items.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://www.youtube.com/watch?v=2ydCvkxuNm4"
    }
  ],
  "count": 100
}
```

# 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 = {
    "urls": [
        {
            "url": "https://www.youtube.com/watch?v=2ydCvkxuNm4"
        }
    ],
    "count": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("supreme_coder/youtube-comment-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 = {
    "urls": [{ "url": "https://www.youtube.com/watch?v=2ydCvkxuNm4" }],
    "count": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("supreme_coder/youtube-comment-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 '{
  "urls": [
    {
      "url": "https://www.youtube.com/watch?v=2ydCvkxuNm4"
    }
  ],
  "count": 100
}' |
apify call supreme_coder/youtube-comment-scraper --silent --output-dataset

```

## MCP server setup

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