💬 YouTube Comments Scraper
Pricing
from $0.80 / 1,000 parent comments
💬 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.
Pricing
from $0.80 / 1,000 parent comments
Rating
5.0
(7)
Developer
FlowExtract API
Maintained by CommunityActor stats
17
Bookmarked
102
Total users
5
Monthly active users
3 hours ago
Last modified
Categories
Features
Share
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.
🎬 Video Tutorial
-- 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-1,000,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) |
⚡ 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
🌐 Call it as an API (server interface)
This Actor ships two interfaces from one codebase: the input interface (runs, datasets, schedules) and the server interface — a long-lived HTTP endpoint you call from your app, an AI agent, or an n8n / Make / Zapier HTTP step.
Why the server interface
- Instant responses — no Actor startup delay per request
- Comments stream back as they are extracted (NDJSON), so you can process them progressively
- Interrupted requests resume from a continuation token
- No runs appear in your account, and your concurrency and memory limits are not used
- No start fee — you pay only for the comments and replies you receive
Endpoint
https://dz-omar--youtube-comments-scraper.apify.actor/
Authenticate with your Apify token as a Bearer header (get one at https://console.apify.com/account/integrations?fpr=smcx63):
curl -X POST "https://dz-omar--youtube-comments-scraper.apify.actor/" -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" -H "Content-Type: application/json" -d '{"youtubeUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],"sortBy": "top","maxComments": 100,"maxRepliesPerComment": 0}'
A real response (abridged) — one JSON object per line:
{"type":"batch","videoId":"dQw4w9WgXcQ","batchSize":10,"totalSent":10,"completed":false,"continuationToken":"fx1_uIqvlU…","comments":[{"authorName":"@candycake9531","text":"…","likeCount":"293K","replyCount":120,"publishedTime":"2 years ago"}]}{"type":"batch","videoId":"dQw4w9WgXcQ","batchSize":10,"totalSent":20,"completed":true,"continuationToken":null,"comments":[…]}{"type":"video_complete","videoUrl":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}{"type":"complete"}
Request parameters
| Parameter | Type | Description |
|---|---|---|
youtubeUrls | array | Required. YouTube video URLs to scrape |
maxComments | integer | Maximum comments per video |
sortBy | string | "top" or "newest" |
maxRepliesPerComment | integer | Max replies per comment (0 disables replies) |
maxCommentsPerRequest | integer | Optional. Bound a single response to about this many comments (or ~2 minutes). Omit it and one request runs to completion, as before |
continuationToken | string | Optional. Opaque resume token from a previous response |
alreadyFetched | integer | Optional. Comments already received, sent alongside continuationToken |
Event types
type | Meaning |
|---|---|
batch | A batch of comments. completed: true marks the last batch for that video |
video_complete | That video finished. Not sent after a paused event |
paused | Only when you set maxCommentsPerRequest: the budget was reached and more remains. Carries completed: false and a continuationToken |
complete | Final line; the connection closes |
error | One video failed (comments disabled, bad URL). The stream continues with the next video |
migrating / aborting | The server is being replaced or shut down. Save the continuationToken and reconnect |
Resuming, and the continuation token
continuationToken is an opaque handle — store it and send it back unchanged. Do not parse,
build or edit one.
- It expires after 3 hours.
- It is bound to that request's video URL,
sortByandmaxRepliesPerComment. Change any of those and it is rejected. - Changing
maxCommentsoralreadyFetchedbetween calls is fine and does not invalidate it.
curl -X POST "https://dz-omar--youtube-comments-scraper.apify.actor/" -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" -H "Content-Type: application/json" -d '{"youtubeUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],"maxComments": 100,"continuationToken": "fx1_uIqvlU…","alreadyFetched": 50}'
A rejected token returns 400 with
continuation expired or does not match this input — start again without continuationToken.
Capping one request
Set maxCommentsPerRequest when the caller cannot wait on a long response — an agent or a
workflow step. The response ends with a paused event instead of video_complete:
{"type": "paused","reason": "item_cap","completed": false,"totalSent": 10,"continuationToken": "fx1_dIzx…","message": "Per-request budget reached. Send the same request again with this continuationToken to continue."}
Both budgets are soft and applied at page boundaries, so you may receive slightly more than you asked for and never a partial page. Send the same request back with the token to continue.
Health check
$curl "https://dz-omar--youtube-comments-scraper.apify.actor/heartbeat" -H "Authorization: Bearer <YOUR_APIFY_TOKEN>"
{ "status": "alive", "activeConnections": 0, "timestamp": "2026-11-19T18:57:41.513Z" }
Processing the stream
With jq:
$curl -s -X POST "https://dz-omar--youtube-comments-scraper.apify.actor/" -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" -H "Content-Type: application/json" -d '{"youtubeUrls":[{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}],"maxComments":50}' | jq -c 'select(.type == "batch") | .comments[]'
Pricing for API requests
You are charged per comment and per reply delivered, at the same event prices as the input interface — and an API request pays no start fee, so for small requests it is cheaper than a run. Results are returned in the response; nothing is written to a dataset in your account.
🛡️ Legal & Compliance
This Actor extracts publicly available comment data from YouTube. All data is accessible through normal YouTube viewing. No personal information is stored, source rate limits and terms are respected, and the output is suitable for commercial use.
No affiliation with or endorsement by YouTube is implied.
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 the Actor when the 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"}
🤝 Support & Resources
Getting Help
- 🌐 Website: flowextractapi.com
- 📧 Email: flowextractapi@outlook.com
- 🙋 Apify Profile: FlowExtract API
- 💬 GitHub Issues: FlowExtractAPI
Social Media
- 💼 LinkedIn: flowextract-api
- 🐦 X: @FlowExtractAPI
- 📱 Facebook: flowextractapi
- 🎵 TikTok: @flowextractapi
🌟 Related Actors by FlowExtract API
🎬 Video & Media
- YouTube Transcript Extractor - Extract transcripts with timestamps
- YouTube Scraper Pro - Complete channel and playlist extraction
- Zoom Scraper - Download recordings and transcripts
- Loom Scraper - Loom video and transcript extraction
🏠 Real Estate
- Idealista Scraper API - Spanish property data with API
- Idealista Scraper - Real estate listings extractor
🛠️ Developer Tools
- Screenshot - Fast webpage screenshots
- Ultimate Screenshot - Advanced screenshot tool
- Network Security Scanner - Security vulnerability scanner
📱 Social Media
- Facebook Ads Scraper Pro - Extract Facebook ads data
YouTube Comments Scraper — by FlowExtract API. Turn any website into structured data.