Youtube Comments Scraper avatar

Youtube Comments Scraper

Pricing

from $0.0007 / result

Go to Apify Store
Youtube Comments Scraper

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

Grow Media

Maintained by Community

Actor 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 startUrls entry 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:

FieldTypeRequiredDefaultDescription
startUrlsarrayOne 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).
maxCommentsinteger20How many comments to scrape from each video before stopping (min 1).
sortstringtopComment sort order: top or newest.

Accepted video formats (any of):

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID
  • https://www.youtube.com/shorts/VIDEO_ID
  • https://www.youtube.com/embed/VIDEO_ID
  • https://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

FieldTypeDescription
commentIdstringYouTube's ID of the comment.
authorTextstringDisplay name of the author (usually starts with @).
authorChannelIdstringChannel ID of the author.
authorAvatarstringURL of the author's avatar.
textDisplaystringThe comment text, including mention/URL formatting.
commentPublishTextstringHuman-readable publish time (e.g. 2 months ago).
likesCountstringNumber of likes on the comment (as a string).
replyCountstringNumber of replies to the comment; empty when none.
isVerifiedbooleanWhether the author has a verified badge.
isArtistbooleanWhether the author is an official artist.
isCreatorbooleanWhether the author is the video's channel owner.

Video fields (added to every comment)

FieldTypeDescription
videoIdstringThe 11-character ID of the video.
pageUrlstringFull URL of the video.
titlestringTitle of the video.
commentsCountintegerTotal 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:

errorMeaning
INVALID_INPUTNo usable video IDs/URLs were provided (run fails with exit code 91).
SCRAPE_ERRORThat video was skipped after a validation or scraping failure; the row includes its videoId, pageUrl and a note.
NO_RESULTSThe video has no comments (when no video yields anything, the run fails with exit code 1).

Cost and performance

  • YouTube Data API: one videos.list validation 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 in startUrls.
  • SCRAPE_ERROR — validation or fetching failed for that video; check the note field 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.