# YouTube Comments Scraper - Export Comments & Replies (`logiover/youtube-comments-scraper`) Actor

Scrape YouTube comments without API key. Export comments and replies to CSV, JSON, Excel — a YouTube Data API alternative for sentiment research.

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

## Pricing

from $3.50 / 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Scraper

Export all YouTube comments and replies from any video in bulk. This YouTube comment scraper — also a YouTube comment exporter and comment extractor — pulls every comment and reply with the author, text, likes and dates, with no login, no cookies and no Google API key.

One run can return tens of thousands of comments from a single popular video, ready for sentiment analysis, audience research and brand monitoring. Paste video URLs or IDs and export to CSV, JSON or Excel.

> No login · No cookies · No YouTube Data API key · No quota · Unlimited comments per video

> **YouTube comments scraper · YouTube Data API alternative · Scrape YouTube comments without API key · Export YouTube comments to CSV · YouTube comment dataset JSON**

---

### What you get

Each comment (and reply) is saved as one structured row with these fields:

- **author** — comment author name (e.g. `@musicfan`)
- **authorChannelId** — the author's channel ID
- **authorIsVerified** — verified-badge flag
- **authorIsCreator** — true when the video's creator posted it
- **text** — full comment text
- **likeCount** — like count, normalized to an integer (`243K` → `243000`)
- **replyCount** — number of replies on the thread
- **publishedTime** — relative publish time (`"1 year ago"`)
- **isReply** — whether the row is a reply or a top-level comment
- **parentCommentId** — the parent comment a reply belongs to
- **videoTitle**, **videoId**, **videoUrl** — the source video
- **scrapedAt** — scrape timestamp (use as the reference for relative dates)

Export every field to **CSV, JSON, Excel**, HTML or RSS, or pull it via the Apify API and integrations (Make, Zapier, n8n, Google Sheets).

---

### Use cases

- **Sentiment analysis** — export every comment on a launch, trailer or review and run NLP/LLM sentiment scoring.
- **Brand & reputation monitoring** — track what audiences say under your own or a competitor's videos.
- **Audience & market research** — mine feature requests, complaints and the exact language your customers use.
- **Creator & influencer analytics** — measure real engagement quality, not just view counts.
- **Content moderation & AI datasets** — pull comments for spam/abuse filtering or to assemble conversational training data.

---

### How to use

No code required — extract YouTube comments in under a minute:

1. **Open the actor** on Apify and click **Try for free**.
2. **Paste your video URLs or IDs** into the `videos` field — full `youtube.com/watch?v=…` links, `youtu.be/…` short links, Shorts URLs, or bare 11-character IDs. Add as many as you like.
3. *(Optional)* Set `sortBy` to `top` or `newest`, toggle `includeReplies`, and set `maxCommentsPerVideo`.
4. Click **Start** and watch comments stream into the dataset.
5. **Export** to CSV, Excel or JSON, or pull them via the Apify API into your app.

**Prefer the API?** Start a run with a single POST to the Apify [Run Actor endpoint](https://docs.apify.com/api/v2) and read results from the dataset — perfect for automating a YouTube comment export on a schedule.

#### Input fields

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `videos` *(required)* | `string[]` | — | Video URLs or 11-char IDs (watch, `youtu.be`, Shorts all supported). |
| `maxCommentsPerVideo` | `integer` | `1000` | Cap per video (top-level + replies). `0` = unlimited. |
| `sortBy` | `string` | `top` | `top` (highest engagement) or `newest`. |
| `includeReplies` | `boolean` | `false` | Also fetch replies (tagged with `parentCommentId`). |
| `maxResults` | `integer` | `0` | Global cap across all videos. `0` = unlimited. |

#### Example input

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/9bZkp7q19f0"
  ],
  "maxCommentsPerVideo": 5000,
  "sortBy": "newest",
  "includeReplies": true
}
````

