๐ฌ YouTube Comments Scraper
Pricing
Pay per usage
๐ฌ YouTube Comments Scraper
๐ฌ 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
| Parameter | Type | Default | Description |
|---|---|---|---|
youtubeUrls | array | Required | Array of YouTube video URLs to extract comments from |
maxComments | integer | 10 | Maximum number of top-level comments to extract per video (10-100,000) |
sortBy | string | top | Sort method: top (most relevant) or newest (most recent) |
maxRepliesPerComment | integer | 0 | Max 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 commentmaxRepliesPerComment: 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 URLcommentsDisabled- Whether comments are disabled (boolean)sortBy- Sort method used:topornewestscrapedAt- ISO 8601 timestamp when data was scraped
Top-Level Comment Fields
commentId- Unique comment identifiertext- Full comment text content (preserves line breaks)authorName- Display name with @ prefixauthorChannelId- 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 commentisVerified- Whether author has a verified checkmarkisCreator- Whether author is the video creatorisHearted- Whether creator hearted this commentisPinned- Whether comment is pinned by creatorreplies- Array of reply objects (ifmaxRepliesPerComment > 0)
Reply Fields
commentId- Unique reply identifierparentCommentId- ID of the parent commenttext- Reply text contentauthorName- Reply author's nameauthorChannelId- Reply author's channel IDauthorThumbnail- Reply author's avatar URLpublishedTime- When the reply was postedlikeCount- Number of likes on the replyisCreator- Whether the reply is from the video creatorisHearted- Whether the reply was hearted by the creatorisPinned- Whether the reply is pinned
๐ก๏ธ Legal & Compliance
This actor extracts publicly available comment data from YouTube. All data is accessible through normal YouTube viewing.
Important Legal Considerations
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
nullor missing - Truncated comment text
Solutions:
- โ Normal behavior - not all fields exist for all comments
- โ
authorChannelIdmay be null for deleted accounts - โ
likeCountmay be null if likes are hidden - โ
Check
frameworkUpdatesmerging for enhanced data
Slow Performance
Symptoms:
- Actor runs longer than expected
- Timeouts or incomplete results
Solutions:
- โ
Reduce
maxCommentsfor faster runs - โ
Set
maxRepliesPerComment: 0if not needed (major speedup) - โ
Lower
maxRepliesPerCommentto 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
-
Start Small, Scale Up
- Test with 50-100 comments first
- Verify output format meets your needs
- Then scale to larger extractions
-
Choose Appropriate Settings
- Use
sortBy: "top"for popular opinion - Use
sortBy: "newest"for real-time monitoring - Set
maxRepliesPerComment: 0when replies aren't needed (10x faster!) - Enable replies only when needed (significant performance impact)
- Use
-
Monitor Resource Usage
- Check Apify platform usage regularly
- Optimize
maxCommentsandmaxRepliesPerComment - Balance speed vs. completeness
-
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
-
Validate Input URLs
- Test URLs in browser first
- Ensure videos have comments enabled
- Check video is public and accessible
-
Handle Missing Data
- Implement null checks in your code
- Some fields may legitimately be empty
- Don't assume all fields always exist
-
Verify Sort Order
- Compare first few results with YouTube
- Check console logs for sort token extraction
- Newest sort requires extra API call
-
Clean and Process Data
- Remove duplicates (rare but possible)
- Parse
likeCountstrings to numbers if needed - Convert relative timestamps to dates if required
For Compliance
-
Respect User Privacy
- Anonymize data when sharing publicly
- Remove personally identifiable information
- Don't republish offensive or harmful content
-
Document Usage
- Keep records of data sources
- Document purpose of data collection
- Maintain data processing logs
-
Implement Retention Policies
- Delete old data per your policy
- Honor user deletion requests
- Don't hoard unnecessary data
-
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"}
๐ Related Actors
๐ฌ 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:
- ๐ฌ Discord Community
- ๐ GitHub Issues
- ๐ง Email Support
Built with โค๏ธ by dz_omar
On this page
Share Actor:
