YouTube Comments Scraper with Replies avatar

YouTube Comments Scraper with Replies

Pricing

from $0.75 / 1,000 comment scrapeds

Go to Apify Store
YouTube Comments Scraper with Replies

YouTube Comments Scraper with Replies

Extract public YouTube comments and replies with text, likes, authors, badges, pinned and hearted signals, and creator interactions. No YouTube API key or login is required.

Pricing

from $0.75 / 1,000 comment scrapeds

Rating

0.0

(0)

Developer

Sebastián S

Sebastián S

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

18 days ago

Last modified

Features

Limited permissions

Share

Turn individual public YouTube videos and Shorts into clean comment rows with replies, likes, authors, badges, pinned and hearted signals, and creator interactions. No YouTube API key or YouTube login is required.

Paste one video URL and receive deterministic top-level and reply rows that are ready for analysis, community research, reporting, or downstream automation.

Quick start

  1. Open the Actor in Apify Console and select Try for free.
  2. Paste one public YouTube video URL, keep the bounded settings below, and select Start.
  3. Open the default dataset to inspect comment threads, download rows, or send them to another workflow.
{
"videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
"sort": "top",
"maxTopLevelCommentsPerVideo": 20,
"includeReplies": true,
"maxRepliesPerThread": 5,
"maxResultsPerVideo": 30,
"maxTotalResults": 30,
"includeVideoMetadata": true,
"includeAuthorDetails": true,
"includeTextReferences": true
}

Output preview

This schema-shaped preview uses sanitized offline fixture evidence, not a current observation from the selected public video. It preserves real output fields; threadId and parentCommentId connect the reply to its top-level comment. Signal values such as badges, hearts, pins, and relative publication text are volatile and may be false, null, or absent in a live run.

[
{
"recordType": "comment",
"status": "success",
"videoId": "aircAruvnKk",
"commentId": "sanitized-top-level",
"threadId": "sanitized-top-level",
"parentCommentId": null,
"kind": "top-level",
"text": "Sanitized public comment text.",
"likeCount": 128,
"replyCount": 3,
"repliesScraped": 1,
"replyFetchStatus": "complete",
"authorName": "Example Viewer",
"authorIsVerified": true,
"authorIsMember": false,
"authorBadges": ["Verified"],
"isPinned": true,
"isCreatorHearted": true,
"hasCreatorReply": true,
"isCreatorReply": false,
"publishedTimeText": "2 years ago"
},
{
"recordType": "comment",
"status": "success",
"videoId": "aircAruvnKk",
"commentId": "sanitized-reply",
"threadId": "sanitized-top-level",
"parentCommentId": "sanitized-top-level",
"kind": "reply",
"text": "Sanitized creator reply.",
"likeCount": 14,
"authorName": "Example Creator",
"authorIsCreator": true,
"authorBadges": ["Creator"],
"isPinned": false,
"isCreatorHearted": false,
"hasCreatorReply": false,
"isCreatorReply": true,
"publishedTimeText": "2 years ago"
}
]

Price for up to 30 comments

Billing eventCurrent priceCharged when
Actor Start$0.00005Once for this Actor's 512 MB run, using the minimum event.
comment-scraped$0.00075For each successfully stored top-level comment or reply.

The bounded example can store at most 30 successful comment rows, so its maximum charge is $0.02255: $0.00005 for Actor Start plus 30 x $0.00075. A run that returns fewer comments costs less. Empty, partial, and error status rows do not add a comment-scraped charge; the run still incurs Actor Start.

Need the video transcript too? Extract transcript text, timestamps, subtitles, and RAG chunks with the YouTube Transcript & Subtitle Scraper.

Showcase examples

These three provisional templates use distinct public videos and hard comment-row caps. Their source of truth is examples/showcase-examples.json, and offline tests keep the README inputs, previews, dataset views, and cost arithmetic aligned.

Each preview is an offline, sanitized projection of fields exercised by fixtures, not a claim about a video's current comments. Current live publication eligibility is tracked in the source manifest. No run-specific dataset links are published.

Newest comments

