YouTube Comments Scraper: Comment Analytics & Keyword Search avatar

YouTube Comments Scraper: Comment Analytics & Keyword Search

Pricing

Pay per usage

Go to Apify Store
YouTube Comments Scraper: Comment Analytics & Keyword Search

YouTube Comments Scraper: Comment Analytics & Keyword Search

Scrape YouTube comments effortlessly with this Apify YouTube Comments Scraper. Extract video comments, usernames, timestamps, likes, and replies from any public video or channel. Ideal for sentiment analysis, audience research, and content strategy. Fast, accurate, and easy to integrate.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

API Empire

API Empire

Maintained by Community

Actor stats

0

Bookmarked

8

Total users

2

Monthly active users

7 days ago

Last modified

Share

YouTube Scraper — Extract Comments and Engagement Analytics as JSON

YouTube Comments Scraper: Comment Analytics & Keyword Search extracts comments, replies, and per-video engagement analytics from any YouTube video, channel, or playlist. Give it a video URL, a channel handle, or a playlist link — channels and playlists auto-expand to member videos — and it returns every comment plus a computed rollup (average likes, reply ratio, top comment) per video, filtered by keyword, engagement, or date. Every result ships as typed, normalized JSON — no HTML, no parsing. Monitor engagement across a whole channel or playlist in one run.

YouTube Comments Scraper: Comment Analytics & Keyword Search is an Apify Actor that pulls comments and replies from YouTube videos and computes a per-video engagement rollup across every video it touches. It accepts direct video URLs/IDs, channel URLs, or playlist URLs, expanding channels and playlists into their member videos automatically before scraping comments on each one. No YouTube account, login, or API key is required — it reads the same public watch, channel, and playlist pages any visitor's browser loads. It is also callable by AI agents through Apify's Actors MCP Server.

  • Scrape comments and replies (text, author, likes, replies, publish time, pinned/verified/creator-heart flags) from any video
  • Expand a channel or playlist URL into its member videos and scrape comments across all of them in one run
  • Get a per-video engagement rollup (avg likes/comment, reply ratio, top comment) for at-a-glance monitoring across many videos
  • Filter by minimum likes, minimum replies, a date window (absolute or relative), and include/exclude keywords
  • No proxy management — automatic escalation from no-proxy to datacenter to residential proxy on a block

What data does YouTube Comments Scraper: Comment Analytics & Keyword Search collect?

The Actor returns two distinct row types in the same dataset: individual comments/replies and one engagement rollup per video.

Data TypeKey FieldsJSON Field Names
Comments & repliescomment text, author, like count, reply count, publish time, reply flagcomment, author, voteCount, replyCount, isReply, replyToCid
Comment metadatapinned/verified/creator-heart status, avatar, direct comment linkisPinned, isVerified, hasCreatorHeart, avatar, commentUrl
Video engagement rollupavg likes per comment, reply ratio, top commentavgLikesPerComment, replyRatio, topCommentText, topCommentVoteCount
Video & discovery contextvideo title, total comment count, discovery sourcetitle, commentsCount, discoveryMode, sourceUrl, playlistId

Need more YouTube data?

If you also need creator outreach data, YouTube Scraper With Creator Contact & Lead Enrichment pulls channel contact details and lead-scoring fields alongside video data, and YouTube Channel Finder With Contact Info Extraction resolves channels straight to their public contact info. For the video content itself rather than the comments, YouTube Transcript Scraper With AI Insights extracts transcripts and AI-generated summaries from the same videos.

How does YouTube Comments Scraper differ from the official YouTube API?

The YouTube Data API v3 returns comments through its commentThreads resource one video at a time under a shared daily quota budget; YouTube Comments Scraper: Comment Analytics & Keyword Search fetches comments across an unlimited list of videos, channels, and playlists in a single run with no quota approval step.

FeatureYouTube Data API v3This Scraper
SetupGoogle Cloud project + API key or OAuth consent screenRun directly on Apify with a URL — no API key or approval step
Access modelGoverned by a daily quota budget set on the Google Cloud project, shared across all API callsGoverned by the Actor's own proxy escalation and retry logic, not an external quota
Channel/playlist expansionRequires separate calls (e.g. playlistItems, search) chained and paginated manuallyBuilt in — a channel or playlist URL auto-expands to member videos in the same run
Engagement/date/keyword filteringNot supported server-side; all comments must be fetched, then filtered client-sideminLikes, minReplyCount, date window, and keyword filters applied before rows are pushed
Output shapeNested API resource JSON per comment threadFlattened, typed JSON row per comment or per-video rollup
Engagement analyticsNot provided — callers compute their own aggregatesPer-video rollup (avg likes/comment, reply ratio, top comment) computed automatically

