YouTube Comments Scraper | avatar

YouTube Comments Scraper |

Pricing

from $1.50 / 1,000 results

Go to Apify Store
YouTube Comments Scraper |

YouTube Comments Scraper |

Extract comments from one or more YouTube video URLs with the YouTube Comments Scraper. Collect structured comment data including text, author, timestamps, replies, votes, video details, and configurable comment counts for research, analysis, and dataset creation.

Pricing

from $1.50 / 1,000 results

Rating

5.0

(1)

Developer

Alpha Scraper

Alpha Scraper

Maintained by Community

Actor stats

0

Bookmarked

9

Total users

0

Monthly active users

5 days ago

Last modified

Share

YouTube Comments Scraper

The YouTube Comments Scraper extracts comments from one or more YouTube video URLs and returns the results as structured data. It is designed for users who need to collect YouTube comment information for research, analysis, audience insights, content studies, and dataset creation.

Provide one or more supported YouTube URLs through the startUrls input, choose whether to collect all available comments or limit the number collected, and select the preferred comment ordering. Each processed video produces a structured result containing video information, the number of comments reported or collected, and an array of comment records.

The output includes useful comment-level information such as comment ID, publication text, parsed publication timestamp when available, comment text, author, reply count, vote count, video ID, and source page URL.

What Is the YouTube Comments Scraper?

The YouTube Comments Scraper is an Apify Actor for collecting publicly accessible comment data associated with YouTube videos.

The Actor accepts one or more entries through startUrls. For each URL, it processes available comments and creates a separate structured output record for the corresponding video. You can control collection with the maxComments and getAllComments settings.

This makes the Actor useful for building organized YouTube comment datasets instead of manually copying individual comments from video pages.

The Actor is particularly useful when the goal is to study audience reactions, identify recurring themes, analyze discussion activity, or create structured datasets for further processing.

Key Features

FeatureDescriptionUser Benefit
Multiple YouTube URLsAccepts one or more entries through startUrls.Process comments for multiple videos in a single Actor run.
Comment count controlUse maxComments to specify the maximum number of comments collected when all-comments mode is disabled.Keep test runs and datasets within a desired size.
All-comments modegetAllComments can be enabled to continue collecting comments without applying the maximum comment limit.Useful for broader comment collection when available.
Comment sorting optionThe input provides options for top comments or newest comments.Lets you select the preferred collection mode.
Structured video resultsEach processed video is returned with video-level and comment-level information.Makes the collected data easier to review and analyze.
Comment metadataReturned comment records can include author, reply count, vote count, publication text, and parsed timestamps.Provides more context than comment text alone.
Apify Dataset outputResults are pushed to the Actor's default dataset.Supports organized downstream data handling within Apify.

What Data Can You Extract?

The YouTube Comments Scraper returns a structured record for each processed video. The main video-level information includes the original video URL, extracted YouTube video ID, video title when it can be obtained, reported comment count when available, and the number of comments actually scraped.

The nested comments collection contains individual comment records. Depending on the information available for a comment, the dataset can include:

  • Comment ID (cid)
  • Comment type
  • Original publication-time text
  • Parsed publication timestamp
  • Comment text
  • Author name
  • Reply count
  • Vote or like count
  • YouTube video ID
  • Video page URL

The Actor also retains the original relative publication text, such as a value representing when a comment was posted, while attempting to convert recognizable relative dates into a Unix timestamp.

Because source data availability can vary, some comment-level fields may be empty or unavailable for particular records.

Why Use the YouTube Comments Scraper?

Manual collection of YouTube comments can become repetitive when research involves multiple videos or larger discussion threads. This Actor turns that process into a repeatable data-collection workflow using structured output.

It can help when you need to:

  • Build a YouTube comment dataset for research.
  • Review audience discussions across several videos.
  • Analyze comment text and engagement signals.
  • Compare reactions between different video pages.
  • Prepare structured records for further analysis.
  • Reduce repetitive manual copying of public comment information.

The value of the Actor comes from combining comment text with contextual metadata such as video ID, author, reply count, and vote count in a consistent output structure.

Benefits

The YouTube Comments Scraper is useful when your workflow requires organized discussion data rather than manually reviewing every comment.

Automation: Run repeatable comment collection tasks through Apify.

Structured results: Receive video records and nested comment objects in a consistent JSON-compatible structure.

Configurable volume: Use maxComments for controlled collection or enable getAllComments for broader collection.

Research support: Comment datasets can support audience research, topic analysis, content studies, and other data-driven workflows.

Multi-video collection: Supplying multiple URLs allows the Actor to process more than one video within a run.

How to Use the YouTube Comments Scraper

Using the Actor is straightforward:

  1. Add one or more YouTube URLs to startUrls.
  2. Set maxComments when you want to control the collection size.
  3. Enable getAllComments when you want to collect comments without applying the maximum comment limit.
  4. Select the desired option in sortBy.
  5. Start the Actor.
  6. Review the generated dataset records for each processed video.

For a first run, it is practical to use a small maxComments value so you can inspect the returned structure before processing larger comment collections.

Input

The Actor requires startUrls. The other inputs are optional.

