YouTube Comments Scraper (Sentiment & Market Research) avatar

YouTube Comments Scraper (Sentiment & Market Research)

Pricing

$2.00 / 1,000 comment founds

Go to Apify Store
YouTube Comments Scraper (Sentiment & Market Research)

YouTube Comments Scraper (Sentiment & Market Research)

Pulls video comments via the official YouTube Data API v3: full text, author, channel link, like count, date and replies. Includes like-count and keyword filters. For sentiment analysis and market research. Bring your own free API key (BYOK).

Pricing

$2.00 / 1,000 comment founds

Rating

0.0

(0)

Developer

Korhan Coşan Ergün

Korhan Coşan Ergün

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Categories

Features

Limited permissions

Share

Pulls video comments, their authors and like counts via the official YouTube Data API v3 commentThreads.list endpoint. For sentiment analysis, market research, product-feedback mining and brand monitoring.

Bring your own API key (BYOK)

The youtubeApiKey input is required and is stored as a secret. To get one for free:

  1. console.cloud.google.com → new project
  2. APIs & Services → Library → "YouTube Data API v3" → Enable
  3. APIs & Services → Credentials → Create credentials → API key

commentThreads.list = 1 quota unit per 100 comments. The free quota of 10,000 units per day ≈ 1,000,000 comments.

Input

{
"youtubeApiKey": "***",
"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
"maxCommentsPerVideo": 100,
"order": "relevance",
"includeReplies": true,
"minLikeCount": 0,
"searchTerms": []
}
  • order: relevance (top comments — recommended for sentiment analysis) or time
  • includeReplies: replies become separate records too (is_reply=true, parent_comment_id filled in)
  • minLikeCount: skip comments with fewer likes than this
  • searchTerms: when supplied, only comments containing one of these words are written (case-insensitive) — useful for filtering brand/product feedback

Output fields

FieldDescription
comment_id, linkComment id and a direct deep link (...&lc=<id>)
text, text_length, titleFull comment text, its length, a shortened title
author_display_name, author_channel_id, author_channel_url, author_profile_image_urlAuthor
like_countLike count
published_at, updated_at, is_editedTiming information and whether it was edited
is_reply, parent_comment_id, total_reply_countThread structure
video_id, video_title, video_urlWhich video it belongs to
can_rate, viewer_ratingAPI metadata fields

Pagination is automatic: nextPageToken is followed until maxCommentsPerVideo is reached or the comments run out. Videos with comments disabled (commentsDisabled) are skipped and logged.

Pricing

Pay-per-event: comment-found → $0.002. You are only charged per comment actually written to the dataset (filtered-out comments are free).

robots.txt note

youtube.com/robots.txt disallows the /comment path, but this actor does not use the web page — it uses the official API on googleapis.com, where that robots.txt restriction does not apply; the YouTube API Services ToS applies instead.

Local test

bash ../_common/vendor_common.sh .
APIFY_LOCAL=1 YOUTUBE_API_KEY=*** python3 main.py

Without a key (code-path verification only):

$python3 test_fixtures.py

test_fixtures.py starts a local HTTP server that imitates the API (including pagination). The response bodies are written to match the field structure in Google's official API reference: structurally correct, but the data is synthetic. sample_output.json is also derived from that fixture run (an example structure, not live data).