If you already have Google Cloud API access approved and only need comment threads from a small, known set of videos, the official API is the more direct path. If you need comments aggregated across a whole channel or playlist with built-in engagement filtering and no quota-approval process, this Actor removes that setup work.

Why do developers and teams scrape YouTube comments?

For marketers and brand teams

Point the Actor at your own channel or a competitor's and pull every comment across their recent uploads that mentions a product name, campaign hashtag, or complaint keyword using keywordSearch. Combine that with minLikes to surface only comments the audience actually engaged with, and use the per-video avgLikesPerComment/replyRatio rollup to compare engagement quality across a channel's last dozen videos without opening each one manually. This turns comment sections into a lightweight, ongoing brand-monitoring feed you can re-run on a schedule against any public channel.

For researchers and analysts

Academic and market researchers studying audience reaction, misinformation spread, or community sentiment can pull every public comment on a video or across a full playlist, bounded to a date window with oldestCommentDate/newestCommentDate. Because the Actor only reads comments already visible to any logged-out visitor, the resulting dataset stays within publicly accessible data — useful for a comment corpus for manual coding or downstream NLP without needing YouTube API quota approval or a research-access application first. The dateEstimated flag on every row also flags which publish dates are estimated from relative text.

For AI engineers and agent builders

Feed comment, author, voteCount, and publishedAt straight into a RAG index or an agent's tool-call output without writing an HTML parser — the Actor already returns typed JSON keyed by stable field names. An agent monitoring a client's channel can call this Actor on a schedule, filter by minReplyCount to catch comments that started a real discussion thread, and pass the per-video video_rollup row to an LLM as a compact engagement summary instead of feeding it hundreds of raw comment rows for every video in the run.

For community managers and moderation teams

Use excludeKeywords to flag comments containing spam links or banned phrases, and oldestCommentDate to pull only comments posted since your last moderation pass, across every video in a channel or playlist in one run instead of checking each video's comment section by hand. The isPinned and authorIsChannelOwner flags let you separate creator replies and pinned announcements from the general comment stream when reviewing moderation queues, and replyToCid reconstructs which comment each flagged reply actually belongs to before you act on it.

How to scrape YouTube comments (step by step)

  1. Open YouTube Comments Scraper: Comment Analytics & Keyword Search on the Apify Store and start a new run.
  2. Add one or more entries to targetUrls — a video URL/ID, a channel URL (youtube.com/@handle, /channel/UC…), or a playlist URL (youtube.com/playlist?list=…).
  3. Set your comment filters — commentLimit, minLikes, minReplyCount, oldestCommentDate/newestCommentDate, and keywordSearch/excludeKeywords — plus maxVideosPerChannel/maxVideosPerPlaylist if you added a channel or playlist.
  4. Start the run and watch the log for how many videos were resolved and how many comment rows were pushed per video.
  5. Download results as JSON or CSV from the run's dataset, or pull them via the Apify API.

What to do when YouTube changes its structure

This Actor has already been rebuilt once to track a real YouTube change — it reads the current lockupViewModel renderer YouTube migrated channel and playlist pages to, with the older videoRenderer grid kept only as a fallback. The Actor is maintained, and the output field names and row shapes stay stable on your end regardless of what YouTube changes underneath.

⬇️ Input

ParameterRequiredTypeDescriptionExample Value
targetUrlsNoarrayVideo URLs/11-char IDs, channel URLs, or playlist URLs. Auto-detected and expanded. Base key startUrls still accepted.["https://www.youtube.com/watch?v=KrLj6nc516A"]
commentLimitNointegerMax comments to fetch per video (0 = all available). Filters below narrow this budget, never expand it. Base key maxComments.50
commentOrderNostring (enum: top, newest)top = most liked/relevant first (YouTube default); newest = most recent first. Base key sortOrder."top"
minLikesNointegerDrop comments with fewer than this many likes. Default 0 = no floor.10
minReplyCountNointegerDrop comments with fewer than this many replies. Default 0 = no floor.2
oldestCommentDateNostring (datepicker)Keep comments published on/after this date — absolute (2026-06-01) or relative ("2 weeks", "3 months"). Estimated, never exact."3 months"
newestCommentDateNostring (datepicker)Keep comments published on/before this date. Same absolute-or-relative, estimated-date rules."2026-07-25"
keywordSearchNoarrayKeep only comments containing at least one of these keywords/phrases (case-insensitive). Empty = keep all.["love it", "amazing"]
excludeKeywordsNoarrayDrop any comment containing any of these keywords/phrases.["subscribe to my channel", "http"]
maxVideosPerChannelNointegerWhen a channel URL is given, expand at most this many videos from its Videos tab. Default 5.10
maxVideosPerPlaylistNointegerWhen a playlist URL is given, expand at most this many member videos (0 = all). Default 10.25
includeVideoRollupNobooleanEmit one extra type="video_rollup" summary row per video. Computed over all comments fetched, independent of filters above. Default true.true
proxySettingsNoobjectApify Proxy configuration. No proxy used by default; auto-escalates to datacenter/residential on a block. Base key proxyConfiguration.{"useApifyProxy": false}
commentLanguageNostringLanguage code (hl) sent to YouTube; affects relative-time phrasing like "ago". Default en-GB. Base key language."en-GB"
commentRegionNostringRegion code (gl) sent to YouTube. Default US. Base key region."US"

