查询视频评论
请求
HTTP URL | https://open.tiktokapis.com/v2/research/video/comment/list/ |
HTTP 请求方法 | POST |
权限范围 | research.data.basic (必要权限) |
请求头
Key | 类型 | 描述 | 示例值 |
Authorization | 字符串 (String) | 通过 /v2/oauth/token/ 获取的客户端访问令牌。 | Bearer clt.example12345Example12345Example |
Content-Type | 字符串 (String) | 返回数据的内容类型。 | application/json |
查询参数
Key | 类型 | 描述 | 示例 | 是否必填 |
fields | 字符串 (String) | 请求的字段。从 Comment 对象的字段中选择。 | 完整列表: id, video_id, text, like_count, reply_count, parent_comment_id, create_time | 是 |
请求体参数
注意:在查询中,必须根据要检索的数据类型,请求 video_id 或 comment_id。只能请求其中一个,不能同时请求两者。
- 请求
video_id将返回指定视频的评论数据。 - 请求
comment_id将返回指定评论的回复数据。
Key | 类型 | 描述 | 是否必填 |
video_id | int64 | 评论所属视频的 ID。 | 是 |
comment_id | int64 | 回复所属评论的 ID。 | 是 |
max_count | int64 | 响应中返回的评论数量。 默认值为 10,最大值为 100。 由于用户删除评论等原因,API 返回的评论数可能会少于你指定的最大数量。 | 否 |
cursor | int64 | 返回评论的起始索引位置。 | 否 |
示例
video_id:
curl --location 'https://open.tiktokapis.com/v2/research/video/comment/list/?fields=id%2Ctext' \
--header 'Authorization: Bearer clt.abcdefg' \
--header 'Content-Type: application/json' \
--data '{
"video_id": 12345678901,
"max_count": 100,
"cursor":0
}'comment_id:
curl --location 'https://open.tiktokapis.com/v2/research/video/comment/list/?fields=id%2Ctext' \
--header 'Authorization: Bearer clt.abcdefg' \
--header 'Content-Type: application/json' \
--data '{
"comment_id": 1234,
"max_count": "100",
"cursor":0
}'响应
响应体
Key | 类型 | 描述 |
data | ResearchVideoCommentsData | 请求中指定视频的评论列表。 |
error | ErrorStructV2 | Error 对象。 |
ResearchVideoCommentsData
Key | 类型 | 描述 | 示例 |
comments | CommentObject | 评论的元数据。 | 请参见下方示例。 |
cursor | int64 | 下一页的起始游标。 | 1050 |
has_more | 布尔值 (Boolean) | 是否还有更多视频。 | true |
Comment 对象
Key | 类型 | 描述 |
id | 整数 (int) | 该评论的唯一 ID。 |
text | 字符串 (String) | 该评论中的文字内容。 |
video_id | 整数 (int) | 该评论所属视频或项目的 ID。 |
parent_comment_id | 整数 (int) | 该评论的父评论 ID(若有)。 |
like_count | 整数 (int) | 该评论的获赞数。 |
reply_count | 整数 (int) | 该评论的回复数。 |
create_time | 整数 (int) | 该评论创建时的 Unix 时间戳。 |
display_name | 字符串 (String) | 发表该评论的用户的显示名称。 |
示例
video_id:
{
"data": {
"comments": [
{
"text": "AWEEEEEE 🥰🥰🥰",
"video_id": 1234563451201523412,
"create_time": 1671491598,
"id": 12345616934634134,
"like_count": 50,
"parent_comment_id": 1234561201524010,
"reply_count": 10
},
...
],
"has_more": true,
"cursor": 300
},
"error": {
"code": "ok",
"message": "",
"log_id": "202207280326050102231031430C7E754E"
}
}comment_id:
{
"data": {
"has_more": false,
"comments": [
{
"parent_comment_id": 1234567876543,
"reply_count": 0,
"text": "Lalalaa",
"create_time": 1740510402,
"display_name": "test",
"id": 12345678909876
}
],
"cursor": 1
},
"error": {
"code": "ok",
"message": "ok",
"log_id": "20123456789876543"
}
}评论中的个人信息(例如电话号码、电子邮件和信用卡账号等)将被脱敏处理。示例如下:
评论原文:“你能联系我吗?我的电话号码是 4059233930。嗨,李明,请发邮件至 acharles@emortgagecapital.com 联系我。下载拼多多并注册账号,然后搜索 23216471 并点击接受。”
API 返回的评论:“你能联系我吗?我的电话号码是 40******30。
嗨,李明,请发邮件至 a*******@******************** 联系我。
下载拼多多并注册账号,然后搜索 ****6471 并点击接受。”