YouTube Comments Scraper avatar

YouTube Comments Scraper

Pricing

from $1.20 / 1,000 comments

Go to Apify Store
YouTube Comments Scraper

YouTube Comments Scraper

Scrape YouTube comments and replies from any number of videos: text, author, likes, reply count, creator hearts and channel-owner replies. Sort by top or newest, filter by date. No API key or quota.

Pricing

from $1.20 / 1,000 comments

Rating

0.0

(0)

Developer

Mr T

Mr T

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

2

Monthly active users

a day ago

Last modified

Share

YouTube Comments Scraper

Download comments and replies from any number of YouTube videos, with the details the YouTube Data API leaves out: whether the creator hearted a comment and whether the channel owner wrote it. No API key, no quota, no Google account.

You only pay per comment returned. Videos that are unavailable or have no comments still appear in the results so you know what happened, but they are free.

What you get for each comment

  • Comment text, ID and approximate posting time
  • Author handle, channel ID and verified badge
  • Likes and number of replies
  • Creator heart, and whether the video's own channel wrote it
  • For replies: the ID of the comment they answer
  • Video ID, title, URL and the video's total comment count

How to use it

  1. Add one or more video URLs to Video URLs. You can also upload a CSV or link a Google Sheet. Watch links, youtu.be, Shorts and live links all work.
  2. Set Max comments per video.
  3. Optionally choose Newest first, set Max replies per comment to include replies, or set Oldest comment date to keep only recent comments.
  4. Click Start, then download the results as JSON, CSV, Excel or HTML.

Example input

{
"startUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],
"maxComments": 300,
"sortCommentsBy": "NEWEST_FIRST",
"maxRepliesPerComment": 10,
"oldestCommentDate": "7 days"
}

Example output

{
"comment": "I Rick rolled my entire French class because we had to study a city in France…",
"cid": "UgzKYksqeQ5gA3t0g0F4AaABAg",
"author": "@grustache4569",
"authorChannelId": "UCKrzgYonJnMd0Dk7zQXjYXw",
"authorIsChannelOwner": false,
"authorIsVerified": false,
"videoId": "dQw4w9WgXcQ",
"pageUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"commentsCount": 2400000,
"replyCount": 636,
"voteCount": 105000,
"hasCreatorHeart": false,
"type": "comment",
"replyToCid": null,
"publishedTimeText": "6 years ago (edited)",
"approxPublishedAt": "2020-10-26T18:40:00.000Z"
}

Replies have "type": "reply" and replyToCid set to their parent's cid, and they come right after their parent.

When a video can't be scraped, you get one item like this instead (not charged):

{
"url": "https://www.youtube.com/watch?v=xxxxxxxxxxx",
"input": "https://youtu.be/xxxxxxxxxxx",
"error": "VIDEO_UNAVAILABLE",
"note": "This video is not available"
}
errorMeaning
VIDEO_UNAVAILABLEThe video doesn't exist, was removed or is private.
NO_COMMENTSComments are turned off, the video has none, or none match the date filter.
INVALID_INPUTThe URL isn't a YouTube video URL.
BLOCKED, RATE_LIMITED, TIMEOUT, NETWORK_ERROR, SERVER_ERROR, HTTP_ERROR, UNEXPECTED_RESPONSEYouTube refused or failed on every retry. Running again usually works.

Good to know

  • Dates are approximate. YouTube shows only relative ages ("3 weeks ago"). approxPublishedAt is computed from that, so "1 year ago" can be off by months. The date filter uses the same approximation.
  • Likes and the total comment count are as displayed. Above 1,000 they are rounded (105K becomes 105000).
  • Replies count toward the limit. With 100 max comments and 10 replies per comment, you get roughly 9 comments and their replies.

Proxies

YouTube blocks most cloud IP addresses, so the default proxy is Apify Residential. A page of 20 comments uses roughly 30–40 KB of proxy traffic.

Using it from code

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('adaptable_wheelhouse/youtube-comments-scraper').call({
startUrls: [{ url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }],
maxComments: 500,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();

This actor reads only public comments that anyone can see on youtube.com without logging in. Comments contain personal data (usernames and what people wrote), which is protected by laws such as GDPR. Only collect it if you have a legitimate reason, and check with a lawyer if you are unsure.