YouTube Comments Scraper avatar

YouTube Comments Scraper

Pricing

from $0.25 / 1,000 comments

Go to Apify Store
YouTube Comments Scraper

YouTube Comments Scraper

Scrape comments and replies from YouTube videos and Shorts: text, author, likes, reply count, pinned and creator-hearted flags. Fast HTTP scraper, no browser, no login and no API key.

Pricing

from $0.25 / 1,000 comments

Rating

0.0

(0)

Developer

Novi

Novi

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

2 days ago

Last modified

Features

Limited permissions

Share

Scrape comments and replies from any public YouTube video or Short. Every comment comes with its text, author, like count, reply count, publish time and pinned / creator-hearted flags, plus the video title and channel. Paste video URLs or IDs and download the results as JSON, CSV, Excel or through the API.

Video tutorial

Prefer reading? Follow the step-by-step guide with screenshots.

What can this YouTube Comments Scraper do?

  • 💬 Comments and replies: top-level comments, plus up to N replies per comment, linked through parentCommentId
  • ↕️ Sort order: get YouTube's Top comments or Newest first
  • 📌 Rich flags: pinned comments, comments hearted by the creator, comments written by the channel owner, verified authors, edited comments
  • 👤 Author details: handle, channel ID, channel URL and avatar for every commenter
  • 📺 Video context: video title, channel name, channel ID and the total comment count on every row
  • 🔗 Bulk input: many videos in one run, using watch?v= links, youtu.be links, Shorts, live and embed links
  • ⚡ Fast and light: plain HTTP requests, no browser, so it runs in 256 MB of memory and returns hundreds of comments in seconds
  • 🛡️ Keeps going on errors: unavailable videos or videos with comments turned off return a row with an error message and the run continues

What can I use YouTube comments for?

  • Sentiment analysis and brand monitoring: see how viewers react to your product, campaign or competitor
  • Audience research: find questions, pain points and content ideas in your niche
  • Influencer vetting: check engagement quality on a creator's videos before a partnership
  • AI and LLM datasets: feed real conversations into classification, summarization or RAG pipelines
  • Community management: export comments to reply, moderate or report on them

How to scrape YouTube comments

  1. Click Try for free and open the actor in Apify Console.
  2. Add one or more YouTube video URLs or IDs to Video URLs.
  3. Set Max comments per video and choose Top comments or Newest first.
  4. Turn on Include replies if you also want the reply threads.
  5. Click Start, then download the dataset in JSON, CSV, Excel or HTML.

Input

FieldTypeDescription
startUrlsarrayYouTube video or Shorts URLs (watch?v=, youtu.be/, /shorts/, /live/, /embed/).
maxCommentsintegerMaximum number of top-level comments per video. Replies are not counted. Default 100.
sortBystringtop (default) or newest.
includeRepliesbooleanAlso scrape replies. Each reply is a separate row. Default false.
maxRepliesPerCommentintegerMaximum replies per comment when replies are on. Default 10.
proxyConfigurationobjectOptional. Leave it off: when YouTube blocks a request, the scraper retries it through Apify Proxy automatically. Set your own proxy only if you need a specific one.

Input example

{
"startUrls": [
{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
{ "url": "https://www.youtube.com/shorts/0e3GPea1Tyg" },
{ "url": "https://youtu.be/jNQXAC9IVRw" }
],
"maxComments": 200,
"sortBy": "top",
"includeReplies": true,
"maxRepliesPerComment": 5
}

Output

Each comment or reply is one row in the dataset.

FieldDescription
typecomment or reply
commentIdYouTube comment ID
parentCommentIdFor replies, the ID of the comment it answers; null for top-level comments
commentUrlDirect link that highlights the comment on YouTube
textFull comment text
authorNameCommenter's handle, e.g. @MrBeast
authorChannelId / authorChannelUrl / authorAvatarUrlCommenter's channel and avatar
authorIsVerifiedCommenter has a verified badge
authorIsChannelOwnerComment was written by the video's channel
likeCountNumber of likes (YouTube rounds large numbers, e.g. 1.1M becomes 1100000)
replyCountNumber of replies to the comment
isPinnedComment is pinned by the creator
isHeartedByCreatorComment received a heart from the creator
isEditedComment was edited
publishedTimeTextRelative publish time as shown on YouTube, e.g. 3 years ago
publishedAtApproximate publish date (ISO 8601), calculated from publishedTimeText
videoId / videoUrl / videoTitleThe video the comment belongs to
channelName / channelIdThe video's channel
totalCommentsTextTotal comment count shown on the video, e.g. 2,462,957
errorOnly on error rows: why no comments were returned for this video

Output example

{
"type": "comment",
"commentId": "UgzH8vliQSJKHQMGZjx4AaABAg",
"parentCommentId": null,
"commentUrl": "https://www.youtube.com/watch?v=0e3GPea1Tyg&lc=UgzH8vliQSJKHQMGZjx4AaABAg",
"text": "Like I said in the video, subscribe if you haven’t already and you could win $10,000!",
"authorName": "@MrBeast",
"authorChannelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"authorChannelUrl": "https://www.youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA",
"authorIsVerified": true,
"authorIsChannelOwner": true,
"likeCount": 1100000,
"replyCount": 741,
"isPinned": true,
"isHeartedByCreator": false,
"isEdited": false,
"publishedTimeText": "5 years ago",
"publishedAt": "2021-12-02T00:30:14.455Z",
"videoId": "0e3GPea1Tyg",
"videoUrl": "https://www.youtube.com/watch?v=0e3GPea1Tyg",
"videoTitle": "$456,000 Squid Game In Real Life!",
"channelName": "MrBeast",
"channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
"totalCommentsText": "662,258"
}

Use it from code

Python

from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("novi/youtube-comments-scraper").call(run_input={
"startUrls": [{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}],
"maxComments": 100,
"sortBy": "newest",
})
for comment in client.dataset(run["defaultDatasetId"]).iterate_items():
print(comment["authorName"], comment["text"])

JavaScript

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('novi/youtube-comments-scraper').call({
startUrls: [{ url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' }],
maxComments: 100,
includeReplies: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

How much does it cost to scrape YouTube comments?

You pay only for the comments you get: $0.30 per 1,000 comments (each reply counts as one comment), with lower prices on higher Apify plans. Each run also has a small start fee of $0.0005, and rows for unavailable videos are free.

For example, 10,000 comments cost about $3, and the free monthly credit on the Apify Free plan covers roughly 16,000 comments.

FAQ

Do I need a YouTube API key or login? No. The scraper reads the same public data you see in a browser, without an API key, login or quota.

Why is likeCount a round number? YouTube only shows rounded like counts for popular comments (for example 73K). The scraper converts them to numbers.

Why are there fewer comments than the video's total? The total on YouTube includes replies and comments that YouTube hides as spam or held for review. Turn on Include replies to get the reply threads too.

Is scraping YouTube comments legal? This actor only collects publicly available data. Comments can contain personal data, so make sure your use complies with GDPR and other regulations that apply to you, and use the data for legitimate purposes.