Youtube Comments Scraper
Pricing
from $0.0007 / result
Youtube Comments Scraper
Scrape YouTube comments with detailed author info. Extract comment text, likes, replies, timestamps, and channel details. Sort by relevance or newest. No proxies needed. Perfect for sentiment analysis and engagement tracking.
Pricing
from $0.0007 / result
Rating
0.0
(0)
Developer
Grow Media
Maintained by CommunityActor stats
3
Bookmarked
70
Total users
0
Monthly active users
8 hours ago
Last modified
Categories
Share
Scrape YouTube video comments (author, text, likes, replies, verified/artist/creator status) from one or many videos in a single run. Each comment is stored as a flat dataset record together with the video it came from.
The Actor validates every video through the YouTube Data API (using a server-side access token, no API key needed on your side) and then fetches comments in paged batches until it reaches the number you asked for.
Features
- ✅ Multiple videos per run — pass any number of video URLs or IDs in
startUrls. - ✅ Remote URL lists — a
startUrlsentry can point to a.txt/list URL whose lines are video URLs (requestsFromUrl). - ✅ Validation — each video ID is checked via the YouTube Data API first; invalid IDs are reported without stopping the run.
- ✅ Exact counts — results are trimmed so you get precisely the number of comments you request (or fewer if the video has fewer top-level comments).
- ✅ Sort order — fetch top or newest comments.
- ✅ Server-side token flow — the access token is fetched automatically; no Google API key in the input.
Input
Configure the Actor from the input UI or API:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
startUrls | array | ⬜ | — | One or more video URLs or bare 11-character IDs to scrape. Each element may also be an object with requestsFromUrl pointing to a remote file that lists more URLs/IDs (one per line). |
maxComments | integer | ⬜ | 20 | How many comments to scrape from each video before stopping (min 1). |
sort | string | ⬜ | top | Comment sort order: top or newest. |
Accepted video formats (any of):
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/shorts/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_IDhttps://www.youtube.com/live/VIDEO_ID- just the bare 11-character ID, e.g.
zQGOcOUBi6s
Example input:
{"startUrls": [{ "url": "https://www.youtube.com/watch?v=zQGOcOUBi6s" },{ "url": "nx-mGN2Fz5M" },{ "requestsFromUrl": "https://example.com/video-list.txt" }],"maxComments": 20,"sort": "newest"}
Output
Each item in the run's dataset is one comment flattened with the video it belongs to:
{"commentId": "Ugw9ufCpvXQeZLR8NJV4AaABAg","authorText": "@Saltpork305","authorChannelId": "UCEh6DtyiC17EX89Dv-fafbw","authorAvatar": "https://yt3.ggpht.com/...","textDisplay": "1:13:40 Oh you sweet summer child...","commentPublishText": "24 minutes ago","likesCount": "1","replyCount": "","isVerified": false,"isArtist": false,"isCreator": false,"videoId": "S_Pu-DLXbKc","pageUrl": "https://www.youtube.com/watch?v=S_Pu-DLXbKc","title": "Dune: Part Two | FIRST TIME WATCHING | Reaction","commentsCount": 536}
Comment fields
| Field | Type | Description |
|---|---|---|
commentId | string | YouTube's ID of the comment. |
authorText | string | Display name of the author (usually starts with @). |
authorChannelId | string | Channel ID of the author. |
authorAvatar | string | URL of the author's avatar. |
textDisplay | string | The comment text, including mention/URL formatting. |
commentPublishText | string | Human-readable publish time (e.g. 2 months ago). |
likesCount | string | Number of likes on the comment (as a string). |
replyCount | string | Number of replies to the comment; empty when none. |
isVerified | boolean | Whether the author has a verified badge. |
isArtist | boolean | Whether the author is an official artist. |
isCreator | boolean | Whether the author is the video's channel owner. |
Video fields (added to every comment)
| Field | Type | Description |
|---|---|---|
videoId | string | The 11-character ID of the video. |
pageUrl | string | Full URL of the video. |
title | string | Title of the video. |
commentsCount | integer | Total top-level comments on the video (from the YouTube Data API). |
Error rows
Runs can also push non-comment records that carry an error flag:
error | Meaning |
|---|---|
INVALID_INPUT | No usable video IDs/URLs were provided (run fails with exit code 91). |
SCRAPE_ERROR | That video was skipped after a validation or scraping failure; the row includes its videoId, pageUrl and a note. |
NO_RESULTS | The video has no comments (when no video yields anything, the run fails with exit code 1). |
Cost and performance
- YouTube Data API: one
videos.listvalidation call per video. - Comment fetching: happens on the backend server in pages of ~20 comments, so the Actor itself stays lightweight — scraping a few thousand comments typically uses only a fraction of a CU.
- Billing is pay-per-usage, proportional to the number of videos and pages requested.
FAQ
Do I need a YouTube API key?
No. The Actor automatically obtains an OAuth access token from its backend token endpoint and uses it for video validation.
Why does the count differ from YouTube's comment count?
A video's commentCount reflects top-level comments only (replies are excluded), which is exactly what this scraper collects — so the numbers should line up.
Is scraping YouTube comments allowed?
Always review YouTube's Terms of Service and the applicable laws in your jurisdiction. This Actor only reads publicly visible data.
Troubleshooting
Invalid video ID— the ID is malformed or the video is private/removed. Check the URL/ID instartUrls.SCRAPE_ERROR— validation or fetching failed for that video; check thenotefield on the row. The run continues with the remaining videos.- No results at all — every video had zero comments; the run ends with exit code
1(NO_RESULTS).
Contact
Custom solutions and integrations on request — open an issue or reach out via your Apify account.