Me at the zoo is a long-lived public upload that makes newest-first behavior easy to understand. The input requests top-level comments only.

{
"videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
"sort": "newest",
"maxTopLevelCommentsPerVideo": 10,
"includeReplies": false,
"maxRepliesPerThread": 0,
"maxResultsPerVideo": 10,
"maxTotalResults": 10,
"includeVideoMetadata": true,
"includeAuthorDetails": true,
"includeTextReferences": false
}
  • Successful comment rows: 0 to 10. An empty or unavailable video can instead return a free typed status row.
  • Maximum cost: $0.00755 = $0.00005 start + 10 x $0.00075.
  • View: topLevelComments, using {{links.apiDefaultDatasetUrl}}/items?view=topLevelComments after the run.

Requested behavior is newest-first sorting. Offline evidence observes newest ordering plus the kind, parentCommentId, replyFetchStatus, and publishedTimeText field shapes; it does not establish the current first comment or current values on this video.

[
{
"recordType": "comment",
"status": "success",
"videoId": "jNQXAC9IVRw",
"commentId": "sanitized-newest-comment",
"threadId": "sanitized-newest-comment",
"parentCommentId": null,
"kind": "top-level",
"depth": 0,
"text": "[Sanitized public comment text]",
"replyFetchStatus": "not-requested",
"publishedTimeText": "[Volatile display text]"
}
]

Complete reply threads

What is web scraping and what it is used for is a focused public explainer from Apify. It is a modest candidate for showing parent-thread linkage while retaining a strict ceiling.

{
"videoUrls": ["https://www.youtube.com/watch?v=vKRuNIYGkBc"],
"sort": "top",
"maxTopLevelCommentsPerVideo": 3,
"includeReplies": true,
"maxRepliesPerThread": 0,
"maxResultsPerVideo": 20,
"maxTotalResults": 20,
"includeVideoMetadata": true,
"includeAuthorDetails": true,
"includeTextReferences": false
}
  • Successful comment rows: 0 to 20. maxRepliesPerThread: 0 requests every available reply for each selected thread, but the hard result cap or upstream gaps can still make the final thread partial.
  • Maximum cost: $0.01505 = $0.00005 start + 20 x $0.00075.
  • View: replies, using {{links.apiDefaultDatasetUrl}}/items?view=replies after the run. Inspect each top-level row's replyFetchStatus before treating a thread as complete.

Offline fixtures observe threadId, parentCommentId, kind, depth, repliesScraped, and complete, partial, and unavailable replyFetchStatus values. The illustrative complete state below is not a current claim about this video.

[
{
"recordType": "comment",
"status": "success",
"videoId": "vKRuNIYGkBc",
"commentId": "sanitized-thread",
"threadId": "sanitized-thread",
"parentCommentId": null,
"kind": "top-level",
"depth": 0,
"text": "[Sanitized top-level comment text]",
"replyCount": 1,
"repliesScraped": 1,
"replyFetchStatus": "complete"
},
{
"recordType": "comment",
"status": "success",
"videoId": "vKRuNIYGkBc",
"commentId": "sanitized-reply",
"threadId": "sanitized-thread",
"parentCommentId": "sanitized-thread",
"kind": "reply",
"depth": 1,
"text": "[Sanitized reply text]"
}
]

Creator interactions

Watch This Before You Make Another Decision is a public GaryVee upload whose description explicitly invites viewer comments and mentions the creator's team. That makes interaction signals more plausible, but no specific signal is promised.

{
"videoUrls": ["https://www.youtube.com/watch?v=v8cBTK45Uqw"],
"sort": "top",
"maxTopLevelCommentsPerVideo": 15,
"includeReplies": true,
"maxRepliesPerThread": 5,
"maxResultsPerVideo": 25,
"maxTotalResults": 25,
"includeVideoMetadata": true,
"includeAuthorDetails": true,
"includeTextReferences": false
}
  • Successful comment rows: 0 to 25. Pinned, creator-hearted, creator-reply, verified, and membership fields may be false or null on every current row.
  • Maximum cost: $0.01880 = $0.00005 start + 25 x $0.00075.
  • View: creatorInteractions, using {{links.apiDefaultDatasetUrl}}/items?view=creatorInteractions after the run.

