Dev.to AI 🤖 Ai 👁 0 📖 2 min read

Export YouTube Comments and Replies for Sentiment Analysis and Brand Monitoring (Whole Channels in One Run)

The comment section is where viewers say what they really think: what they loved, what confused them, what they'd buy and what annoyed them. For a brand, a creator or a product team, that's free market research. The hard

The comment section is where viewers say what they really think: what they loved, what confused them, what they'd buy and what annoyed them. For a brand, a creator or a product team, that's free market research. The hard part is getting it out of YouTube at scale.

This guide shows how to export comments and their replies from single videos, Shorts, playlists, the latest videos of entire channels or the top videos for a keyword. You can then run sentiment analysis or brand monitoring on them with any LLM.

What you get per comment

{
  "commentId": "UgwPwTibxdgqCHZxktd4AaABAg",
  "text": "My algebra teacher said that this was a link to the test answers",
  "author": "@bdr8823",
  "likeCount": 73000,
  "replyCount": 725,
  "publishedText": "7 years ago",
  "isPinned": false,
  "isReply": false,
  "videoTitle": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley"
}

Also included:

  • isHearted: hearted by the creator.
  • authorIsCreator: written by the channel owner.
  • isMember: written by a channel member.
  • parentCommentId: links each reply to its comment.
  • commentUrl: a direct link to the comment.
  • videoCommentCount: the video's total comment count.

Step 1: Choose your sources

Mix any of these in one run:

  • Video or Shorts URLs
  • A whole channel, such as https://www.youtube.com/@veritasium, with "max videos" choosing how many of the latest videos to take
  • Playlists
  • Search keywords, such as "iphone 17 review", to take the top videos for that query

Step 2: Configure and run

Open YouTube Comments Scraper and use:

{
  "startUrls": ["https://www.youtube.com/@veritasium"],
  "maxVideos": 20,
  "maxComments": 500,
  "sortBy": "newest",
  "includeReplies": true,
  "keywordFilter": ["price", "buy"]
}

The keyword filter is a money saver: only comments mentioning your words are kept, and filtered-out comments are free.

Step 3: Analyze with an LLM

Export to CSV or JSON, batch about 300 comments at a time, and prompt:

Classify each comment's sentiment (positive, negative, neutral) and topic (price, quality, shipping, feature request, comparison, question, other). Return counts per topic and sentiment, plus the 5 most-liked comments for each negative topic.

Weight results by likeCount. A complaint with 2,000 likes speaks for many more viewers than one with 0.

Use cases

  • Brand monitoring: track what people say about your product in reviews by other creators, not just on your own channel.
  • Competitor intelligence: pull comments from competitor product videos and read their customers' complaints.
  • Content ideas: the most-liked questions under popular videos are your next video titles.
  • Influencer vetting: are comments real conversations, or generic emoji spam?
  • AI datasets of authentic opinions for NLP.

From code

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("karioski/youtube-comments-scraper").call(run_input={
    "searchQueries": ["dyson v15 review"],
    "maxVideos": 10,
    "maxComments": 300,
    "includeReplies": False,
})
comments = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(len(comments), "comments from the top review videos")

Pricing

$1 per 1,000 comments or replies on paid Apify plans. Comments removed by your keyword filter cost nothing. Example: 10,000 comments from a competitor's channel cost $10.

Try it: YouTube Comments Scraper on Apify →

Disclosure: I built this tool. Questions or feature requests are welcome on the Actor page.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.