Reading a comment section is a good way to learn what an audience doesn’t understand yet. Reading three of them, each with a few thousand comments, is a waste of an afternoon. This post builds a small Node.js script that does the first pass for you: it pulls the comments, groups replies under their parent comments, and writes a Markdown report with the questions, requests and threads worth reading.

The data comes from YouTube Comments Scraper, an Apify actor that takes video URLs and returns one dataset row per comment or reply. It doesn’t need a YouTube API key or a Google Cloud project. You call it with your Apify token through apify-client.

I ran everything below on 3 December 2026 against two videos from 3Blue1Brown’s neural network series, plus one fake video ID to check error handling.

The input

The actor takes five fields that matter here:

Field What it does
startUrls Array of { url } objects. watch?v=, youtu.be, /shorts/, /live/ and /embed/ links all work.
maxComments Top-level comments per video, default 100. Replies are not counted against it.
sortBy top (default) or newest.
includeReplies Also fetch replies, each as its own row. Default false.
maxRepliesPerComment Reply cap per comment when replies are on. Default 10.

There’s also an optional proxyConfiguration. Leave it out: the actor retries blocked requests through Apify Proxy on its own.

The output

Each row has a type of comment or reply. The fields the script uses:

  • commentId, parentCommentId: replies carry the ID of the comment they answer; top-level comments have null.
  • text, likeCount, replyCount, commentUrl.
  • isHeartedByCreator, authorIsChannelOwner: whether the video’s creator hearted the comment, and whether the row was written by the creator.
  • videoId, videoTitle, videoUrl, totalCommentsText: repeated on every row, so you can group by video without a second lookup.
  • error: only present on the row for a video that couldn’t be scraped (private, removed, comments off).

likeCount is converted from YouTube’s display text, so large values are rounded: 3.1K arrives as 3100.

The script

Set up a project:

mkdir yt-comment-report && cd yt-comment-report
npm init -y && npm pkg set type=module
npm install apify-client

Save this as comment-report.js:

import { ApifyClient } from 'apify-client';
import { writeFile } from 'node:fs/promises';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const REQUEST_PATTERN =
    /\b(please|pls|can you|could you|next video|part 2|make a video|do a video|tutorial on)\b/i;

async function fetchComments(videoUrls) {
    const run = await client.actor('novi/youtube-comments-scraper').call({
        startUrls: videoUrls.map((url) => ({ url })),
        maxComments: 300,
        sortBy: 'top',
        includeReplies: true,
        maxRepliesPerComment: 5,
    });
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    return items;
}

function groupThreads(rows) {
    const threads = new Map();
    for (const row of rows.filter((r) => r.type === 'comment')) {
        threads.set(row.commentId, { ...row, replies: [] });
    }
    for (const reply of rows.filter((r) => r.type === 'reply')) {
        threads.get(reply.parentCommentId)?.replies.push(reply);
    }
    return [...threads.values()];
}

const byLikes = (a, b) => b.likeCount - a.likeCount;
const oneLine = (text) => text.replace(/\s+/g, ' ').slice(0, 160);
const bullet = (c) => `- (${c.likeCount} likes, ${c.replyCount} replies) ${oneLine(c.text)} [link](${c.commentUrl})`;

function section(title, comments, limit = 10) {
    const lines = comments.slice(0, limit).map(bullet);
    return [`### ${title} (${comments.length})`, ...(lines.length ? lines : ['- none']), ''];
}

function videoReport(threads) {
    const { videoTitle, videoUrl, totalCommentsText } = threads[0];
    const questions = threads.filter((t) => t.text.includes('?')).sort(byLikes);
    const requests = threads.filter((t) => REQUEST_PATTERN.test(t.text)).sort(byLikes);
    const creatorTouched = threads
        .filter((t) => t.isHeartedByCreator || t.replies.some((r) => r.authorIsChannelOwner))
        .sort(byLikes);
    const debated = threads
        .filter((t) => t.replyCount > 0)
        .sort((a, b) => b.replyCount - a.replyCount);
    return [
        `## [${videoTitle}](${videoUrl})`,
        `${threads.length} top-level comments scraped, ${totalCommentsText} shown on YouTube.`,
        '',
        ...section('Questions', questions),
        ...section('Requests', requests),
        ...section('Creator hearted or replied', creatorTouched),
        ...section('Most replies', debated, 5),
    ].join('\n');
}

const videoUrls = process.argv.slice(2);
if (videoUrls.length === 0) {
    console.error('Usage: node comment-report.js <youtube-url> [more urls...]');
    process.exit(1);
}