The sanitized offline Innertube fixture observes the isPinned, isCreatorHearted, hasCreatorReply, isCreatorReply, authorIsCreator, authorIsVerified, authorIsMember, and authorBadges fields. The values below demonstrate that contract only; they are not current observations from this video.

[
{
"recordType": "comment",
"status": "success",
"videoId": "v8cBTK45Uqw",
"commentId": "sanitized-interaction",
"threadId": "sanitized-interaction",
"parentCommentId": null,
"kind": "top-level",
"text": "[Sanitized public comment text]",
"authorName": "Sanitized Viewer",
"authorIsVerified": true,
"authorIsMember": true,
"authorBadges": ["Verified", "Member"],
"isPinned": true,
"isCreatorHearted": true,
"hasCreatorReply": true,
"isCreatorReply": false
},
{
"recordType": "comment",
"status": "success",
"videoId": "v8cBTK45Uqw",
"commentId": "sanitized-creator-reply",
"threadId": "sanitized-interaction",
"parentCommentId": "sanitized-interaction",
"kind": "reply",
"text": "[Sanitized creator reply text]",
"authorName": "Sanitized Creator",
"authorIsCreator": true,
"isPinned": false,
"isCreatorHearted": false,
"hasCreatorReply": false,
"isCreatorReply": true
}
]

Running all three examples would allow at most 55 successful comment rows across three starts, for a strict cumulative maximum of $0.04140. Free video-status rows add no row charge.

As a secondary offline check, tests/fixtures/local-input.json exercises unsupported and invalid inputs. A representative sanitized status row is shown below. It emits no comment-scraped event, so a status-only run has a maximum cost of $0.00005 for Actor Start.

[
{
"recordType": "video-status",
"status": "error",
"inputIndex": 0,
"input": "[Sanitized unsupported YouTube URL]",
"videoId": null,
"errorCode": "UNSUPPORTED_INPUT_TYPE",
"retryable": false,
"commentsScraped": 0,
"topLevelCommentsScraped": 0,
"repliesScraped": 0
}
]

API and integrations

API, SDK, MCP, and n8n calls authenticate with your Apify account. They do not require a YouTube API key or YouTube login.

curl

Set APIFY_TOKEN to your Apify API token. This synchronous endpoint returns the default dataset items when the bounded run finishes within the API timeout.

curl -L -X POST \
'https://api.apify.com/v2/actors/sebastian-actors~youtube-comments-scraper/run-sync-get-dataset-items' \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
"sort": "top",
"maxTopLevelCommentsPerVideo": 20,
"includeReplies": true,
"maxRepliesPerThread": 5,
"maxResultsPerVideo": 30,
"maxTotalResults": 30,
"includeVideoMetadata": true,
"includeAuthorDetails": true,
"includeTextReferences": true
}'

JavaScript

