๐Ÿ’ฌ YouTube Comments Scraper avatar
๐Ÿ’ฌ YouTube Comments Scraper

Pricing

Pay per usage

Go to Apify Store
๐Ÿ’ฌ YouTube Comments Scraper

๐Ÿ’ฌ YouTube Comments Scraper

Developed by

dz_omar

dz_omar

Maintained by Community

๐Ÿ’ฌ Extract YouTube comments with author info, likes, timestamps, and nested replies. Perfect for sentiment analysis, market research, and content strategy. โšก Fast, reliable, and built for scale.

5.0 (6)

Pricing

Pay per usage

6

6

6

Last modified

4 hours ago


๐Ÿ’ฌ YouTube Comments Scraper

Extract comments from any YouTube video with author information, likes, timestamps, and nested replies - fast, reliable, and built for scale.

This powerful Apify actor provides professional-grade extraction of YouTube comments including author details, engagement metrics, timestamps, and nested replies. Perfect for sentiment analysis, market research, content analysis, and social listening.


-- Key Features --

๐Ÿ’ฌ Complete Comment Extraction

  • Top-level Comments with full text content
  • Author Information including name, channel ID, avatar, and verification status
  • Engagement Metrics - like counts and reply counts
  • Timestamps - when comments were posted
  • Nested Replies - optional extraction of comment replies with pagination support

โšก Performance & Reliability

  • Fast Extraction - Optimized for speed and efficiency with parallel processing
  • Batch Operations - Smart buffering reduces API calls by up to 3x
  • Pagination Support - Extract unlimited comments per video
  • Sort Options - Get top comments or newest first
  • Smart Token Handling - Automatic extraction of sort-specific continuation tokens
  • Session Management - Advanced proxy rotation with health tracking
  • Error Handling - Graceful handling of disabled comments or unavailable videos

๐Ÿ› ๏ธ Developer-Friendly

  • Clean JSON Output - Ready for any data pipeline or API integration
  • Flexible Configuration - Control comment count, sorting, and reply depth
  • Structured Data - Each comment includes parent/child relationships
  • Performance Metrics - Real-time statistics on request rates and success
  • Well-Documented - Clear examples and comprehensive documentation

Quick Start

Simple Example (Top Comments, No Replies)

{
"youtubeUrls": [
{
"url": "https://www.youtube.com/watch?v=kOO31qFmi9A"
}
],
"maxComments": 100,
"sortBy": "top",
"maxRepliesPerComment": 0
}

Extract Newest Comments

{
"youtubeUrls": [
{
"url": "https://www.youtube.com/watch?v=kOO31qFmi9A"
}
],
"maxComments": 100,
"sortBy": "newest",
"maxRepliesPerComment": 0
}

With Nested Replies

{
"youtubeUrls": [
{
"url": "https://www.youtube.com/watch?v=kOO31qFmi9A"
}
],
"maxComments": 50,
"sortBy": "top",
"maxRepliesPerComment": 10
}

Multiple Videos with Maximum Replies

{
"youtubeUrls": [
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID_1"
},
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID_2"
},
{
"url": "https://youtu.be/VIDEO_ID_3"
}
],
"maxComments": 200,
"sortBy": "newest",
"maxRepliesPerComment": 50
}

๐Ÿ“ฅ Input Configuration

Input Parameters

ParameterTypeDefaultDescription
youtubeUrlsarrayRequiredArray of YouTube video URLs to extract comments from
maxCommentsinteger10Maximum number of top-level comments to extract per video (10-100,000)
sortBystringtopSort method: top (most relevant) or newest (most recent)
maxRepliesPerCommentinteger0Max replies per comment. Set to 0 to disable replies, or any number > 0 to enable (1-500)

โšก NEW: Simplified Reply Configuration

The includeReplies parameter has been removed! Now it's simpler:

  • maxRepliesPerComment: 0 โ†’ Replies are disabled (faster extraction)
  • maxRepliesPerComment: 10 โ†’ Extract up to 10 replies per comment
  • maxRepliesPerComment: 100 โ†’ Extract up to 100 replies per comment

This makes configuration more intuitive - you just set how many replies you want, or 0 for none!

Supported URL Formats

  • โœ… https://www.youtube.com/watch?v=VIDEO_ID
  • โœ… https://youtu.be/VIDEO_ID
  • โœ… https://www.youtube.com/shorts/VIDEO_ID
  • โœ… https://www.youtube.com/live/VIDEO_ID
  • โœ… Direct video ID: VIDEO_ID

