查询用户关注列表
请求
HTTP URL | https://open.tiktokapis.com/v2/research/user/following/ |
HTTP 请求方法 | POST |
权限范围 | research.data.basic (必要权限) |
请求头
Key | 类型 | 描述 | 示例 | 是否必填 |
Authorization | 字符串 (String) | 通过 /v2/oauth/token/ 获取的客户端访问令牌。 | Bearer clt.example12345Example12345Example | 是 |
Content-Type | 字符串 (String) | 资源的原始媒体类型。 | application/json | 是 |
请求体
Key | 类型 | 描述 | 示例值 | 是否必填 |
username | 字符串 (String) | 用作用户唯一标识符的用户名。 | "test_username" | 是 |
max_count | int64 | 单次响应中返回的该用户关注账号的最大数量。默认值为 20,最大值为 100。 | 100 | 否 |
cursor | int64 | 返回用户在此时间及之前关注的账号。该参数值是一个 UTC Unix 时间戳(单位:秒)。默认值为发出此请求时的时间戳。 | 1706833705 | 否 |
示例
curl --location 'https://open-platform.tiktokapis.com/v2/research/user/following/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer clt.test123temp123test123test123' \
--data '{
"username": "test_user",
"max_count":3,
"cursor": 1685544251
}'响应
响应体
Key | 类型 | 描述 |
data | UserFollowingData | 该用户关注的账号列表。 |
error | ErrorStructV2 | Error 对象。 |
UserFollowingData
Key | 类型 | 描述 |
user_following | list<UserInfo> | 查询到的该用户关注的账号信息列表。 |
cursor | int64 | 返回用户在此时间及之前关注的账号。该参数值是一个 UTC Unix 时间戳(单位:秒)。默认值为发出此请求时的时间戳。 |
has_more | 布尔值 (Boolean) | 该用户是否关注了更多账号。 |
User Info 对象
字段 | 类型 | 描述 |
"display_name" | 字符串 (String) | 用户关注账号的主页名称。 |
"username" | 字符串 (String) | 用户关注账号的用户名。 |
示例
{
"data": {
"has_more": true,
"user_following": [
{
"display_name": "test user",
"username": "test_username"
},
{
"display_name": "test user 2",
"username": "test_username2"
},
{
"display_name": "test user 3",
"username": "test_username3"
}
],
"cursor": 1650642422
},
"error": {
"code": "ok",
"message": "ok",
"log_id": "202499999999999999999999999999999"
}
}