💬 YouTube Comments Scraper avatar

💬 YouTube Comments Scraper

Pricing

from $0.80 / 1,000 parent comments

Go to Apify Store
💬 YouTube Comments Scraper

💬 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

FlowExtract API

Maintained by Community

Actor stats

17

Bookmarked

102

Total users

5

Monthly active users

3 hours ago

Last modified

Features

Limited permissionsMulti-tenantServer interface

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

FlowExtractAPI 🧾 YouTube Extractor (Transcripts + Metadata)

-- 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-1,000,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)

⚡ 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

🌐 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

ParameterTypeDescription
youtubeUrlsarrayRequired. YouTube video URLs to scrape
maxCommentsintegerMaximum comments per video
sortBystring"top" or "newest"
maxRepliesPerCommentintegerMax replies per comment (0 disables replies)
maxCommentsPerRequestintegerOptional. Bound a single response to about this many comments (or ~2 minutes). Omit it and one request runs to completion, as before
continuationTokenstringOptional. Opaque resume token from a previous response
alreadyFetchedintegerOptional. Comments already received, sent alongside continuationToken

Event types

typeMeaning
batchA batch of comments. completed: true marks the last batch for that video
video_completeThat video finished. Not sent after a paused event
pausedOnly when you set maxCommentsPerRequest: the budget was reached and more remains. Carries completed: false and a continuationToken
completeFinal line; the connection closes
errorOne video failed (comments disabled, bad URL). The stream continues with the next video
migrating / abortingThe 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, sortBy and maxRepliesPerComment. Change any of those and it is rejected.
  • Changing maxComments or alreadyFetched between 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.

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.

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 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

Social Media


🎬 Video & Media

🏠 Real Estate

🛠️ Developer Tools

📱 Social Media


YouTube Comments Scraper — by FlowExtract API. Turn any website into structured data.