#### Example output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoTitle": "Rick Astley - Never Gonna Give You Up",
  "text": "This song is timeless 🔥",
  "author": "@musicfan",
  "authorIsVerified": false,
  "likeCount": 1240,
  "replyCount": 7,
  "publishedTime": "2 months ago",
  "isReply": false,
  "parentCommentId": null,
  "scrapedAt": "2026-05-22T07:30:00Z"
}
```

***

### How it works

This YouTube comment extractor talks to YouTube's internal data layer (the same one the website uses), fetching a fresh access key on each run so it keeps working as YouTube changes. It loads the comment section, paginates with continuation tokens until the video is exhausted or your cap is hit, and resolves replies through the parent/reply comment-ID convention. Built-in retries handle hiccups; videos with comments disabled are skipped gracefully.

***

### FAQ

#### Do I need a YouTube API key or login to scrape comments?

No. There's no login, no cookie, and no YouTube Data API key — and none of the official API's comment quota limits.

#### How many YouTube comments can I scrape?

As many as the video has publicly. Viral videos return tens of thousands. Use `maxCommentsPerVideo` to cap cost.

#### Does it scrape replies too?

Yes. Set `includeReplies: true`; replies carry `isReply: true` and a `parentCommentId` linking them to the top-level comment.

#### Why is the date "2 years ago" instead of an exact date?

YouTube only exposes a relative time on comments. Use the `scrapedAt` timestamp as the reference point to convert it.

#### Is this a YouTube Data API alternative for comments?

Yes. It works as a YouTube Data API alternative — no Google Cloud project, no API key, and none of the official quota limits, so you can scrape YouTube comments without an API key.

#### How do I export YouTube comments to CSV or JSON?

Run the actor, then download the dataset as CSV, JSON or Excel from the run's Storage tab, or pull the YouTube comment dataset via the Apify API. Every field exports as one structured row.

#### Can I scrape YouTube comments without login or cookies?

Yes. There is no login, no cookies and no account needed — paste video URLs or IDs and the comment extractor pulls public comments and replies directly.

***

### Limits & notes

- Published time is **relative** (`"2 years ago"`), and like counts are abbreviated by YouTube (parsed to integers in `likeCount`).
- Only **public** comments are returned; disabled or members-only comments yield nothing for that video.
- `includeReplies` can multiply volume on threads with thousands of replies — cap it with `maxCommentsPerVideo`.

***

### The complete YouTube scraping toolkit

- **[YouTube Channel Scraper](https://apify.com/logiover/youtube-channel-scraper)** — every video of a channel
- **[YouTube Search Scraper](https://apify.com/logiover/youtube-search-scraper)** — find videos by keyword
- **[YouTube Video Details Scraper](https://apify.com/logiover/youtube-video-details-scraper)** — exact views, likes, tags
- **[YouTube Creator Email Finder](https://apify.com/logiover/youtube-creator-email-finder)** — creator business emails for outreach

***

### Pricing & support

Pay-per-result — you only pay for the comments you actually get. No proxy fees, no YouTube API costs. Need a whole channel's comments in one click, exact timestamps, or built-in sentiment scoring? Open an issue on the actor's page.

> Collects only publicly visible comment data. You are responsible for using it in line with YouTube's Terms and applicable privacy laws (GDPR/CCPA) — avoid using personal data for unsolicited contact.

### 📝 Changelog

#### 2026-06-15

- Reliability pass: re-verified end-to-end on live data with real-world inputs. Routine maintenance build.

#### 2026-06-07

- Docs: added coverage for using this as a YouTube Data API alternative, scraping comments without an API key or login, and exporting the comment dataset to CSV/JSON.

#### 2026-06-05

- 🛡️ Reliability fix: results are no longer dropped by strict output validation — runs now complete cleanly even at high volume (thousands of results).
- ⚡ Stability & performance hardening; fresh rebuild.

#### 2026-06-04

- Verified live & refreshed build — reliability/maintenance pass.

# Actor input Schema

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

YouTube videos to scrape comments from. Accepts full watch URLs (https://www.youtube.com/watch?v=...), youtu.be short links, Shorts URLs, or bare 11-character video IDs. Add as many as you like.

## `maxCommentsPerVideo` (type: `integer`):

Hard cap on comments saved per video (top-level + replies combined). Set 0 for unlimited (scrapes every comment — popular videos can have tens of thousands).

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

'top' = highest-engagement comments first (YouTube default). 'newest' = most recent first.

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

Also fetch replies under each comment thread (tagged with parentCommentId). Increases volume and run time substantially on threads with many replies.

## `maxResults` (type: `integer`):

Global cap across all videos in the run. 0 = unlimited.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxCommentsPerVideo": 1000,
  "sortBy": "top",
  "includeReplies": false,
  "maxResults": 0
}
```

# Actor output Schema

## `author` (type: `string`):

Comment author name

## `text` (type: `string`):

Comment text

## `likeCount` (type: `string`):

Like count

## `replyCount` (type: `string`):

Reply count

## `publishedTime` (type: `string`):

Relative publish time

## `isReply` (type: `string`):

Reply vs top-level

## `videoTitle` (type: `string`):

Source video title

## `videoId` (type: `string`):

Source video ID

## `videoUrl` (type: `string`):

Source video URL

## `scrapedAt` (type: `string`):

Scrape timestamp

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

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

# Run the Actor and wait for it to finish
run = client.actor("logiover/youtube-comments-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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"
  ],
  "sortBy": "top"
}' |
apify call logiover/youtube-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=logiover/youtube-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Comments Scraper - Export Comments & Replies",
        "description": "Scrape YouTube comments without API key. Export comments and replies to CSV, JSON, Excel — a YouTube Data API alternative for sentiment research.",
        "version": "1.0",
        "x-build-id": "XXRf0SI6453nMvjST"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/logiover~youtube-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-logiover-youtube-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/logiover~youtube-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-logiover-youtube-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/logiover~youtube-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-logiover-youtube-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "videos"
                ],
                "properties": {
                    "videos": {
                        "title": "Video URLs or IDs",
                        "type": "array",
                        "description": "YouTube videos to scrape comments from. Accepts full watch URLs (https://www.youtube.com/watch?v=...), youtu.be short links, Shorts URLs, or bare 11-character video IDs. Add as many as you like.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxCommentsPerVideo": {
                        "title": "Max comments per video",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Hard cap on comments saved per video (top-level + replies combined). Set 0 for unlimited (scrapes every comment — popular videos can have tens of thousands).",
                        "default": 1000
                    },
                    "sortBy": {
                        "title": "Sort comments by",
                        "enum": [
                            "top",
                            "newest"
                        ],
                        "type": "string",
                        "description": "'top' = highest-engagement comments first (YouTube default). 'newest' = most recent first.",
                        "default": "top"
                    },
                    "includeReplies": {
                        "title": "Include replies",
                        "type": "boolean",
                        "description": "Also fetch replies under each comment thread (tagged with parentCommentId). Increases volume and run time substantially on threads with many replies.",
                        "default": false
                    },
                    "maxResults": {
                        "title": "Max results (all videos)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Global cap across all videos in the run. 0 = unlimited.",
                        "default": 0
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
