查询视频评论
创建查询任务
查询
查询参数
Key | 类型 | 描述 | 示例 | 是否必填 |
category | 字符串 (String) | 需要分析的数据类别。 | comment | 是 |
condition_groups | 列表 (list) | 指定要返回和处理的数据。 | condition_groups = [ { "operator": "and", "conditions": [ { "field": "id", "operator": "eq", "field_values": ["7347705421577563079"] } ] } ] | 否 |
fields | 字符串 (String) | 需返回的数据字段。接口将只返回此处列出的字段。 | comment_id,video_id | 是 |
limit | 整数 (int) | 返回的最大记录数。 测试阶段 默认值为 100。 执行阶段 默认值为 1000。 | 200 | 否 |
查询条件
Key | 类型 | 描述 | 是否必填 |
and | list<Condition> |
| 否 |
or | list<Condition> |
| 否 |
not | list<Condition> |
| 否 |
查询条件字段和运算符
字段 | 描述 | 类型 | 允许的操作符 | |
comment_id | 该评论的唯一 ID。 | 字符串 (String) |
| |
video_id | 该评论所属视频或项目的 ID。 | 字符串 (String) |
|
响应
Key | 类型 | 描述 | 示例 |
task_id | 整数 (int) | 数据查询任务的 ID。 | 12345 |
查看查询任务状态
查询参数
Key | 类型 | 描述 | 示例 | 是否必填 |
task_id | 整数 (int) | 数据查询任务的 ID。 | 12345 | 是 |
响应
Key | 类型 | 描述 | 示例 | 是否必填 |
status | 字符串 (String) | 数据查询任务的状态。 | Created AnalysisFailed Processing Completed Cancelled Validating | 否 |
查看查询任务示例代码
示例
status = client.check_query_task_status(task_id)取消查询任务
查询参数
Key | 类型 | 描述 | 示例 | 是否必填 |
task_id | 整数 (int) | 数据查询任务的 ID。 | 12345 | 是 |
响应
Key | 类型 | 描述 | 示例 |
success | 布尔值 (Boolean) | 表示请求是否已成功取消。 | True |
取消查询任务示例代码
示例
result = client.cancel_query_task(task_id)获取查询任务结果
查询参数
Key | 类型 | 描述 | 示例 | 是否必填 |
task_id | 整数 (int) | 数据查询任务的 ID。 | 12345 | 是 |
响应
Key | 类型 | 描述 | 示例 |
result | 字符串 (String) | 查询返回的数据字段。接口将只返回此处列出的字段。 | id, video_id, text, parent_comment_id, like_count, reply_count, create_time |
获取查询任务示例代码
示例
data = client.get_query_task_result(task_id)通过 SDK 从 TikTok 查询视频评论数据
示例代码
from pyrqs import rqs
category = 'comment'
condition_groups = [
{
"operator": "and",
"conditions": [
{
"field": "video_id",
"operator": "eq",
"field_values": ["7347705421577563079"]
}
]
}
]
fields = 'id, video_id, text, parent_comment_id, like_count, reply_count, create_time'
limit = 100
client = rqs.RQSClient()
task_id = client.create_query_task(
category=category, condition_groups=condition_groups, fields=fields, limit=limit)
status = client.check_query_task_status(task_id)