get_video_comments
Retrieve top comments from a YouTube video with engagement metrics like like count and timestamp to analyze audience feedback.
Instructions
Get top comments for a YouTube video with engagement metrics.
Retrieves top-level comments (no replies) sorted by relevance.
Comments are cached for 5 minutes. Returns empty list if comments
are disabled for the video.
Args:
video_id: YouTube video ID (e.g., "dQw4w9WgXcQ")
max_results: Maximum comments to return (1-100, default: 20)
Returns:
Dictionary with video_id, comments list, and total_returned.
Each comment includes author, text, like_count, published_at.
Example:
>>> comments = get_video_comments("nLwbNhSxLd4", max_results=10)
>>> print(comments["comments"][0]["author"])
Note:
- Costs 1 quota unit per request
- Cached for 5 minutes in youtube.comments namespace
- Returns empty list if comments disabled (not an error)Caching Behavior:
Parameters that accept reference strings can accept a
ref_idfrom a previous tool callLarge results return ref_id + preview; use get_cached_result to paginate
All responses include ref_id for future reference
Ref input compatibility: Support depends on the tool's input schema/validation. Some strictly typed parameters may reject string ref_ids before resolution.
Full retrieval: Use get_cached_result(ref_id, full=True) to get the complete value.
Preview Size: server default. Override per-call with get_cached_result(ref_id, max_size=...).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| video_id | Yes | ||
| max_results | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||