# YouTube Comments & Replies Scraper API — $0.50/1K (`funny_ground/youtube-comments-scraper`) Actor

Export public YouTube comments and reply threads to structured JSON, CSV, or Excel with author channels, likes, timestamps, pinned flags, and creator hearts. No YouTube API key, browser, proxy, or login. $0.50 per 1,000 results.

- **URL**: https://apify.com/funny\_ground/youtube-comments-scraper.md
- **Developed by:** [Coor Yu](https://apify.com/funny_ground) (community)
- **Categories:** Social media, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Comments & Replies Scraper API — $0.50/1K

Export public YouTube comments and reply threads as structured dataset rows. The Actor uses YouTube's public web responses directly, so normal runs need no Google API key, browser, login, proxy, or residential IP.

### What you get

- One dataset row per top-level comment or reply.
- Comment text, author/channel identity, avatar, likes, reply count, pinned and creator-heart flags.
- Top-comments or newest-first ordering.
- Exact per-video and per-thread limits with ID-based de-duplication.
- HTTP-only execution with bounded concurrency, timeouts, and retries.

### Pricing

- Result fee: `$0.0005` per dataset row — `$0.50 per 1,000 comments or replies`.
- A small Actor start event and normal Apify platform usage may also apply; see the Pricing tab.
- Rows that are not written to the dataset are not charged as results.

### Example input

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
  "commentsPerVideo": 100,
  "includeReplies": true,
  "repliesPerComment": 20,
  "sortBy": "top",
  "maxConcurrency": 6
}
```

`commentsPerVideo=0` and `repliesPerComment=0` mean all available rows. Deleted, held-for-review, members-only, private, age-restricted, disabled, or otherwise unavailable comments cannot be returned.

### Reliability and cost controls

- No browser image or proxy transfer is used.
- Global HTTP concurrency is bounded across videos and replies.
- Opaque YouTube continuation tokens are followed sequentially so pages are not skipped.
- HTTP 429/5xx responses receive short exponential retries.
- A complete run that produces zero valid rows fails instead of reporting a misleading success.

Scrape only public data and comply with applicable laws and platform terms. Avoid collecting or processing personal data without a lawful purpose.

### Related Actors from funny\_ground

- [YouTube Channel & Shorts Scraper](https://apify.com/funny_ground/youtube-scraper)

# Actor input Schema

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

Public youtube.com, youtu.be, Shorts, embed, or live video URLs.

## `commentsPerVideo` (type: `integer`):

Maximum top-level comments per video. 0 = all available comments.

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

Fetch reply threads for the selected top-level comments.

## `repliesPerComment` (type: `integer`):

Maximum replies per selected top-level comment. 0 = all available replies.

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

Use YouTube's Top comments or Newest first ordering.

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

Global limit across video pages and reply threads.

## `maxRequestRetries` (type: `integer`):

Maximum retries for a failed YouTube request before the URL is reported as failed.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to wait for each YouTube request before retrying it.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "commentsPerVideo": 5,
  "includeReplies": false,
  "repliesPerComment": 20,
  "sortBy": "top",
  "maxConcurrency": 6,
  "maxRequestRetries": 2,
  "requestTimeoutSecs": 20
}
```

# Actor output Schema

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

The default dataset containing one YouTube comment or reply per row.

# 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"
    ],
    "commentsPerVideo": 5,
    "includeReplies": false,
    "sortBy": "top"
};

// Run the Actor and wait for it to finish
const run = await client.actor("funny_ground/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"],
    "commentsPerVideo": 5,
    "includeReplies": False,
    "sortBy": "top",
}

# Run the Actor and wait for it to finish
run = client.actor("funny_ground/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"
  ],
  "commentsPerVideo": 5,
  "includeReplies": false,
  "sortBy": "top"
}' |
apify call funny_ground/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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