Install apify-client, start the Actor, and read its default dataset.

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const input = {
videoUrls: ['https://www.youtube.com/watch?v=aircAruvnKk'],
sort: 'top',
maxTopLevelCommentsPerVideo: 20,
includeReplies: true,
maxRepliesPerThread: 5,
maxResultsPerVideo: 30,
maxTotalResults: 30,
includeVideoMetadata: true,
includeAuthorDetails: true,
includeTextReferences: true,
};
const run = await client.actor('sebastian-actors/youtube-comments-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python

Install apify-client, call the Actor, and list the resulting dataset items.

import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run_input = {
"videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
"sort": "top",
"maxTopLevelCommentsPerVideo": 20,
"includeReplies": True,
"maxRepliesPerThread": 5,
"maxResultsPerVideo": 30,
"maxTotalResults": 30,
"includeVideoMetadata": True,
"includeAuthorDetails": True,
"includeTextReferences": True,
}
run = client.actor("sebastian-actors/youtube-comments-scraper").call(run_input=run_input)
if run is None:
raise RuntimeError("Actor run did not finish")
items = client.dataset(run.default_dataset_id).list_items().items
print(items)

MCP

Connect an OAuth-capable MCP client to:

https://mcp.apify.com?tools=sebastian-actors/youtube-comments-scraper

Then ask the client to run the YouTube Comments Actor with this input and return the default dataset items:

{
"videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
"sort": "top",
"maxTopLevelCommentsPerVideo": 20,
"includeReplies": true,
"maxRepliesPerThread": 5,
"maxResultsPerVideo": 30,
"maxTotalResults": 30,
"includeVideoMetadata": true,
"includeAuthorDetails": true,
"includeTextReferences": true
}

n8n

For a ready-to-import Community Edition workflow that combines this Actor with the YouTube Transcript Actor and Google Sheets, see the ../n8n-youtube-research/README.md. It uses only built-in HTTP Request, Code, and Google Sheets nodes.

To build the comments request manually, add an HTTP Request node, select an HTTP Bearer Auth credential containing your Apify API token, and send a POST request to https://api.apify.com/v2/actors/sebastian-actors~youtube-comments-scraper/run-sync-get-dataset-items with the JSON body below.

{
"videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
"sort": "top",
"maxTopLevelCommentsPerVideo": 20,
"includeReplies": true,
"maxRepliesPerThread": 5,
"maxResultsPerVideo": 30,
"maxTotalResults": 30,
"includeVideoMetadata": true,
"includeAuthorDetails": true,
"includeTextReferences": true
}

Scope and affiliation

Unofficial integration. This Actor is not affiliated with, endorsed by, or sponsored by YouTube or Google.

The Actor is HTTP-only and limited to comments on individual public YouTube videos, Shorts, and ended live VODs. It does not crawl channels, playlists, search results, profiles, community posts, or live chat. It does not sign in, bypass access controls, use a browser, translate or rewrite text, analyze sentiment, post comments, or perform moderation.

Input

FieldDefaultLimits and behavior
videoUrlsRequired1 to 1,000 individual URLs or raw 11-character video IDs.
sorttopYouTube's top-comments ranking or newest.
maxTopLevelCommentsPerVideo100Maximum unique top-level comments; use 0 for all available.
includeRepliesfalseFetch replies beneath each top-level comment.
maxRepliesPerThread20Maximum replies per thread; use 0 for all available.
maxResultsPerVideo1000Hard cap across top-level comments and replies for one video.
maxTotalResults10000Hard run-wide comment-row cap.
includeVideoMetadatatrueInclude available video and channel metadata.
includeAuthorDetailstrueInclude author identity, badges, verification, and membership fields.
includeTextReferencestrueExtract links, channel mentions, and hashtags.
locale{"en", "US"}Language and country for the anonymous YouTube session.
cleaningSchema defaultsDeterministic text normalization without rewriting meaning.
maxVideoConcurrency4Concurrent videos, from 1 to 20; all requests share a six-slot ceiling.
maxReplyConcurrencyPerVideo3Concurrent reply threads per video, from 1 to 20.
maxRetriesPerRequest3Upper bound for same-session retries; the typed policy may cap it lower.
requestTimeoutSecs30Per-request timeout, from 10 to 120 seconds.
proxyConfigurationResidential Apify ProxyStandard Apify proxy configuration used for YouTube requests.
debugfalseSanitized phases and codes without comment text, identities, or secrets.

Supported inputs include youtube.com/watch, youtu.be, /shorts/, /embed/, /live/, youtube-nocookie.com/embed, music.youtube.com/watch, mobile watch URLs, and raw 11-character IDs. Watch URLs may contain playlist or tracking parameters, but only the validated video ID is retained.

Known channel, playlist, profile, community, and search URLs produce a free UNSUPPORTED_INPUT_TYPE status row. Valid inputs are deduplicated by video ID while retaining the first input and inputIndex.

Output and views

The default dataset is flat. Successful top-level comments and replies use recordType: "comment" and status: "success". Empty, partial, unavailable, and invalid inputs use free video-status rows.

Top-level rows use their own comment ID as threadId, a null parent, kind: "top-level", and depth: 0. Replies use the top-level ID for both threadId and parentCommentId, kind: "reply", and depth: 1.

Every comment can include canonical video and comment URLs, source and output positions, normalized text, links, mentions, hashtags, exact or approximate counts, reply completeness, author identity and badges, creator interactions, publication display text, provider, timing, warnings, and fetch time.

Dataset views provide focused tables for all, comments, topLevelComments, replies, creatorInteractions, errors, and partial. OUTPUT contains the aggregate run summary and VIDEO_SUMMARIES contains one entry per deduplicated valid video. The summary exposes sanitized request, retry, concurrency, session-rotation, and recovered-row counters so retry amplification and recovered comment cost can be measured without retaining upstream data.

Replies and ordering

Replies are fetched concurrently within a bounded worker pool, but output order within each video remains deterministic:

  1. Top-level comment
  2. Its replies
  3. Next top-level comment
  4. Its replies

replyFetchStatus is not-requested, no-replies, complete, partial, or unavailable. A reply failure does not invalidate a usable top-level comment. All rows are deduplicated by commentId, never by text or author.

Errors and retries

Explicitly empty comment text is preserved as "" with a COMMENT_TEXT_EMPTY warning; it remains a comment row under normal billing. Authored "N/A" text is preserved, never substituted for missing text. Missing or malformed content produces YOUTUBE_RESPONSE_CHANGED rather than a fabricated successful row, and failed extraction is not charged. A malformed reply leaves valid parent comments intact and produces a free partial status. This does not add image or GIF attachment extraction.

Stable errors include:

INVALID_VIDEO_INPUT, UNSUPPORTED_INPUT_TYPE, VIDEO_UNAVAILABLE, PRIVATE_VIDEO, MEMBERS_ONLY, AGE_RESTRICTED, LOGIN_REQUIRED, COMMENTS_DISABLED, NO_COMMENTS, LIVE_CHAT_NOT_SUPPORTED, CONSENT_REQUIRED, RATE_LIMITED, IP_BLOCKED, PROXY_ERROR, REQUEST_TIMEOUT, NETWORK_ERROR, CONTINUATION_EXPIRED, REPLY_CONTINUATION_UNAVAILABLE, YOUTUBE_RESPONSE_CHANGED, BUDGET_EXHAUSTED, and INTERNAL_ERROR.

The Actor makes at most two full-video attempts. Each attempt owns one anonymous Innertube session, proxy identity, and Undici dispatcher; metadata, comments, continuations, and replies stay on that identity. A rotation always closes the current attempt before creating the next one.

The typed request policy retries connection and HTTP 5xx failures at most once on the same session. Rate limits retry once, while timeout and unexpected-empty retries honor maxRetriesPerRequest. Proxy and IP-block failures rotate immediately rather than reusing a blocked identity. After the same-session allowance is exhausted, these recoverable failures can rotate once. Deterministic playability, disabled-comments, no-comments, login, age, membership, parser, continuation-shape, and unsupported-input failures never rotate.

Resume behavior

Checkpoints are updated only after successful dataset writes. They preserve configuration-sensitive completion keys, per-video continuations, counters, attempts, and compressed segments of emitted comment IDs. A rotated or resumed attempt uses the saved continuation when valid; if it must restart from page one, emitted IDs are skipped so rows are neither duplicated nor re-charged.

Runtime memory

Runs default to 512 MB and accept 512 MB to 1,024 MB. Reply fetching and parser-page buffering remain bounded; use 1,024 MB only when diagnosing unusually heavy public threads.

Development

Node.js 22.19 or newer within the Node 22 release line is required. Dependencies are pinned exactly and package-lock.json is committed.

npm ci
npm run check

The default verification is offline. Optional live tests require an explicit flag:

$RUN_LIVE_TESTS=true npm run test:live

Responsible use

Only public comments are supported. Videos and comments can be unavailable, private, members-only, age-restricted, region-restricted, disabled, rate-limited, IP-blocked, or changed by YouTube. The Actor does not bypass these controls.

Use the Actor only when you have the right to collect and process the data. Follow YouTube's terms, applicable privacy and data-protection law, and the rules of your jurisdiction. You are responsible for retention, redistribution, and downstream use.