Sort Options Explained

Top Comments (sortBy: "top")

  • Sorted by YouTube's relevance algorithm
  • Includes most liked and engaging comments
  • Best for understanding popular opinion
  • Default YouTube sorting method

Newest First (sortBy: "newest")

  • Sorted by publication time (newest to oldest)
  • Perfect for monitoring recent activity
  • Track real-time engagement
  • Requires an additional API call to extract the correct token

๐Ÿ“ค Output Structure

Complete Output Example

{
"videoId": "kOO31qFmi9A",
"videoUrl": "https://www.youtube.com/watch?v=kOO31qFmi9A",
"commentsDisabled": false,
"sortBy": "top",
"commentId": "UgxQe-6VK3h-LZaul6x4AaABAg",
"authorName": "@petertenthije",
"authorChannelId": "UCjRXzLWPELehRVijzUiX7iQ",
"authorThumbnail": "https://yt3.ggpht.com/ytc/AIdro_mvTOxNFL9dMAEzBQAvVcn4JgDSYUQHFQTOydPLOY4=s88-c-k-c0x00ffffff-no-rj",
"text": "30 years later, and nothing has changed:\n\nThe world still uses excel;\nThere is still one guy doing the work;\nThere are still three guys being clueless;\nThere is still one guy pushing to go faster, thinking the project is doomedโ€ฆ and taking the credit when everything works out.",
"publishedTime": "3 years ago (edited)",
"likeCount": "28K",
"replyCount": 229,
"isVerified": false,
"isCreator": false,
"isHearted": false,
"isPinned": false,
"replies": [
{
"commentId": "UgxQe-6VK3h-LZaul6x4AaABAg.9bBOqHCtsBY9bCzb1v1tt1",
"authorName": "@arnaboceanatyahoo",
"authorChannelId": "UCi7-fR2kGX18SCvKI_XV8rQ",
"authorThumbnail": "https://yt3.ggpht.com/ytc/AIdro_ln6eho2LyWvvi4mCOpvOMntSiPC6DrhVb3fZyb9eY=s88-c-k-c0x00ffffff-no-rj",
"text": "Hahaha",
"publishedTime": "3 years ago",
"likeCount": "78",
"parentCommentId": "UgxQe-6VK3h-LZaul6x4AaABAg"
}
],
"scrapedAt": "2025-10-24T18:21:50.350Z"
}

Output Fields Explained

Video Information

  • videoId - YouTube video identifier (11 characters)
  • videoUrl - Full YouTube video URL
  • commentsDisabled - Whether comments are disabled (boolean)
  • sortBy - Sort method used: top or newest
  • scrapedAt - ISO 8601 timestamp when data was scraped

Top-Level Comment Fields

  • commentId - Unique comment identifier
  • text - Full comment text content (preserves line breaks)
  • authorName - Display name with @ prefix
  • authorChannelId - YouTube channel ID (starts with UC)
  • authorThumbnail - URL to author's profile picture (88x88px)
  • publishedTime - Relative time (e.g., "3 years ago", "2 days ago (edited)")
  • likeCount - Number of likes as displayed (e.g., "28K", "150")
  • replyCount - Total number of replies to this comment
  • isVerified - Whether author has a verified checkmark
  • isCreator - Whether author is the video creator
  • isHearted - Whether creator hearted this comment
  • isPinned - Whether comment is pinned by creator
  • replies - Array of reply objects (if maxRepliesPerComment > 0)

Reply Fields

  • commentId - Unique reply identifier
  • parentCommentId - ID of the parent comment
  • text - Reply text content
  • authorName - Reply author's name
  • authorChannelId - Reply author's channel ID
  • authorThumbnail - Reply author's avatar URL
  • publishedTime - When the reply was posted
  • likeCount - Number of likes on the reply
  • isCreator - Whether the reply is from the video creator
  • isHearted - Whether the reply was hearted by the creator
  • isPinned - Whether the reply is pinned

This actor extracts publicly available comment data from YouTube. All data is accessible through normal YouTube viewing.

Compliance Requirements:

  • โœ… YouTube's Terms of Service
  • โœ… Applicable copyright laws
  • โœ… Data protection regulations (GDPR, CCPA, etc.)
  • โœ… Your jurisdiction's specific laws