Required per schema: none.

{
"targetUrls": ["https://www.youtube.com/watch?v=KrLj6nc516A"],
"commentLimit": 50,
"commentOrder": "top",
"minLikes": 5,
"minReplyCount": 0,
"oldestCommentDate": "3 months",
"newestCommentDate": "",
"keywordSearch": [],
"excludeKeywords": ["subscribe to my channel"],
"maxVideosPerChannel": 5,
"maxVideosPerPlaylist": 10,
"includeVideoRollup": true,
"proxySettings": { "useApifyProxy": false },
"commentLanguage": "en-GB",
"commentRegion": "US"
}

The most common mistake: setting a low commentLimit and expecting minLikes or keywordSearch to pull in more comments to compensate — the filters only narrow the comments already fetched inside that budget, they never trigger extra fetching.

⬆️ Output

Results are typed, normalized JSON, exported as JSON, CSV, or Excel directly from the Apify dataset. The Actor pushes two structurally different row shapes into the same dataset — filter on the type field to separate them.

Comment and reply rows (type: "comment")

{
"cid": "UgxKrEHKV1uS0AZ9fMB4AaABAg",
"type": "comment",
"isPinned": false,
"publishedTimeText": "2 weeks ago",
"comment": "This tutorial saved me so much time, thank you!",
"author": "@devlearner42",
"avatar": "https://yt3.ggpht.com/abc123-avatar-thumbnail",
"authorIsChannelOwner": false,
"isVerified": false,
"voteCount": 214,
"hasCreatorHeart": true,
"replyCount": 3,
"replyToCid": null,
"videoId": "KrLj6nc516A",
"pageUrl": "https://www.youtube.com/watch?v=KrLj6nc516A",
"title": "How to Build a Web Scraper in 2026",
"commentsCount": 1842,
"commentUrl": "https://www.youtube.com/watch?v=KrLj6nc516A&lc=UgxKrEHKV1uS0AZ9fMB4AaABAg",
"publishedAt": "2026-07-11T09:20:00Z",
"dateEstimated": true,
"isReply": false,
"discoveryMode": "directVideo",
"sourceUrl": null,
"playlistId": null,
"playlistPosition": null,
"scrapedAt": "2026-07-25T09:20:00Z"
}

Video engagement rollup rows (type: "video_rollup")

{
"cid": null,
"type": "video_rollup",
"isPinned": null,
"publishedTimeText": null,
"comment": null,
"author": null,
"avatar": null,
"authorIsChannelOwner": null,
"isVerified": null,
"voteCount": null,
"hasCreatorHeart": null,
"replyCount": null,
"replyToCid": null,
"videoId": "KrLj6nc516A",
"pageUrl": "https://www.youtube.com/watch?v=KrLj6nc516A",
"title": "How to Build a Web Scraper in 2026",
"commentsCount": 1842,
"commentUrl": null,
"publishedAt": null,
"dateEstimated": null,
"isReply": null,
"discoveryMode": "directVideo",
"sourceUrl": null,
"playlistId": null,
"playlistPosition": null,
"totalCommentsAnalyzed": 187,
"avgLikesPerComment": 24.6,
"replyRatio": 0.32,
"topCommentText": "This tutorial saved me so much time, thank you!",
"topCommentVoteCount": 214,
"topCommentAuthor": "@devlearner42",
"scrapedAt": "2026-07-25T09:20:00Z"
}

commentLimit sets the per-video fetch cap — 0 means no cap and the Actor paginates through YouTube's youtubei/v1/next continuation tokens until it runs out of comments. There is no hard result ceiling built into the Actor itself beyond that setting. For channel and playlist runs, maxVideosPerPlaylist caps how many member videos are expanded (0 fetches all of them), while maxVideosPerChannel (default 5) caps videos pulled from a channel's Videos tab — note that setting it to 0 returns zero channel videos rather than "all," unlike the playlist parameter, so leave it at its default or set an explicit number for channel runs. Every comment row still passes through the minLikes/minReplyCount/date/keyword filters after fetching, so the number of rows actually pushed to the dataset can be smaller than the fetch budget you set.

Integrate YouTube Comments Scraper: Comment Analytics & Keyword Search and automate your workflow

