YouTube Data API

Can you get YouTube comments via API?

TL;DR

The commentThreads.list endpoint returns top-level comments for any video, and comments.list returns replies to specific comments. Each call costs 1 quota unit and returns up to 100 comments per page. You get comment text, author name, like count, publish date, and reply count. BrightBean’s /comments endpoint goes further with automated sentiment analysis and topic extraction.

Can you get YouTube comments via API?

Yes. The YouTube Data API provides two endpoints for comments:

commentThreads.list returns top-level comments on a video. Each comment thread includes the top-level comment and a preview of replies. You can sort by time (newest first) or relevance (YouTube’s ranking). Set maxResults up to 100 per page and use pageToken for pagination.

comments.list returns all replies to a specific top-level comment, identified by its parent comment ID. This lets you retrieve full conversation threads.

Each call costs 1 quota unit, making comments relatively cheap to retrieve. However, popular videos can have hundreds of thousands of comments, so fetching all of them requires many paginated requests.

Key data fields for each comment: textDisplay (HTML-formatted text), textOriginal (plain text), authorDisplayName, likeCount, publishedAt, updatedAt, and totalReplyCount.

Comments can be disabled per-video. Videos targeting children (COPPA-flagged content) have comments disabled by default. The API returns an error for these videos.

For analysis purposes, raw comments are noisy. You’ll find spam, self-promotion, timestamps (“2:34 was hilarious”), and generic reactions alongside useful feedback. Processing comments for insights requires NLP filtering.

How BrightBean helps

BrightBean’s /comments endpoint pre-processes comments with sentiment analysis and topic extraction, saving you from building your own NLP pipeline.

GET /comments?video_id=dQw4w9WgXcQ&analysis=true

{
  "total_comments": 12450,
  "analyzed": 500,
  "sentiment": { "positive": 0.62, "neutral": 0.28, "negative": 0.10 },
  "top_topics": [
    { "topic": "editing quality", "mentions": 45, "sentiment": 0.89 },
    { "topic": "audio issues", "mentions": 23, "sentiment": -0.42 }
  ],
  "audience_questions": [
    "What camera do you use?",
    "Can you make a video about lighting setup?"
  ]
}

Key takeaways

  • commentThreads.list and comments.list provide full comment access at 1 quota unit per call
  • You get comment text, author info, likes, timestamps, and reply counts
  • Pagination is required for videos with many comments (100 per page max)
  • COPPA-flagged videos have comments disabled
  • BrightBean adds automated sentiment analysis and topic extraction to raw comments

Get structured YouTube intelligence

BrightBean delivers content gaps, title scores, thumbnail analysis, and hook classification via API and MCP server.

Get early access →