Recommended Practices:

  • โœ… Use for research, analysis, or legitimate business purposes
  • โœ… Respect user privacy and anonymize data when sharing
  • โœ… Do not use for harassment, spam, or malicious purposes
  • โœ… Comply with data retention and deletion requirements
  • โœ… Provide opt-out mechanisms if republishing data
  • โœ… Credit sources appropriately

Prohibited Uses:

  • โŒ Harassment or targeted attacks on users
  • โŒ Building spam or bot networks
  • โŒ Circumventing YouTube's security measures
  • โŒ Selling or redistributing raw user data
  • โŒ Creating deepfakes or manipulated content

Data Privacy

Personal Information Handling:

  • Comments include publicly visible usernames and profile pictures
  • Channel IDs are public identifiers
  • No private or non-public data is extracted
  • Consider anonymization before sharing datasets

GDPR Compliance:

  • Users have the right to request data deletion
  • Implement data retention policies
  • Document data processing purposes
  • Provide transparency about data usage

๐Ÿ› ๏ธ Troubleshooting

No Comments Found

Symptoms:

  • Empty dataset
  • Message: "No comments section found or comments are disabled"

Solutions:

  • โœ… Verify comments are enabled on the video (check YouTube page)
  • โœ… Ensure the video URL is correct and complete
  • โœ… Try with a different video to confirm actor functionality
  • โœ… Check if video is age-restricted or private

Missing or Incomplete Data

Symptoms:

  • Some fields are null or missing
  • Truncated comment text

Solutions:

  • โœ… Normal behavior - not all fields exist for all comments
  • โœ… authorChannelId may be null for deleted accounts
  • โœ… likeCount may be null if likes are hidden
  • โœ… Check frameworkUpdates merging for enhanced data

Slow Performance

Symptoms:

  • Actor runs longer than expected
  • Timeouts or incomplete results

Solutions:

  • โœ… Reduce maxComments for faster runs
  • โœ… Set maxRepliesPerComment: 0 if not needed (major speedup)
  • โœ… Lower maxRepliesPerComment to reduce reply fetching time
  • โœ… Process multiple videos in separate runs
  • โœ… Check Apify platform limits and usage

Rate Limiting Errors

Symptoms:

  • HTTP 429 errors
  • "Too many requests" messages
  • Sudden failures mid-scrape

Solutions:

  • โœ… Automatic proxy rotation is enabled by default
  • โœ… Reduce request frequency (handled automatically)
  • โœ… Split large jobs into multiple smaller runs
  • โœ… Add delay between consecutive runs
  • โœ… Contact support if persistent issues

Best Practices

For Optimal Performance

  1. Start Small, Scale Up

    • Test with 50-100 comments first
    • Verify output format meets your needs
    • Then scale to larger extractions
  2. Choose Appropriate Settings

    • Use sortBy: "top" for popular opinion
    • Use sortBy: "newest" for real-time monitoring
    • Set maxRepliesPerComment: 0 when replies aren't needed (10x faster!)
    • Enable replies only when needed (significant performance impact)
  3. Monitor Resource Usage

    • Check Apify platform usage regularly
    • Optimize maxComments and maxRepliesPerComment
    • Balance speed vs. completeness
  4. Batch Processing

    • Process videos in groups of 5-10
    • Use separate runs for very large videos
    • Schedule regular runs for ongoing monitoring

For Data Quality

  1. Validate Input URLs

    • Test URLs in browser first
    • Ensure videos have comments enabled
    • Check video is public and accessible
  2. Handle Missing Data

    • Implement null checks in your code
    • Some fields may legitimately be empty
    • Don't assume all fields always exist
  3. Verify Sort Order

    • Compare first few results with YouTube
    • Check console logs for sort token extraction
    • Newest sort requires extra API call
  4. Clean and Process Data

    • Remove duplicates (rare but possible)
    • Parse likeCount strings to numbers if needed
    • Convert relative timestamps to dates if required

For Compliance

  1. Respect User Privacy

    • Anonymize data when sharing publicly
    • Remove personally identifiable information
    • Don't republish offensive or harmful content
  2. Document Usage

    • Keep records of data sources
    • Document purpose of data collection
    • Maintain data processing logs
  3. Implement Retention Policies

    • Delete old data per your policy
    • Honor user deletion requests
    • Don't hoard unnecessary data
  4. Stay Updated

    • Review YouTube's ToS regularly
    • Monitor changes in data structure
    • Update actor when API changes

