查询播放列表信息
创建查询任务
查询
查询参数
Key | 类型 | 描述 | 示例 | 是否必填 |
category | 字符串 (String) | 需要分析的数据类别。 | playlists | 是 |
condition_groups | 对象 (Object) | 指定要返回和处理的数据。 注意:playlist_id 是唯一可查询的参数。eq 是唯一运算符。 | condition_groups = [ { "operator": "and", "conditions": [ { "field": "playlist_id", "operator": "eq", "field_values": ["7145179763387255595"] } ] } ] | 否 |
fields | 字符串 (String) | 需返回的数据字段。接口将只返回此处列出的字段。 | playlist_id、playlist_name、playlist_video_ids、playlist_last_updated 和 playlist_item_total | 否 |
limit | 整数 (int) | 返回的最大记录数。 测试阶段 默认值为 100。 执行阶段 默认值为 1000。 | 200 | 否 |
查询条件
Key | 类型 | 描述 | 是否必填 |
and | list<Condition> |
| 否 |
or | list<Condition> |
| 否 |
not | list<Condition> |
| 否 |
响应
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) | 查询任务返回的数据字段。接口将只返回此处列出的字段。 | playlist_id、playlist_name、playlist_video_ids、playlist_last_updated 和 playlist_item_total. |
获取查询任务示例代码
示例
data = client.get_query_task_result(task_id)通过 SDK 从 TikTok 查询播放列表
示例代码
from pyrqs import rqs
import time
from datetime import datetime, timedelta
import json
category = 'playlists'
fields = 'playlist_id, playlist_name, playlist_video_ids, playlist_last_updated, playlist_item_total'
limit = 60
client = rqs.RQSClient()
condition_groups = [
{
"operator": "and",
"conditions": [
{
"field": "playlist_id",
"operator": "EQ",
"field_values": ["7145179763387255595"]
}
]
}
]
data = client.query(category=category, fields = fields, condition_groups=condition_groups, limit=limit)
print(data)