获取视频评论/Get video comments
About
获取视频评论/Get video comments
Documentation
获取视频评论/Get video comments
[中文]
用途:
- 获取YouTube视频的一级评论
参数详解:
📌 必选参数:
video_id (string)
- 作用: 视频ID
- 格式: YouTube视频ID字符串
- 示例:
"oaSNBz4qMQY" - 获取方式: 从URL
https://www.youtube.com/watch?v=oaSNBz4qMQY中提取
⚙️ 可选参数:
language_code (string, 可选)
- 作用: 设置评论显示的语言偏好
- 默认值:
"zh-CN" - 可用值:
"zh-CN","en-US","ja-JP","ko-KR"等
country_code (string, 可选)
- 作用: 设置地区代码
- 默认值:
"US" - 可用值:
"US","JP","GB"等
sort_by (string, 可选)
- 作用: 评论排序方式
- 默认值:
"top" - 可用值:
"top"- 热门评论(按点赞数排序)"newest"- 最新评论(按时间排序)
continuation_token (string, 可选)
- 作用: 翻页令牌,用于获取下一页评论
- 默认值:
null - 获取方式: 从上一次请求的响应中提取
need_format (boolean, 可选)
- 作用: 是否返回清洗后的精简数据
- 默认值:
true - 可用值:
false- 返回原始完整数据true- 返回清洗后的精简数据(推荐,默认)
返回数据结构 (need_format=true):
{
"comments": [
{
"comment_id": "UgzRDoUJAvDNn5_8i8p4AaABAg",
"content": "评论内容文本",
"published_time": "1天前",
"reply_level": 0,
"like_count": "2",
"like_count_a11y": "2 次赞",
"reply_count": "0",
"reply_count_a11y": "0 条回复",
"reply_count_text": "1 条回复",
"reply_continuation_token": "...",
"author": {
"channel_id": "UCzRzHrLFuH0lHZYnrI84I8Q",
"display_name": "@username",
"channel_url": "https://www.youtube.com/@username",
"avatar_url": "https://yt3.ggpht.com/...",
"avatar_thumbnails": [
{"url": "...", "width": 88, "height": 88}
],
"is_verified": false,
"is_creator": false,
"is_artist": false
},
"creator_thumbnail_url": "https://yt3.ggpht.com/..."
}
],
"continuation_token": "下一页token"
}
字段说明:
comment_id: 评论唯一IDcontent: 评论文本内容published_time: 发布时间(相对时间,如"1天前")reply_level: 回复层级(0表示一级评论)like_count: 点赞数reply_count: 回复数reply_count_text: 回复数文本(如"1 条回复")reply_continuation_token: 获取该评论回复的tokenauthor: 评论作者信息channel_id: 作者频道IDdisplay_name: 显示名称channel_url: 频道URLavatar_url: 头像URLis_verified: 是否已认证is_creator: 是否为视频创作者is_artist: 是否为音乐人
creator_thumbnail_url: 视频创作者头像URL
[English]
Purpose:
- Get YouTube video first-level comments
Parameters:
📌 Required:
video_id (string)
- Purpose: Video ID
- Format: YouTube video ID string
- Example:
"oaSNBz4qMQY" - How to get: Extract from URL
https://www.youtube.com/watch?v=oaSNBz4qMQY
⚙️ Optional:
language_code (string, optional)
- Purpose: Set language preference for comments
- Default:
"zh-CN" - Values:
"zh-CN","en-US","ja-JP","ko-KR", etc.
country_code (string, optional)
- Purpose: Set region code
- Default:
"US" - Values:
"US","JP","GB", etc.
sort_by (string, optional)
- Purpose: Comment sorting method
- Default:
"top" - Values:
"top"- Top comments (sorted by likes)"newest"- Newest comments (sorted by time)
continuation_token (string, optional)
- Purpose: Pagination token for next page
- Default:
null - How to get: Extract from previous response
need_format (boolean, optional)
- Purpose: Whether to return cleaned simplified data
- Default:
true - Values:
false- Return raw complete datatrue- Return cleaned simplified data (recommended, default)
Response Structure (need_format=true):
{
"comments": [
{
"comment_id": "UgzRDoUJAvDNn5_8i8p4AaABAg",
"content": "Comment text content",
"published_time": "1 day ago",
"reply_level": 0,
"like_count": "2",
"like_count_a11y": "2 likes",
"reply_count": "0",
"reply_count_a11y": "0 replies",
"reply_count_text": "1 reply",
"reply_continuation_token": "...",
"author": {
"channel_id": "UCzRzHrLFuH0lHZYnrI84I8Q",
"display_name": "@username",
"channel_url": "https://www.youtube.com/@username",
"avatar_url": "https://yt3.ggpht.com/...",
"avatar_thumbnails": [
{"url": "...", "width": 88, "height": 88}
],
"is_verified": false,
"is_creator": false,
"is_artist": false
},
"creator_thumbnail_url": "https://yt3.ggpht.com/..."
}
],
"continuation_token": "next page token"
}
Field Descriptions:
comment_id: Unique comment IDcontent: Comment text contentpublished_time: Published time (relative, e.g., "1 day ago")reply_level: Reply level (0 for first-level comments)like_count: Number of likesreply_count: Number of repliesreply_count_text: Reply count text (e.g., "1 reply")reply_continuation_token: Token to get replies for this commentauthor: Comment author infochannel_id: Author's channel IDdisplay_name: Display namechannel_url: Channel URLavatar_url: Avatar URLis_verified: Whether verifiedis_creator: Whether video creatoris_artist: Whether artist
creator_thumbnail_url: Video creator's avatar URL
[示例/Examples]
获取热门评论
GET /youtube_web/get_video_comments?video_id=oaSNBz4qMQY&sort_by=top
获取最新评论
GET /youtube_web/get_video_comments?video_id=oaSNBz4qMQY&sort_by=newest
获取清洗后的评论数据(推荐)
GET /youtube_web/get_video_comments?video_id=oaSNBz4qMQY&need_format=true
翻页获取更多评论
GET /youtube_web/get_video_comments?video_id=oaSNBz4qMQY&continuation_token=xxx&need_format=true
Imported from a validated TikHub OpenAPI document. Pricing must be reviewed before enabling.
Try 获取视频评论/Get video comments
Test this model in the Sandbase Playground with your own prompts.
Open in Playground