# YouTube Comment Scraper (`devil_port369-owner/youtube-comments-scraper`) Actor

Scrape YouTube comments. Extract clean JSON data for SEO, lead generation, competitor monitoring, and market research with contact enrichment. The ultimate YouTube comment scraper.

- **URL**: https://apify.com/devil\_port369-owner/youtube-comments-scraper.md
- **Developed by:** [DataFusionX](https://apify.com/devil_port369-owner) (community)
- **Categories:** AI, SEO tools, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.95 / 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/platform/actors/running/actors-in-store#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 Comment Scraper

**Scrape YouTube comments** easily with this powerful **YouTube comment scraper**. Extract comments, replies, author details, likes, timestamps, and contact enrichment data from any YouTube video.

Perfect for researchers, marketers, developers, and data analysts who need a reliable **YouTube comments scraper**, **YouTube comment downloader**, or **comment extractor**.

***

### 🚀 Features

- **Scrape YouTube comments** from any public video
- Extract top-level comments **and replies**
- Support for **Newest First** and **Top Comments** sorting
- Clean, normalized YouTube URLs (handles `youtu.be`, Shorts, extra parameters, etc.)
- Deduplication of input URLs
- Full comment metadata:
  - Comment text (exact UI content)
  - Author name, channel ID, avatar
  - Like count & reply count
  - Published time (relative + absolute + Unix timestamp)
  - Creator heart status
  - Paid / Super Thanks indicators
- Optional **contact enrichment**:
  - Emails, phones, websites
  - Social profiles (Discord, Instagram, X/Twitter, LinkedIn, TikTok, Telegram, etc.)
  - Lead signals & lead score
- Concurrent scraping with configurable concurrency
- Flat, linear JSON output – ready for datasets, CRM, or analysis
- Built with Python – ideal for those searching **youtube comment scraper python**

***

### 📥 Input

| Field | Type | Required | Description | Default |
|-------|------|----------|-------------|---------|
| `startUrls` | Array | Yes | List of YouTube video URLs | – |
| `maxComments` | Integer | No | Maximum comments to fetch **per video** | `100` |
| `sortCommentsBy` | String | No | `TOP_COMMENTS` or `NEWEST_FIRST` | `TOP_COMMENTS` |
| `includeContactEnrichment` | Boolean | No | Extract emails, phones, social links & lead signals | `true` |

#### Input Example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
    },
    {
      "url": "https://youtu.be/87SH2Cn0s9A?t=30"
    }
  ],
  "maxComments": 200,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeContactEnrichment": true
}
```

The actor automatically:

- Cleans URLs (removes tracking parameters, converts `youtu.be` / Shorts)
- Deduplicates videos
- Supports both object format (`{"url": "..."}`) and plain strings

***

### 📤 Output

Each comment is pushed as a flat JSON object to the Apify dataset.

#### Output Example

```json
{
  "video_url": "https://www.youtube.com/watch?v=xObhZ0Ga7EQ",
  "comment_id": "Ugx8YyWHF6vy5s3Bax54AaABAg.9nlIRheKSsX9nlQx6EfGF-",
  "parent_id": "Ugx8YyWHF6vy5s3Bax54AaABAg",
  "is_reply": true,
  "text": "Sorry about that! Thanks for pointing it out🤐 It's now added in the description, but you can just directly use this link: https://discord.com/invite/jyEM2PRvMU",
  "published_time": "2023-08-21 06:11:02",
  "published_time_relative": "3 years ago",
  "published_timestamp": 1692598262,
  "author_name": "@Apify",
  "isCreator": true,
  "isArtist": false,
  "author_channel_id": "UCTgwcoeGGKmZ3zzCXN2qo_A",
  "author_avatar": "https://yt3.ggpht.com/m4tS7WA15DeUqAi90tn0NnshLvW7liMNpAGAN5I78UNQKTPDcLHw_0dc1GXeW75_ccDiuqUEmQ=s88-c-k-c0x00ffffff-no-rj",
  "like_count": 1,
  "reply_count": 0,
  "hearted_by_creator": false,
  "paid": null,
  "enrichment": {
    "has_contact": false,
    "has_social": true,
    "has_lead_signal": false,
    "lead_score": 20,
    "emails": [],
    "phones": [],
    "websites": [],
    "social_profiles": [
      {
        "platform": "discord",
        "handle": "jyEM2PRvMU",
        "url": "https://discord.com/invite/jyEM2PRvMU"
      }
    ],
    "mentions": [],
    "lead_phrases": [],
    "all_urls": [
      "https://discord.com/invite/jyEM2PRvMU"
    ]
  }
}
```

#### Field Descriptions

| Field | Description |
|-------|-------------|
| `video_url` | Cleaned YouTube video URL |
| `comment_id` | Unique comment ID |
| `parent_id` | Parent comment ID (for replies) |
| `is_reply` | `true` if this is a reply |
| `text` | Exact comment text as shown in the YouTube UI |
| `published_time` | Absolute time (UTC) – `YYYY-MM-DD HH:MM:SS` |
| `published_time_relative` | Relative time (e.g. "3 years ago") |
| `published_timestamp` | Unix timestamp |
| `author_name` | Display name of the commenter |
| `author_channel_id` | YouTube channel ID of the author |
| `author_avatar` | Profile picture URL |
| `like_count` | Number of likes |
| `reply_count` | Number of replies |
| `hearted_by_creator` | Whether the video creator hearted the comment |
| `paid` | Super Thanks / paid comment indicator |
| `enrichment` | Contact & social enrichment object (when enabled) |

***

### 🔍 Use Cases

- **Market research** – Analyze audience sentiment and feedback
- **Lead generation** – Find emails, Discord, Instagram, LinkedIn from comments
- **Competitor analysis** – Monitor comments on competitor videos
- **Content strategy** – Discover what resonates with viewers
- **Academic research** – Collect large comment datasets
- **Brand monitoring** – Track mentions and reactions
- **Influencer outreach** – Extract social profiles of active commenters

***

### ⚙️ Technical Details

- Written in **Python**
- Uses efficient continuation-token based pagination (same method as the official YouTube client)
- Concurrent video processing with configurable thread limit (`MAX_THREADS`)
- Automatic consent / cookie handling
- Robust number parsing (`1.2K` → `1200`, `3.4M` → `3400000`)
- Relative time → absolute timestamp conversion
- Fully flat output – no nested complexity

***

### ❓ Frequently Asked Questions (FAQ)

#### How to scrape YouTube comments?

Simply provide one or more YouTube video URLs in the `startUrls` field, set the maximum number of comments you want, choose sorting order, and run the Actor. The **YouTube comment scraper** will automatically extract comments and replies.

#### Does this YouTube comments scraper extract replies?

Yes. Both top-level comments and nested replies are scraped. Replies include a `parent_id` field so you can easily reconstruct the conversation thread.

#### Can I scrape comments from multiple videos at once?

Yes. Just add multiple URLs to the `startUrls` array. The Actor processes them concurrently for maximum speed.

#### What is the difference between TOP\_COMMENTS and NEWEST\_FIRST?

- **TOP\_COMMENTS** – Returns the most relevant / highest-engagement comments first (YouTube’s default ranking).
- **NEWEST\_FIRST** – Returns the latest comments in chronological order.

#### Does it work with YouTube Shorts and youtu.be links?

Yes. The Actor automatically cleans and normalizes all common YouTube URL formats including Shorts, `youtu.be`, and URLs with extra parameters.

#### What does contact enrichment do?

When enabled, the Actor analyzes each comment text and extracts:

- Email addresses
- Phone numbers
- Websites
- Social media profiles (Discord, Instagram, X, LinkedIn, TikTok, Telegram, etc.)
- Lead intent phrases
- A lead score (0–100)

This makes the Actor excellent for lead generation and outreach.

#### Is this a YouTube comment scraper Python solution?

Yes. The Actor is fully written in Python and can also be run locally with the Apify CLI or integrated into your own Python projects via the Apify API client.

#### How many comments can I scrape per video?

You can set `maxComments` up to 10,000 per video. Actual results depend on how many public comments the video has.

#### Will the Actor get blocked?

The Actor uses advanced proxy rotation and session management to minimize blocking. For high-volume usage, we recommend running it on the Apify platform.

#### Can I use this as a YouTube comment downloader?

Yes. The Actor functions as a complete **YouTube comment downloader** — it downloads comments in structured JSON format that you can export to CSV, Excel, or any database.

#### Does it scrape private or age-restricted videos?

No. Only publicly available comments from public videos are supported.

#### Can I export the results?

Yes. You can download the dataset in JSON, CSV, Excel, XML, or HTML format directly from the Apify platform, or access it programmatically via the API.

***

### 📌 Notes & Limitations

- Only public comments are scraped
- Comments disabled on a video → empty result for that video
- Very high `maxComments` values may take longer depending on video popularity
- Enrichment quality depends on what commenters write in their text
- Respect YouTube’s Terms of Service and fair-use guidelines

***

### 🏷️ Keywords

youtube comment scraper • scrape youtube comments • youtube comment scraper python • youtube comments scraper • how to scrape youtube comments • youtube comment downloader • youtube video scraper • yt scraper • comment extractor • youtube channel scraper

***

### 📄 License

This Actor is provided for legitimate research, analysis, and business use. Users are responsible for complying with YouTube’s Terms of Service and applicable laws.

# Actor input Schema

## `startUrls` (type: `array`):

YouTube video URLs for comments

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

Maximum comments to fetch per video (used for comments mode).

## `sortCommentsBy` (type: `string`):

Sort order for comments.

## `includeContactEnrichment` (type: `boolean`):

Extract email, phone, website, and social links from descriptions.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
    }
  ],
  "maxComments": 100,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeContactEnrichment": true
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
        }
    ],
    "maxComments": 100,
    "sortCommentsBy": "TOP_COMMENTS",
    "includeContactEnrichment": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("devil_port369-owner/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 = {
    "startUrls": [{ "url": "https://www.youtube.com/watch?v=xObhZ0Ga7EQ" }],
    "maxComments": 100,
    "sortCommentsBy": "TOP_COMMENTS",
    "includeContactEnrichment": True,
}

# Run the Actor and wait for it to finish
run = client.actor("devil_port369-owner/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 '{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
    }
  ],
  "maxComments": 100,
  "sortCommentsBy": "TOP_COMMENTS",
  "includeContactEnrichment": true
}' |
apify call devil_port369-owner/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

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