YouTube video comment scraper in n8n
Get a YouTube video's comments with nested replies attached, author identity, like counts, and pinned/hearted/verified flags, filterable by keyword and minimum likes.
What this workflow does
Import it and n8n runs the YouTube Video Comment & Reply Thread Scraper Actor on Apify every day at 08:00 with the starter input below. Each row comes back with comment id, author, text, likes and 20 more; repeats with the same videoId are dropped. A Google Sheets append is included and stays off until you add your sheet. The only credential it needs is your Apify API token.
Read from the workflow file, built for YouTube Video Comment & Reply Thread Scraper version 1.0.3. Updated 2026-11-14.How the rows travel
6 nodes, in the order n8n runs them. The yellow stop is the call to the Apify Actor; the dashed stop is optional.
- Daily trigger Schedule trigger
- Configure input Code
- Run Apify Actor HTTP Request
- Normalize + dedupe Code
- Rows ready No operation
- Google Sheets (optional) Google Sheets, off until you switch it on
Input
The Configure input node holds the starter input. Change it there; every setting the Actor accepts is listed below.
{
"videoUrls": [
"https://www.youtube.com/watch?v=dQw4w9WgXcQ"
],
"maxComments": 25,
"maxRepliesPerComment": 3,
"maxTotalRows": 20
} | Setting | Type | Required | Default | What it does |
|---|---|---|---|---|
| videoUrls | array | No | – | Watch, youtu.be, Shorts, embed, live, v/ links, or bare 11-character IDs. Every video is normalized to a watch URL internally. |
| channelUrls | array | No | – | Channel /videos sources: /@handle, /channel/UC..., /c/name, /user/name, a bare @handle, or a UC... channel ID. Scrapes up to Max videos per source. |
| playlistUrls | array | No | – | Playlist sources: youtube.com/playlist?list=... or a bare playlist ID. Scrapes up to Max videos per source. |
| searchQueries | array | No | – | YouTube search terms or search-result URLs. Only video results are used, deduplicated, up to Max videos per source. |
| maxVideosPerSource | integer | No | 20 | Discovery cap for channel, playlist and search sources. 0 = every video the source exposes. |
| maxComments | integer | No | 100 | Top-level comments to examine per video. 0 = all. Comments rejected by filters still count toward this scan cap (so restrictive filters cannot paginate forever); replies do not. |
| includeReplies | boolean | No | true | Fetch reply threads. Emitted as flat rows by default; use Output mode tree to embed them instead. |
| maxRepliesPerComment | integer | No | 50 | Per-thread reply cap. 0 = all replies, stopping when the continuation token is exhausted. YouTube serves roughly 9-10 on the first reply page and 44-49 afterwards. |
| maxReplyDepth | integer | No | 1 | 0 = top-level comments only, 1 = direct replies (the shape observed publicly). Values above 1 are reserved for nested sub-threads, which YouTube has not exposed in the samples… |
| maxTotalRows | integer | No | 5000 | Global budget for emitted comment + reply rows. 0 = unlimited. Status rows are never counted and are not billable data rows. |
| sortBy | string | No | top | top = YouTube relevance order; newest = chronological, recommended for date cutoffs and complete windows. A date cutoff forces newest automatically. One of: top, newest. |
| commentsSince | string | No | – | Optional cutoff as an ISO date/datetime (2026-10-16) or relative duration (7d, 24h, 30m). Forces newest sort. |
| keywords | array | No | – | Case-insensitive OR filter on comment and reply text. Empty = no keyword filter. A parent comment that does not match is skipped, so its replies are not fetched. |
| minLikes | integer | No | 0 | Drop comments and replies below this like count. Applied after fetching. YouTube only exposes rounded counts (K/M), so the comparison uses the rounded value. |
| onlyCreatorHearted | boolean | No | false | Keep only comments/replies that the video creator hearted. HeartedBy identifies the creator where YouTube exposes the tooltip. |
| outputMode | string | No | flat | flat = one row per comment and reply (recommended for CSV/Excel/SQL); tree = parent rows with embedded replies[] (backward compatible); both = flat rows plus parent rows carrying… One of: flat, tree, both. |
| emitStatusRows | boolean | No | true | Write one recordType=status row for blocked, private, unavailable, comments-off, empty-token, invalid-input, partial and budget-stop cases. |
What each row holds
Every field the Actor returns stays in the row (24 in its dataset schema). Normalize + dedupe trims text, drops empty fields, removes repeats with the same videoId and adds _source and _scrapedAt. The main fields:
| Field | What it is |
|---|---|
| commentId | Comment ID |
| authorName | Author |
| text | Text |
| likeCount | Likes |
| replyCount | Replies |
| isHearted | Hearted |
| videoTitle | Video |
What the first run costs
Each run starts at $0.40 on the Free plan (4 GB of memory), then $0.99 per 1,000 results, plus platform usage.
The Actor lists $0.99 per 1,000 results; its catalogue page breaks the price down by Apify plan. The Apify Free plan includes $5 of usage a month.
The Actor behind it
YouTube Video Comment & Reply Thread Scraper: Get a YouTube video's comments with nested replies attached, author identity, like counts, and pinned/hearted/verified flags, filterable by keyword and minimum likes.
The same job from an AI agent
The matching agent skill gives Claude Code, Codex, Cursor and other agents the same Actor, input and fields. Install it in one line:
npx skills add https://scraperfinder.com --skill youtube-video-comment-and-reply-thread-scraper The youTube video comment scraper skill, with manual install and run steps
Questions people ask
How do I import this workflow into n8n?
Copy https://scraperfinder.com/n8n/youtube-video-comment-and-reply-thread-scraper.json. In n8n, open a new workflow, click the three-dot menu, choose Import from URL and paste it. Or download the JSON file and use Import from File; both give the same 6 nodes.
Do I need an Apify account?
Yes. The workflow calls the YouTube Video Comment & Reply Thread Scraper Actor through the Apify API with your own token, and each run is billed to your Apify account. The Free plan includes $5 of usage a month.
What does a run cost?
Each run starts at $0.40 on the Free plan (4 GB of memory), then $0.99 per 1,000 results, plus platform usage. The Actor's Store page shows the current price.
Can I change what it collects?
Yes: edit the input object in the Configure input node. The Actor takes 17 settings; the table on this page lists each one with its default. Raise maxComments once the first rows look right.
Does it work without Google Sheets?
Yes. The rows wait in the Rows ready node, so you can connect any other node there: a database, Airtable, a webhook or an email. The Google Sheets node is only one option.