๐Ÿ“Š Output Examples

Example 1: Single Comment (No Replies)

{
"videoId": "kOO31qFmi9A",
"videoUrl": "https://www.youtube.com/watch?v=kOO31qFmi9A",
"commentsDisabled": false,
"sortBy": "top",
"commentId": "UgxQe-6VK3h-LZaul6x4AaABAg",
"authorName": "@petertenthije",
"authorChannelId": "UCjRXzLWPELehRVijzUiX7iQ",
"authorThumbnail": "https://yt3.ggpht.com/ytc/AIdro_mvTOxNFL9dMAEzBQAvVcn4JgDSYUQHFQTOydPLOY4=s88-c-k-c0x00ffffff-no-rj",
"text": "30 years later, and nothing has changed",
"publishedTime": "3 years ago (edited)",
"likeCount": "28K",
"replyCount": 229,
"isVerified": false,
"isCreator": false,
"isHearted": false,
"isPinned": false,
"replies": [],
"scrapedAt": "2025-10-24T18:21:50.350Z"
}

Example 2: Comment with Replies (maxRepliesPerComment: 2)

{
"videoId": "kOO31qFmi9A",
"videoUrl": "https://www.youtube.com/watch?v=kOO31qFmi9A",
"commentsDisabled": false,
"sortBy": "top",
"commentId": "UgxQe-6VK3h-LZaul6x4AaABAg",
"authorName": "@petertenthije",
"text": "Great video!",
"replyCount": 3,
"replies": [
{
"commentId": "UgxQe-6VK3h-LZaul6x4AaABAg.9bBOqHCtsBY9bCzb1v1tt1",
"parentCommentId": "UgxQe-6VK3h-LZaul6x4AaABAg",
"authorName": "@user1",
"text": "I agree!",
"likeCount": "78"
},
{
"commentId": "UgxQe-6VK3h-LZaul6x4AaABAg.9bBOqHCtsBY9bDP_Iw25XS",
"parentCommentId": "UgxQe-6VK3h-LZaul6x4AaABAg",
"authorName": "@user2",
"text": "Thanks for sharing!",
"likeCount": "520"
}
],
"scrapedAt": "2025-10-24T18:21:50.350Z"
}

Example 3: Comments Disabled

{
"videoId": "ABC123",
"videoUrl": "https://www.youtube.com/watch?v=ABC123",
"commentsDisabled": true,
"totalCommentsFetched": 0,
"scrapedAt": "2025-10-24T18:21:50.350Z"
}

๐ŸŽฌ Video & Media Tools

๐ŸŽฌ YouTube Transcript Extractor Extract complete video transcripts with timestamps and comprehensive metadata. Perfect for content analysis, SEO, and subtitle generation.

YouTube Full Channel, Playlists, Shorts, Live Extract complete ๐ŸŽฌ channel information, playlists, and video details from any YouTube channel. Get subscriber counts, video lists, and comprehensive metadata.

YouTube Playlist Extractor Extract complete ๐ŸŽฌ playlist information with all video details from any YouTube playlist. Fast, reliable, and built for scale.

Zoom Scraper | ๐ŸŽฅ Downloader & ๐Ÿ“„ Transcript Extract Zoom meeting recordings, transcripts, and metadata. Ideal for meeting analysis and documentation.

Loom Scraper | ๐ŸŽฅ Downloader & ๐Ÿ“„ Transcript Download Loom videos and extract transcripts. Perfect for training content and video documentation.

๐Ÿ  Real Estate Data

Idealista Scraper API Advanced Idealista property data extraction with API access. Get listings, prices, and detailed property information.

Idealista Scraper Extract Spanish real estate listings from Idealista. Perfect for market analysis and property research.

๐Ÿ› ๏ธ Developer & Security Tools

Screenshot Fast, reliable webpage screenshots with customizable options. Essential for monitoring and documentation.

Ultimate Screenshot Advanced screenshot tool with full-page capture, custom viewports, and quality controls.

Network Security Scanner Scan websites for security vulnerabilities and get comprehensive security reports.

๐Ÿ“ฑ Social Media Tools

Facebook Ads Scraper Pro Extract Facebook ads data for competitor analysis and market research. Track ad campaigns and strategies.


๐Ÿ’ฌ Support & Community

Community:


Built with โค๏ธ by dz_omar