# YouTube Comments Scraper: Replies & Likes, $1.50 per 1,000 (`trueline-data/youtube-comments-scraper`) Actor

Get the comments and replies of any YouTube video: text, author, likes, reply count, date, and whether the creator hearted it. Sort by Top or Newest. Fast and cheap: no proxy needed for most runs.

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

## Pricing

$1.50 / 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: Replies & Likes, $1.50 per 1,000

Get the comments of any YouTube video, and the replies under them, as clean rows:

- **Comment text**, the author's name and channel id, and whether the author is the video's creator
  or a verified channel.
- **Likes** and **reply count** as numbers.
- **When it was posted** ("3 days ago", as YouTube shows it).
- **Whether the creator hearted it.**
- **A direct link** to the comment.
- **The video's title, channel and total comment count** on every row.

### Why this one

- **Top or Newest.** The same two orders YouTube offers.
- **Replies too, if you want them**, with a cap per comment so one long thread cannot eat the run.
- **Fast and cheap.** It reads YouTube's own data directly, without a browser and, for most runs,
  without a proxy. If YouTube blocks the run, it switches to residential IPs by itself.
- **You pay only for comments you get.** A video with comments turned off is listed with that
  reason and not charged.

### Input

| Field | What it does |
| --- | --- |
| `videos` | Video URLs or ids. |
| `maxComments` | Max comments per video. Replies count toward it. |
| `sortBy` | `top` or `newest`. |
| `includeReplies` | Also get the replies. |
| `maxRepliesPerComment` | Cap on replies under one comment. |

```json
{
  "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "maxComments": 200,
  "sortBy": "newest",
  "includeReplies": true
}
```

### Output

One row per comment or reply.

Real rows from a test run on 17 October 2026 (some fields left out to keep it short):

```json
[
  {
    "videoId": "scwlR0QHGOk",
    "videoTitle": "The NEW Tesla Roadster: My Honest Reaction",
    "videoCommentCount": 8585,
    "status": "ok",
    "author": "@andrewros.e",
    "text": "this was a video of Marques getting into his Porsche and getting out of his Porsche",
    "likeCount": 6600,
    "replyCount": 49,
    "publishedText": "6 hours ago",
    "isReply": false,
    "heartedByCreator": false
  }
]
```

### Pricing

Pay per comment or reply returned. Videos with no comments and errors are free.

# Actor input Schema

## `videos` (type: `array`):

Video URLs or ids. Any form works: youtube.com/watch?v=, youtu.be/, /shorts/, /live/, or the 11-character id.

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

Stop after this many comments for each video. Replies count toward it.

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

The order YouTube gives the comments in.

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

Also get the replies under each comment.

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

Stop after this many replies under one comment.

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

Language code for YouTube's texts, such as en, es, de. Comment text is never translated.

## `country` (type: `string`):

Two-letter country code.

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

How many videos to work on in parallel.

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

Not needed for most runs. The tool goes direct and switches to residential IPs on its own if YouTube blocks it. Set a proxy here only to force your own.

## Actor input object example

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

# Actor output Schema

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

No description

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("trueline-data/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 = {
    "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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