查询用户信息
创建查询任务
查询
查询参数
Key | 类型 | 描述 | 示例 | 是否必填 |
category | 字符串 (String) | 需要分析的数据类别。 | profile | 是 |
condition_groups | 对象 (Object) | 指定要返回和处理的数据。 | | 是 |
fields | 字符串 (String) | 需返回的数据字段。接口将只返回此处列出的字段。 | username | 是 |
limit | 整数 (int) | 返回的最大记录数。 测试阶段 默认值为 100。 执行阶段 默认值为 1000。 | 200 | 否 |
bio_url | 字符串 (String) | 用户个人简介 URL。 |
|
查询条件
Key | 类型 | 描述 | 是否必填 |
and | list<Condition> |
| 否 |
or | list<Condition> |
| 否 |
not | list<Condition> |
| 否 |
查询条件字段和运算符
字段 | 描述 | 类型 | 允许的运算符 |
username | TikTok 唯一用户名。 | 字符串 (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) | 查询返回的数据字段。接口将只返回此处列出的字段。 | display_name, bio_description, avatar_url, is_verified, follower_count, following_count, likes_count, video_count, bio_url |
获取查询任务示例代码
示例
data = client.get_query_task_result(task_id)通过 SDK 从 TikTok 查询主页数据
示例代码
from pyrqs import rqs
category = 'profile'
condition_groups = [
{
"operator": "and",
"conditions": [
{
"field": "username",
"operator": "eq",
"field_values": ["test user"]
}
]
}
]
fields = 'username'
limit = 1000
client = rqs.RQSClient()
data = client.query(category=category, condition_groups=condition_groups, fields=fields, limit=limit)