YouTube Comment Sentiment Scraper avatar

YouTube Comment Sentiment Scraper

Pricing

from $3.99 / 1,000 results

Go to Apify Store
YouTube Comment Sentiment Scraper

YouTube Comment Sentiment Scraper

Analyze public YouTube comments with bounded sentiment, topic and spam heuristics using ordinary public browsing or an opt-in official YouTube Data API route.

Pricing

from $3.99 / 1,000 results

Rating

0.0

(0)

Developer

Google API

Google API

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Features

Limited permissions

Share

What this Actor does

YouTube Comment Sentiment Scraper collects public comments available for YouTube videos and labels each comment using a deterministic English keyword lexicon. It can also report matched topics and simple text-based spam signals.

Sentiment is a transparent heuristic, not an AI assessment, moderation decision, or probability. A neutral label means no configured positive or negative terms matched; it does not prove the commenter felt neutral.

Input

Provide public video URLs or video IDs. You can also use search terms or public YouTube search URLs to discover videos. maxVideos limits videos inspected, maxCommentsPerVideo limits comments per video, and maxItems caps dataset rows across the run.

{"videoUrls":["https://www.youtube.com/watch?v=jNQXAC9IVRw"],"maxCommentsPerVideo":50,"maxItems":50}
{"queries":["beginner science tutorial"],"maxVideos":5,"maxCommentsPerVideo":25,"sortComments":"top"}

includeReplies is off by default and includes replies only when they are already visible in the public page. includeVideoMetadata adds public video title, description, channel, date, duration, and view information.

An optional official YouTube Data API route is available and is off by default. To use it, enable useYouTubeDataApi and configure youtubeApiKey as a secret in Apify. Do not put an API key in the input JSON. API results depend on the key's permissions and available quota. Enabling useYouTubeDataApi without a key stops the run explicitly: it emits zero rows, makes zero API requests, and never falls back to the restricted public browse route. The same API-only isolation applies to any API failure — a failure is recorded in the key-value store with an explicit status (API_EXECUTION_FAILED / COMMENTS_DISABLED) and is never rewritten as success. Comments disabled at the source produce zero business rows plus a structured KVS status.

You can provide IDs with videoIds, use query or searchQuery for one search, or use searchUrls for public YouTube /results pages. deduplicate is enabled by default, and locale sets the language preference for generated searches and public pages.

Dataset output

Each row contains a videoId, commentId, comment text, and a sentiment object. Other available fields include the video title and URL, channel identity, comment author display name, like/reply counts, reply relationship, publication text, topics, and spam indicators.

{
"videoId": "jNQXAC9IVRw",
"videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
"commentId": "UgxExamplePositive",
"text": "This clear tutorial is great and very helpful!",
"authorName": "Example Viewer",
"likeCount": 12,
"replyCount": 2,
"isReply": false,
"sentiment": {
"label": "positive",
"score": 1,
"method": "fixed_english_keyword_lexicon",
"positiveMatches": ["clear", "great", "helpful"],
"negativeMatches": []
},
"topics": ["education"],
"spamSignals": {"isLikelySpam": false, "reasons": []}
}

The sentiment score is bounded between -1 and 1 and is based on the matched words. Each sentiment object records its version, model, rulesVersion, and rulesHash. The score is a deterministic English-lexicon keyword balance, not calibrated statistical confidence (confidenceIsCalibrated: false, scoreIsStatisticalConfidence: false); a neutral label means no configured term matched, not that the commenter felt neutral. The classifier is local and entirely distinct from the comment source. Only the comments actually retrieved were classified; the exact sampled count, limitations, and the publication HOLD are reported in the key-value store (sentimentGovernance). No population-wide audience claim, complete-audience-sentiment claim, or sensitive-attribute profiling is made — two sampled comments are never a complete audience-sentiment analysis. Live API-derived sentiment publication remains on HOLD until the applicable viewer-sentiment analytics amendment is accepted by the developer; this project does not claim that acceptance. spamSignals are indicators only, not a moderation verdict. The Actor does not infer unavailable comments or fill failed sources with placeholder rows.

Download dataset results in JSON, CSV, Excel, or another format supported by Apify. The run page also displays a summary and source status.

Cost, coverage, and responsible use

Check the Actor's Pricing tab for current Actor and Apify platform charges. More videos and higher comment limits increase collection volume. The official Data API route uses the configured key's quota.

Only comments exposed on public video pages or through the configured official API are collected. Comments may contain personal information shared by their authors. Follow YouTube's terms and applicable privacy laws, and use the results only for a legitimate purpose.