# YouTube Unlimited Comments & Transcript Scraper (`codenest/youtube-unlimited-comments-transcript-scraper`) Actor

Input YouTube video URLs, IDs, Shorts, channels, playlists, or search keywords. Output unlimited comments, nested replies, clean and timestamped transcripts, views, likes, and channel details as per-video JSON or flat CSV and Excel rows.

- **URL**: https://apify.com/codenest/youtube-unlimited-comments-transcript-scraper.md
- **Developed by:** [CodeNest](https://apify.com/codenest) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 comments / reply scraped

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/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 & Transcript Scraper

Scrape YouTube comments, replies, and video transcripts in bulk without a YouTube Data API key. Supports standard video URLs, Shorts, channels, playlists, and keyword searches, with export to JSON, CSV, or Excel.

### Features

- **No API Key Required:** Runs directly against YouTube web and player endpoints without Google API daily quota limits.
- **Comments and Replies:** Paginates top-level comments (`maxCommentsPerVideo = 0` for all available comments) sorted by `top` or `newest`, with optional reply extraction. When `top` sorting hits YouTube's built-in filter cap early, the scraper automatically continues with unfiltered `newest` comments so fewer items are missed.
- **Manual and Auto Captions:** Selects captions by language priority, preferring manual subtitles over auto-generated (`ASR`), and outputs both plain text (`transcriptText`) and timestamped lines (`transcriptSegments`).
- **Multiple Input Sources:** Accepts video URLs, 11-character IDs, `/shorts/` links, channel URLs (`/@handle`), playlist URLs (`?list=`), and search keywords.
- **Two Dataset Modes:** Choose `per_video` (one record per video with transcript and nested comments) or `flat_comments` (one row per comment or reply for spreadsheets).

### Input Parameters

| Parameter | Default | Description |
|---|---|---|
| `startUrls` | `[]` | Video URLs, video IDs, Shorts, channel URLs (`/@handle`), or playlist URLs |
| `searchKeywords` | `[]` | Keywords to search on YouTube and scrape matching videos |
| `maxVideos` | `20` | Max videos to collect per channel, playlist, or keyword (`0` = unlimited) |
| `includeTranscript` | `true` | Enable or disable transcript extraction |
| `transcriptLanguages` | `["en"]` | Preferred language codes in priority order |
| `includeTimestamps` | `true` | Include `startSec`, `durationSec`, and `timestamp` per segment |
| `includeComments` | `true` | Enable or disable comment extraction |
| `maxCommentsPerVideo` | `200` | Max comments per video (`0` = unlimited) |
| `commentSortBy` | `"top"` | Sort order: `"top"` or `"newest"` |
| `includeReplies` | `false` | Extract nested replies under comments |
| `maxRepliesPerComment` | `10` | Max replies per comment thread (`0` = unlimited) |
| `outputFormat` | `"per_video"` | `"per_video"` or `"flat_comments"` |
| `proxyCountry` | `"US"` | Residential proxy country code |
| `maxConcurrency` | `5` | Number of parallel video workers (`1` to `10`) |

### Output Examples

#### 1. `per_video` Mode (Default)

Outputs one structured JSON object per video with full metadata, transcript, and nested comments:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "channelHandle": "@RickAstleyYT",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "channelUrl": "https://www.youtube.com/@RickAstleyYT",
  "category": "Music",
  "publishedDate": "2009-10-24T23:57:33-07:00",
  "durationSeconds": 213,
  "durationFormatted": "03:33",
  "viewCount": 1842457545,
  "likeCount": 19524553,
  "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "transcriptStatus": "available",
  "transcriptLanguage": "en",
  "transcriptIsAutoGenerated": false,
  "transcriptText": "We're no strangers to love...",
  "transcriptSegments": [
    {
      "startSec": 18.64,
      "durationSec": 3.24,
      "timestamp": "00:18",
      "text": "♪ We're no strangers to love ♪"
    }
  ],
  "commentsStatus": "available",
  "commentCountTotal": 2400000,
  "scrapedCommentsCount": 200,
  "comments": [
    {
      "commentId": "UgwPwTibxdgqCHZxktd4AaABAg",
      "author": "@bdr8823",
      "authorChannelId": "UCdi6tGxvFvTRGe-7dAn7m7w",
      "isVerified": false,
      "isChannelOwner": false,
      "isPinned": false,
      "isHeartedByCreator": false,
      "text": "My algebra teacher said that this was a link to the test answers",
      "likeCount": 73000,
      "replyCount": 731,
      "publishedTimeText": "7 years ago",
      "replies": []
    }
  ]
}
```

#### 2. `flat_comments` Mode (CSV / Excel Ready)

Outputs one flat row per comment and reply, carrying key video and transcript fields on every row. When a video has zero comments or comments are disabled, a single `video_summary` row is returned instead.

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "channelHandle": "@RickAstleyYT",
  "viewCount": 1842457545,
  "likeCount": 19524553,
  "durationFormatted": "03:33",
  "publishedDate": "2009-10-24T23:57:33-07:00",
  "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "transcriptStatus": "available",
  "transcriptLanguage": "en",
  "recordType": "comment",
  "commentId": "UgwPwTibxdgqCHZxktd4AaABAg",
  "parentCommentId": null,
  "isReply": false,
  "commentAuthor": "@bdr8823",
  "commentAuthorChannelId": "UCdi6tGxvFvTRGe-7dAn7m7w",
  "commentText": "My algebra teacher said that this was a link to the test answers",
  "commentLikes": 73000,
  "commentReplyCount": 731,
  "commentPublishedTime": "7 years ago",
  "isPinned": false,
  "isChannelOwner": false,
  "isHeartedByCreator": false,
  "sourceQuery": "direct_url",
  "scrapedAt": "2026-11-30T08:00:00+00:00"
}
```