FieldTypeRequiredDefaultDescription
startUrlsArrayYesOne or more YouTube URLs to process.
maxCommentsIntegerNo100 in the provided input configurationMaximum number of comments to collect when getAllComments is disabled.
getAllCommentsBooleanNofalseWhen true, the Actor does not stop at the configured maximum comment count.
sortByStringNotop CommentsSelects the configured comment ordering option: top Comments or newest comments.

Input Details

startUrls accepts an array of URL entries. The provided Actor configuration uses Apify's request-list style input, where entries can contain a url property.

maxComments controls collection when getAllComments is false. If all-comments mode is enabled, the configured maximum is not used as the stopping condition.

getAllComments is the main control for choosing between limited collection and broader comment collection.

sortBy provides two configured values. The Actor accepts top Comments and newest comments through the input schema. Actual returned ordering can depend on the information available in the collected comments.

Input Example

{
"startUrls": [
{
"url": "https://www.youtube.com/watch?v=k_dYs8ovmnk"
},
{
"url": "https://www.youtube.com/watch?v=VegKhno-BK8"
}
],
"maxComments": 100,
"getAllComments": false,
"sortBy": "top Comments"
}

For broader collection, you can enable getAllComments:

{
"startUrls": [
{
"url": "https://www.youtube.com/watch?v=k_dYs8ovmnk"
}
],
"getAllComments": true,
"sortBy": "newest comments"
}

Output

Each processed URL produces one top-level result containing video information and a nested comments array.

The Actor pushes each result to the Apify Dataset. It also creates a local JSON file for the processed video during execution, but the primary user-facing collection is the structured dataset output.

FieldDescription
videoUrlThe YouTube URL processed by the Actor.
videoIdThe extracted 11-character YouTube video ID when recognized.
titleVideo title when it can be obtained from the video page.
commentsCountComment count detected from the page when available; otherwise falls back to the number actually scraped.
commentsArray containing the normalized comment records.
scrapedCountNumber of comments included in the returned comments array.

Each object inside comments can contain:

FieldDescription
cidComment identifier when available.
typeComment record type, currently comment.
publishedTimeTextOriginal relative publication-time text when available.
publishedTimeTsParsed Unix timestamp when the publication text can be interpreted.
commentComment text.
authorComment author's displayed name when available.
replyCountNumber of replies when available.
voteCountVote or like count when available.
videoIdYouTube video ID associated with the comment.
pageUrlOriginal YouTube page URL.

Output Example

{
"videoUrl": "https://www.youtube.com/watch?v=k_dYs8ovmnk",
"videoId": "k_dYs8ovmnk",
"title": "Example YouTube Video",
"commentsCount": 100,
"comments": [
{
"cid": "example_comment_id",
"type": "comment",
"publishedTimeText": "2 days ago",
"publishedTimeTs": 1770000000,
"comment": "This is an example comment.",
"author": "Example User",
"replyCount": 3,
"voteCount": 12,
"videoId": "k_dYs8ovmnk",
"pageUrl": "https://www.youtube.com/watch?v=k_dYs8ovmnk"
}
],
"scrapedCount": 1
}

Values in the example are illustrative. Actual values depend on the information available for the processed video and comments.

Use Cases

The collected YouTube comments dataset can support several legitimate research and analysis workflows.

Audience research: Examine what viewers are saying about a video, topic, or content theme.

Content research: Identify recurring subjects, questions, reactions, and discussion patterns.

Competitive research: Compare public audience conversations across multiple videos or channels when appropriate.

Market research: Analyze public comments for recurring needs, preferences, complaints, or opinions.

Sentiment and topic analysis: Use exported comment text as source material for downstream analytical workflows.

Dataset creation: Build structured YouTube discussion datasets for research or internal analysis.

Engagement analysis: Review reply counts and vote counts alongside comment text.

Pros and Cons

ProsCons
Structured video and comment outputAvailable fields can vary by source data
Supports multiple URL inputsLarge comment collections may take longer to process
Configurable comment volumeSome publication timestamps may not be parseable
Includes useful comment metadataVideo title and reported comment count are obtained on a best-effort basis
Supports an all-comments optionThe Actor is focused on YouTube video comment collection rather than general YouTube data extraction

Comparison With Manual Collection

CapabilityThis ActorManual / Typical Alternative
AutomationSupported through an Apify Actor runUsually manual
Multiple video URLsSupportedRequires repeated manual work
Structured outputReturned as structured dataset recordsOften requires manual formatting
Comment metadataIncluded when availableMust often be recorded separately
Configurable collection sizeSupported with maxComments and getAllCommentsUsually controlled manually
Repeatable workflowSuitable for repeatable runsMore repetitive

This comparison describes workflow characteristics rather than guaranteeing a particular result volume or completeness.

Competitive Advantages

A practical reason to choose this Actor is its focused workflow for YouTube comments. Instead of requiring users to manually organize comment text and related metadata, the Actor returns video-level records with a nested comment dataset.

Its configuration also separates URL collection, comment-volume control, all-comments mode, and sorting preferences, giving users clear controls for different research scenarios.

