# YouTube Comments Scraper: Comments, Replies, Likes (`shipsatnight/youtube-comments-scraper`) Actor

Scrape public comments and replies from YouTube videos and Shorts: text, author, likes, reply count, pinned and edited flags. Top or newest first. $0.0005 per comment, no start fee, no API key.

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

## Pricing

$0.15 / 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: Comments, Replies, Likes

### What does this YouTube Comments Scraper do?

This actor collects public comments from YouTube videos and Shorts. Give it video links and it returns each comment's text, author handle, like count, reply count, how long ago it was posted, and whether it is pinned, edited, or written by the channel owner. It can also collect replies. It does not need a YouTube account or an API key.

It costs $0.0005 per comment or reply. There is no start fee.

### What can I use it for?

- Read what viewers say about a product, brand, or competitor video.
- Collect comments for sentiment analysis, topic research, or AI training on public text.
- Find the most-liked questions under a tutorial to plan new content.
- Watch the newest comments on your own videos on a schedule.

### What data does it return?

| Field | Example |
|---|---|
| text | Next learn all JavaScript syntax. |
| author | @beau |
| authorChannelId, authorChannelUrl | UCIuFRHmDktSjlHex7Hahcug |
| likeCount | 26 |
| replyCount | 2 |
| publishedTimeText | 2 years ago |
| isPinned, isEdited, authorIsChannelOwner, authorIsVerified | true / false |
| isReply, parentCommentId | false, or the ID of the comment it replies to |
| commentId, commentUrl | direct link to the comment |
| videoId, videoUrl, videoTitle | the video the comment is on |

Limits: YouTube shows post time as relative text ("2 years ago"), so there is no exact timestamp. Like counts over 1,000 are rounded by YouTube (for example 1.2K becomes 1200). The actor does not return commenter emails or any private data.

### How do I use it?

1. Paste one or more YouTube video or Shorts links.
2. Set "Max comments per video" (default 100).
3. Pick Top comments or Newest first.
4. Turn on "Include replies" if you want replies too.
5. Click Start, then download the results as JSON, CSV, or Excel, or read them with the Apify API.

Example input:

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=PNSIWjWAA7o"],
  "maxComments": 200,
  "sortBy": "top",
  "includeReplies": true,
  "maxRepliesPerComment": 10
}
```

### How much does it cost?

$0.0005 per comment or reply written to the dataset, which is $0.50 per 1,000 comments. No start fee. Platform usage is included. Videos with comments turned off return nothing and cost nothing. You can set a maximum charge per run in the run options, and the actor stops cleanly when it is reached.

### How does the price compare with other YouTube comment scrapers?

Free plan prices listed on the Apify Store on November 3, 2026. Check each listing for current prices.
| Actor | Price per comment |
|---|---|
| This actor | $0.0005, no start fee |
| streamers/youtube-comments-scraper | $0.002 |

### How does it handle errors?

Each request is retried up to 6 times with growing waits, and a blocked request switches to a new proxy IP. Each video's result, including any error such as "comments are turned off", is listed in the RUN_SUMMARY record in the key-value store.

### FAQ

**Do I need a YouTube API key?** No. It reads the same public comments a logged-out visitor sees.

**Can it get all comments on a video?** It follows YouTube's pages until it reaches your limit or the end, up to 10,000 top-level comments per video per run. YouTube may show fewer comments than the count on the video page because some are held or hidden.

**Does it work with Shorts and live stream replays?** Shorts, yes. Replays work when comments are enabled. Live chat is not comments and is not collected.

**Can I get exact comment dates?** No. YouTube only shows relative times like "3 days ago". Run it on a schedule with Newest first to track new comments as they arrive.

**Is it legal?** It collects public comments only. Comments contain usernames, so treat the data as personal data where your laws require it, and follow YouTube's terms.

# Actor input Schema

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

YouTube video, Shorts, or youtu.be links (or 11-character video IDs), one per line.

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

Top-level comments to collect from each video. Replies are counted separately.

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

Same as the sort menu on YouTube.

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

Also collect replies under each comment. Each reply is one result.

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

Only used when replies are included.

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

Default Apify Proxy works for most runs.

## Actor input object example

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

# Actor output Schema

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

No description

## `summary` (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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=PNSIWjWAA7o"
    ]
};

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

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

```

## MCP server setup

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