Note on `commentCountTotal`: YouTube's public total comment count includes both top-level comments and nested replies, and channels can hold or turn off comments. If `includeReplies` is off, `scrapedCommentsCount` counts only top-level comments.

### Pricing (Pay Per Event)

- `video` (`$0.002`): Charged once per video scraped.
- `transcript` (`$0.001`): Charged per video when `includeTranscript` is enabled and captions are extracted.
- `comment` (`$0.0002`): Charged per comment or reply extracted when `includeComments` is enabled.

# Actor input Schema

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

YouTube video URLs, 11-character video IDs, Shorts (/shorts/...), Channel URLs (/@handle), or Playlist URLs (?list=...).

## `searchKeywords` (type: `array`):

Optional search keywords to find YouTube videos and scrape their comments and transcripts.

## `maxVideos` (type: `integer`):

Maximum videos to collect from each channel, playlist, or keyword search. Set 0 for unlimited.

## `includeTranscript` (type: `boolean`):

Extract video subtitles/captions (prefers manual captions and falls back to auto-generated captions).

## `transcriptLanguages` (type: `array`):

Language codes in priority order (for example: en, bn, es, de). Falls back to available language if missing.

## `includeTimestamps` (type: `boolean`):

Include startSec, durationSec, timestamp, and text per caption line alongside full transcriptText.

## `includeComments` (type: `boolean`):

Extract comments from each video using pagination.

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

Maximum top-level comments to scrape per video. Set 0 to collect all available comments.

## `commentSortBy` (type: `string`):

Fetch Top comments first or Newest comments first. If Top is filtered early by YouTube, remaining unfiltered comments are automatically fetched from Newest.

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

Also scrape replies under each comment thread.

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

Maximum replies to fetch per comment thread when Include Replies is enabled.

## `outputFormat` (type: `string`):

per_video outputs one row per video with nested comments and full transcript; flat_comments outputs one row per comment or reply for CSV/Excel analysis.

## `proxyCountry` (type: `string`):

Country code for Apify Residential Proxy.

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

Number of videos processed simultaneously (1 to 10).

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxVideos": 20,
  "includeTranscript": true,
  "transcriptLanguages": [
    "en"
  ],
  "includeTimestamps": true,
  "includeComments": true,
  "maxCommentsPerVideo": 200,
  "commentSortBy": "top",
  "includeReplies": false,
  "maxRepliesPerComment": 10,
  "outputFormat": "per_video",
  "proxyCountry": "US",
  "maxConcurrency": 5
}
```

# Actor output Schema

## `overview` (type: `string`):

Table view with thumbnail, title, channel, views, likes, comment counts, transcript status, and video links.

## `allResults` (type: `string`):

Complete dataset with transcripts, segments, comments, and replies.

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

// Run the Actor and wait for it to finish
const run = await client.actor("codenest/youtube-unlimited-comments-transcript-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": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codenest/youtube-unlimited-comments-transcript-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/uTQ65SLfmYEwf8Qlh/builds/ankDaAHEOxnVFfI3N/openapi.json