The structured scrapedCount, commentsCount, videoId, and comment-level metadata can make downstream analysis easier because important context remains associated with each collected record.

Limitations

The Actor is designed around YouTube video URLs. Although the input interface describes the startUrls field broadly, the processing logic extracts a video ID from supported YouTube video URL patterns, so channel URLs should not be treated as equivalent to video URLs.

Some video metadata is collected on a best-effort basis. In particular, the video title and page-level comment count may not always be available. When the page-level comment count cannot be determined, commentsCount falls back to the number of comments actually collected.

Publication timestamps are also best effort. Recognizable relative time expressions can be converted into Unix timestamps, but values that cannot be interpreted remain unavailable.

Results can be partial when comment iteration encounters an error. The Actor preserves comments collected before such an error where possible.

Best Practices

Start with a small number of comments to confirm that the input URL and output structure meet your needs.

Use actual YouTube video URLs containing recognizable video identifiers.

Choose getAllComments: false with a defined maxComments when you need a controlled dataset size.

Use getAllComments: true when the purpose of the run is to collect a broader comment set and you do not want the configured maximum to stop collection.

Review a sample of returned records before using the dataset for important analysis, especially when specific metadata fields are essential to your workflow.

Troubleshooting

Invalid or unsupported URL: Check that the input is a YouTube video URL and that it contains a recognizable video ID.

No results: Verify that startUrls is populated and that the supplied URL points to the intended video. Re-running may help when data is temporarily unavailable.

Fewer comments than expected: Check whether getAllComments is disabled and whether maxComments is limiting the collection.

Missing title or comment count: These fields are obtained on a best-effort basis. The output can still contain comments even when page-level metadata cannot be determined.

Missing metadata: Individual comments may not contain every optional field. Review the returned record rather than assuming every field will always have a value.

Partial results: If comment collection encounters an error during processing, the Actor may return the comments collected before the error. A retry can be appropriate when the issue appears temporary.

Frequently Asked Questions

What does the YouTube Comments Scraper do?

The YouTube Comments Scraper collects comments from supplied YouTube video URLs and returns structured video and comment information in the Apify Dataset.

What input does the Actor require?

The required input is startUrls, containing one or more YouTube URLs. The processing logic is intended for video URLs with recognizable YouTube video IDs.

Can I process multiple videos?

Yes. startUrls is an array, so you can provide multiple URL entries in the same run.

How do I limit the number of comments?

Use maxComments while keeping getAllComments set to false. The Actor stops collecting once the configured maximum is reached.

How can I collect all comments?

Set getAllComments to true. In that mode, the configured maximum comment count is not used as the collection stopping condition.

What data does each comment contain?

Depending on source availability, comment records can include an ID, publication text, parsed timestamp, comment text, author, reply count, vote count, video ID, and page URL.

Does the Actor return the video title?

The Actor attempts to obtain the video title from the video page. When it cannot determine the title, the field may be null.

What is commentsCount?

commentsCount is the comment count detected from the page when available. When that information cannot be determined, it falls back to the number actually scraped.

Are timestamps always available?

No. The Actor attempts to parse recognizable relative publication times. When a value cannot be interpreted, publishedTimeTs may be unavailable while the original publishedTimeText can still be retained.

Is the Actor suitable for research and automation?

Yes. Its repeatable inputs and structured dataset output make it suitable for workflows involving YouTube comment research, data collection, analysis, and automation.

What should I do before running a large collection?

Start with a small test run, verify the returned fields, confirm that the URLs are correct, and then increase the collection scope as needed.

NLP Keywords

  • YouTube comment extraction
  • YouTube comment data
  • YouTube video comments
  • YouTube audience comments
  • YouTube comment metadata
  • YouTube discussion data
  • YouTube comment dataset
  • YouTube comment collection
  • YouTube audience research
  • YouTube engagement data
  • YouTube comment analysis
  • video comment scraper
  • public comment data
  • comment text extraction
  • comment author data
  • comment reply count
  • comment vote count
  • YouTube video metadata
  • structured comment data
  • YouTube research data
  • YouTube comments scraper
  • scrape YouTube comments
  • YouTube comment scraper
  • extract YouTube comments
  • YouTube video comment extractor
  • YouTube comments data scraper
  • collect YouTube comments
  • YouTube comment dataset
  • YouTube comment extraction tool
  • YouTube audience comment scraper
  • YouTube comment research
  • YouTube comment data extraction
  • YouTube video comments extractor
  • scrape comments from YouTube video
  • YouTube discussion scraper
  • YouTube public comments extractor
  • YouTube comment metadata scraper
  • YouTube comment collection tool
  • YouTube comments analysis data
  • structured YouTube comment data

Final Overview

The YouTube Comments Scraper provides a focused way to collect structured comments from YouTube video URLs. With support for multiple inputs, configurable comment limits, an all-comments option, comment ordering controls, and detailed comment-level metadata, it can serve as a practical foundation for audience research, content research, data analysis, and dataset creation.

Use a small test collection to validate your workflow first, then configure the Actor according to the scope of your research and the amount of comment data you need.

Contact me: Alphascraper69@gmail.com