Back to Blog
YouTube

YouTube Comment Scraper: Mine Viewer Feedback for Video Ideas

November 28, 2025
5 min read
S
By SociaVault Team
YouTubeCommentsSentiment AnalysisContent Strategy

YouTube Comment Scraper: Mine Viewer Feedback for Video Ideas

A video with 5,000 comments is a goldmine you'll never read by hand. Buried in there are your next three video ideas ("can you do a part 2 on X?"), a bug report you need to know about ("audio desyncs at 2:30"), and the honest sentiment that the like/dislike ratio hides ("love your stuff but this one felt rushed"). The top comments YouTube surfaces are the loudest, not the most useful.

This guide scrapes a video's comments and automatically sorts them into the buckets that matter — questions, sentiment, recurring themes — so the focus group that's already running in your comments section actually informs your content. Code in JavaScript and Python.

Step 1: Pull the comments

The video/comments endpoint takes the video url, an order (top or newest), and a continuationToken for paging.

const API_KEY = process.env.SOCIAVAULT_API_KEY;
const BASE = "https://api.sociavault.com/v1";

async function getComments(videoUrl, order = "top") {
  const res = await fetch(
    `${BASE}/scrape/youtube/video/comments?url=${encodeURIComponent(videoUrl)}&order=${order}`,
    { headers: { "x-api-key": API_KEY } },
  );
  const json = await res.json();
  if (!json.success) return [];
  // Log json.data once to confirm the comments array + field names.
  return json.data.comments || [];
}

Each comment gives you the text, the author, and a like count. For thousands of comments, page through with the continuationToken from the response (set a page cap so you don't burn credits on a megaviral video).

Step 2: Surface the questions

Questions are the single highest-value comment type — viewers literally telling you what to make next.

function findQuestions(comments) {
  return comments
    .filter((c) => c.text.includes("?"))
    .sort((a, b) => (b.likeCount || 0) - (a.likeCount || 0)); // most-liked first
}

const comments = await getComments("https://www.youtube.com/watch?v=VIDEO_ID");
const questions = findQuestions(comments);
questions.slice(0, 10).forEach((q) => console.log(`${q.text}`));

Sorting by likes matters: a question 200 people upvoted is a video topic with built-in demand, not just one person's whim.

Step 3: A quick sentiment read

A keyword pass is crude but genuinely useful for a fast "did this land?" check. For anything serious, swap the keyword sets for a real sentiment model — the scraping stays identical, only the scoring changes.

import os, requests

API_KEY = os.environ["SOCIAVAULT_API_KEY"]
BASE = "https://api.sociavault.com/v1"

def get_comments(url, order="top"):
    r = requests.get(f"{BASE}/scrape/youtube/video/comments",
                     params={"url": url, "order": order},
                     headers={"x-api-key": API_KEY}).json()
    return r.get("data", {}).get("comments", [])

POS = {"love", "great", "amazing", "best", "helpful", "thank"}
NEG = {"hate", "bad", "boring", "worst", "rushed", "disappointed"}

def sentiment(comments):
    pos = sum(any(w in c["text"].lower() for w in POS) for c in comments)
    neg = sum(any(w in c["text"].lower() for w in NEG) for c in comments)
    total = pos + neg or 1
    return {"positive": pos, "negative": neg, "ratio": round(pos / total * 100, 1)}

print(sentiment(get_comments("https://www.youtube.com/watch?v=VIDEO_ID")))

Step 4: Find recurring themes

The real signal is repetition. If forty people mention the same thing, that's not noise — it's a priority. Group by keyword and rank:

function themes(comments, keywords) {
  return keywords
    .map((kw) => ({
      keyword: kw,
      count: comments.filter((c) => c.text.toLowerCase().includes(kw)).length,
    }))
    .filter((t) => t.count > 0)
    .sort((a, b) => b.count - a.count);
}

console.log(
  themes(comments, ["part 2", "tutorial", "price", "music", "where", "how"]),
);

Putting it to work

Your comments section is a focus group that never sleeps. Scraping it lets you reply to high-value questions fast (which boosts engagement), catch problems the moment negativity spikes, and build next month's content calendar from what viewers are actually asking for. Run it on competitors' videos too — their comments are full of unmet requests you can answer first.

Frequently Asked Questions

How do I scrape comments from a YouTube video?

Call a comments endpoint with the video URL and an order (top or newest), then read the returned comments array. For long threads, page through with the continuation token from each response. The code above shows the full flow with sorting and analysis.

Can I get all comments on a video?

You can page through comments using the continuation token until you've collected as many as you need. On videos with hundreds of thousands of comments, set a page cap — you rarely need every single one to get a representative read, and each page costs a credit.

How do I find video ideas from comments?

Filter comments for questions (text containing "?") and sort by like count. The most-upvoted questions are topics with proven demand — viewers telling you exactly what to make next. The guide includes a ready-to-use function for this.

Is the keyword sentiment analysis accurate?

It's a quick directional check, not a precise measurement. For a fast "did this video land?" read it's fine; for rigorous analysis, feed the comment text into a proper sentiment model. The scraping step is the same either way — only the scoring changes.

Can I analyze a competitor's video comments?

Yes. Their comments are public, and they're often full of requests the competitor hasn't fulfilled — which is a content opportunity for you. Scraping competitor comments is one of the most underrated forms of topic research.

How much does it cost?

One credit per page of comments. A typical analysis of a video's top comments is a few credits; only megaviral videos with deep paging cost more, which is why a page cap is worth setting.

The bottom line

Stop guessing what your audience wants when they're telling you in the comments. Scrape them, surface the questions and themes, and turn a wall of text into a content calendar. A few lines of code beats scrolling forever.

Want to mine your comments? Start free with SociaVault with 50 credits.

Found this helpful?

Share it with others who might benefit

Ready to Try SociaVault?

Start extracting social media data with our powerful API. No credit card required.