YouTube Comments Scraper: Comment Analytics & Keyword Search works with any language or tool that can send an HTTP request.

REST API integration

import requests
ACTOR_ID = "your-username~youtube-comments-scraper-comment-analytics-keyword-search"
TOKEN = "YOUR_APIFY_API_TOKEN"
run_input = {"targetUrls": ["https://www.youtube.com/watch?v=KrLj6nc516A"], "commentLimit": 50}
resp = requests.post(
f"https://api.apify.com/v2/acts/{ACTOR_ID}/run-sync-get-dataset-items?token={TOKEN}",
json=run_input,
)
for row in resp.json():
print(row["type"], row.get("comment") or row.get("avgLikesPerComment"))

Works in Python, Node.js, Go, Ruby, cURL.

MCP for AI agents

This Actor is reachable through Apify's Actors MCP Server, which exposes any Apify Actor as an MCP tool:

APIFY_TOKEN=your_token npx -y @apify/actors-mcp-server --actors your-username/youtube-comments-scraper-comment-analytics-keyword-search

Compatible with Claude Desktop, Claude Code, and any MCP-capable agent client.

Automation platforms (n8n, Make)

In n8n, the Apify node's "Run Actor" operation starts this Actor and its "Get Dataset Items" operation retrieves the comment and rollup rows once the run completes, so you can chain them straight into a Slack or Sheets node. In Make, the Apify app's "Run an Actor" module starts the run and its "Get Dataset Items" module pulls the resulting rows into the rest of your scenario — no custom HTTP module required on either platform.

Scraping publicly available YouTube data, including comments visible to any logged-out visitor, is generally permitted. YouTube Comments Scraper: Comment Analytics & Keyword Search returns only comments, authors, and video metadata already visible on public watch, channel, and playlist pages — it does not access private videos, unlisted comments, or anything behind a login. Commenter display names, avatars, and comment text can constitute personal data under GDPR and CCPA, so storing or reusing this data at scale carries obligations around lawful basis, retention, and data subject rights, separate from YouTube's own Terms of Service on automated access. Consult legal counsel for commercial use cases involving bulk personal data.

Frequently asked questions

Does it work without a YouTube account?

Yes. No YouTube login, account, or API key is required — the Actor reads the same public watch, channel, and playlist pages any visitor's browser loads, anonymously.

How often is the scraped data updated?

Every run fetches comments live from YouTube at the time it runs — there is no caching layer, so re-running the Actor returns the current state of the comment section.

What happens if a video has comments disabled, is deleted, or the URL is invalid?

The Actor logs an error for that specific video and returns zero rows for it, then continues to the next video in the batch. If none of the provided URLs resolve to any video at all (for example, an invalid channel or playlist link), the run ends with no dataset rows and an error logged explaining that no videos were resolved.

Can I scrape private videos or comments on age-restricted/comments-disabled videos?

No. The Actor only returns comments that are publicly visible on YouTube's own comment feed — it does not bypass login walls, age gates, or channels that have comments disabled.

Does it work for AI agent workflows and LLM pipelines?

Yes — it's callable through Apify's Actors MCP Server (npx -y @apify/actors-mcp-server --actors your-username/youtube-comments-scraper-comment-analytics-keyword-search) or as a plain HTTP endpoint from any agent framework. Every response is typed JSON, so there's no HTML-parsing step before handing rows to an LLM.

How does it handle YouTube's anti-bot measures?

It starts with no proxy and automatically escalates to an Apify datacenter proxy, then to a residential proxy, when a request comes back blocked (HTTP 403/429), retrying each request up to three times as it does.

Does it return data in a format LLMs can use directly?

Yes. Every row is typed, normalized JSON with stable field names — no HTML and no selectors to parse before indexing it into a vector store or passing it to an LLM context window.

Can I use it without managing proxies?

Yes. No proxy is used by default, and the Actor manages its own proxy escalation internally if YouTube blocks a request — you only need to supply Apify Proxy credentials if you want residential proxies from the start.

How does the comment analytics rollup actually work?

It's a real computed aggregation, not a sentiment or NLP model: for each video, the video_rollup row averages voteCount across all fetched comments (avgLikesPerComment), divides the number of replies by the total comment count (replyRatio), and picks the single highest-voteCount comment as topComment. It reflects engagement volume, not the emotional tone of the comments.

What happens when YouTube changes its structure or blocks the scraper?

The Actor is maintained, and its output field names and row shapes stay stable on your end even when YouTube changes its underlying page structure — as already happened once with the channel/playlist renderer migration this Actor has been updated to handle.

Your feedback

Found a bug or a field that doesn't match what's documented here? We want to know — report it through the Issues tab on this Actor's Apify Store page. Active maintenance depends on hearing what breaks first.