const rows = await fetchComments(videoUrls);
for (const failed of rows.filter((r) => r.error)) {
    console.warn(`Skipped ${failed.videoUrl}: ${failed.error}`);
}
const threads = groupThreads(rows.filter((r) => !r.error));
const videoIds = [...new Set(threads.map((t) => t.videoId))];
const report = videoIds
    .map((id) => videoReport(threads.filter((t) => t.videoId === id)))
    .join('\n\n');

await writeFile('comment-report.md', `# Comment report\n\n${report}\n`);
console.log(`Wrote comment-report.md from ${rows.length} rows`);

Run it with your Apify token (Console → Settings → API & Integrations) and one or more URLs. Quote the URLs, because ? is a glob character in zsh:

export APIFY_TOKEN=<your token>
node comment-report.js 'https://www.youtube.com/watch?v=aircAruvnKk' 'https://youtu.be/IHZwWFHWa-w'

How it works

fetchComments starts one actor run for all the URLs and waits for it. actor().call() resolves when the run finishes, and listItems() reads the run’s dataset. For a few thousand rows a single listItems() call is fine. For much larger runs, page through with offset and limit.

groupThreads rebuilds the conversation. Top-level comments go into a Map keyed by commentId, then each reply is attached to its parent through parentCommentId. The optional chaining guards against a reply whose parent isn’t in the dataset. I never saw that happen, but a report shouldn’t crash over one orphan.

videoReport applies four filters per video:

  1. Questions: anything containing ?, sorted by likes.
  2. Requests: a regex for phrases like “can you”, “next video”, “tutorial on”.
  3. Creator hearted or replied: comments with isHeartedByCreator, or with a reply whose authorIsChannelOwner is true. This needs includeReplies: true to see the replies.
  4. Most replies: the threads people argued in.

Error rows are logged and dropped before grouping, so one dead link doesn’t stop the report.

What came back

With the two 3Blue1Brown videos and a fake ID, the script finished in 17 seconds and read 1,202 rows: 600 top-level comments, about 600 replies, and one error row (Video is unavailable, private or removed).

An excerpt from the gradient descent video:

## [Gradient descent, how neural networks learn | Deep Learning Chapter 2](https://www.youtube.com/watch?v=IHZwWFHWa-w)
300 top-level comments scraped, 3,670 shown on YouTube.

### Questions (50)
- (1800 likes, 16 replies) Did anybody else feel bad for the network after he called the output utter trash?😢
- (771 likes, 4 replies) 3:38 you missed the chance of using the meme "AI: I've found an output, but at what cost?"
- (39 likes, 3 replies) How do you do your amazing graphics? What kind of software do you use? ...
- (11 likes, 2 replies) Something I don't really get is how the gradient is calculated. ...

### Creator hearted or replied (7)
- (73 likes, 6 replies) Pretty sure at 11:03 the weights should either start at w1 or end at w13,001.
...

(Links trimmed here.) The creator-engaged list is the most useful section in practice. It surfaced a viewer pointing out an off-by-one in the weight indices at 11:03, a comment the creator hearted or answered. There’s no question mark or request phrase in it, so the keyword filters missed it.

Limits of the keyword filters

The regex only gives you a first pass. On this run “Requests” picked up “Me in part 2: Nevermind…”, which is a joke, and “the please of seeing work”, which is a typo. The ? filter catches rhetorical questions too. Treat the report as a reading list. The counts are too noisy to chart.

If you need real categories, the report is already in a shape an LLM can read. Give it the Markdown and ask for grouped topics with example comments.

Cost and time

The actor charges per row: $0.30 per 1,000 comments on the Apify Free plan (each reply counts as a comment), less on higher plans, plus a $0.0005 start fee per run. Error rows are free. The 1,202-row test above came to about $0.36. Prices checked on 3 December 2026.

Replies are where the row count grows. maxComments: 300 with maxRepliesPerComment: 5 can return up to 1,800 rows per video. In my runs, top-level comments came back at roughly 30 to 50 rows per second, and reply-heavy runs were slower because each thread is paged separately. If you only need the report’s first two sections, set includeReplies: false and the run gets cheaper and faster.

Where to take it next

  • Schedule it. Wrap the input in an Apify task, switch sortBy to newest, and run it daily on your latest uploads to see new questions as they come in.
  • Add the transcript. YouTube Transcript API returns timestamped captions. Matching a comment’s timestamp (“at 11:03…”) to the transcript line tells you which explanation confused people.
  • Compare platforms. The same thread-grouping idea works on TikTok with TikTok Comment Scraper, which also returns replies.

The full script is about 80 lines and has one dependency. Try it on the comment section you’ve been meaning to read with YouTube Comments Scraper.