# Youtube Comments Scraper (Pay Per Results) (`easy_peasy_api/youtube-comments-scraper-pay-per-results`) Actor

Easily collect full text YouTube comments with this tool! Just enter video URLs, and get all the data you need in JSON format, including comment text, like counts, and commenter info. Great for researchers and developers.

- **URL**: https://apify.com/easy_peasy_api/youtube-comments-scraper-pay-per-results.md
- **Developed by:** [Easy_Peasy_API](https://apify.com/easy_peasy_api) (community)
- **Categories:** Automation, Social media, Videos
- **Stats:** 25 total users, 0 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.80 / 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.

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

The YouTube Comments Scraper is a tool designed to extract data from YouTube comments.
By simply providing a video URL, you can retrieve:

all comments from selected YouTube videos
details such as comment text, author name, posting date, like count, and reply count
information on whether a comment received a creator's heart or if its author is the channel owner

### How to use YouTube Comments Scraper?

Super easy ! The YouTube Comments Scraper is built to be simple and accessible, even for beginners.
Here's how you can use it to extract YouTube comment data:

-Create an account on Apify.
-Open the YouTube Comments Scraper.
-Input the YouTube video URLs to scrape the comments.
-Click the "Start" button and wait for the extraction process to complete.
-Download your extracted data in formats like JSON, XML, CSV, Excel, or HTML.

### How much will scraping YouTube comments Scraper cost you?

This scraper operates on a pay-per-result model, meaning you only pay for the successful results returned by the YouTube comments Scraper. The cost is $1.8 for every 1,000 comments.

### YouTube comments Scraper data input

```
{
  "url": [
    "<https://www.youtube.com/watch?v=rYEDA3JcQqw>"
  ]
}
```

The input for YouTube Comments Scraper should be a YouTube video URL.

### YouTube comments Scraper data output

The output from YouTube comments Scraper Scraper is stored in the dataset. After the run is finished, you can download the dataset in various data formats (JSON, CSV, XML, RSS, HTML Table).

```

{
    "video_id": "rYEDA3JcQqw",
    "author_id": "UCcXm2Edf3g2-YlTiZI7bs2g",
    "author_name": "@Jiftoo",
    "content": "It feels so weird coming back to old songs having learned English",
    "published_time": "4 years ago",
    "avatar": "https://yt3.ggpht.com/DTgFHslh-3u_sGyZ29n4MuHIAHQNAc58kTH30bsaioKhHh77wLSl7m4on92PB_IF8kMd0XBej4Y=s88-c-k-c0x00ffffff-no-rj",
    "like": "25 k",
    "reply": "260",
    "is_verified": false,
    "is_current_user": false,
    "is_creator": false,
    "is_artist": false
  }
```

# Actor input Schema

## `url` (type: `string`):

The URL of YouTube URL you want to get the comments from.

## Actor input object example

```json
{
  "url": "https://www.youtube.com/watch?v=rYEDA3JcQqw"
}
```

# 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 = {
    "url": "https://www.youtube.com/watch?v=rYEDA3JcQqw"
};

// Run the Actor and wait for it to finish
const run = await client.actor("easy_peasy_api/youtube-comments-scraper-pay-per-results").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 = { "url": "https://www.youtube.com/watch?v=rYEDA3JcQqw" }

# Run the Actor and wait for it to finish
run = client.actor("easy_peasy_api/youtube-comments-scraper-pay-per-results").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 '{
  "url": "https://www.youtube.com/watch?v=rYEDA3JcQqw"
}' |
apify call easy_peasy_api/youtube-comments-scraper-pay-per-results --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,easy_peasy_api/youtube-comments-scraper-pay-per-results"
        }
    }
}
```

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/yVTxPdAvMfwuuDYn1/builds/YDC63rfLjSNaAi8or/openapi.json
