# TikTok 关注列表 API (tiktok.following)

- Canonical page: https://everyinfra.com/tiktok-api/following
- Endpoint: POST /api/v1/social with {"platform": "tiktok", "action": "following", "params": {...}}
- Price: $0.000639 per call ($0.64 per 1,000 requests); failed and empty results are not charged
- Returns: list, one page of up to 20 per call; the number of rows varies from page to page and a short page is not the end (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page; no next_page_token means the end)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

TikTok 关注列表按 `username` 列出一个账号主动关注了哪些账号，每个带简介 `bio`、粉丝数、作品数、认证情况和地区 `country`。它回答「这个人在看谁」：一个达人关注的同行、合作品牌和团队成员，往往是发现同类账号、梳理行业圈子最快的线索，也能用来核实一个账号和某个机构或品牌的关系。

`username` 可以填 @短名、主页链接或 `sec_uid`；关注列表设为不公开时返回空列表，不算出错。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=tiktok&action=following

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | 要看关注列表的 TikTok 账号：@短名（如 zachking，可带 @）、主页链接 https://www.tiktok.com/@<短名>，或账号的 sec_uid（账号搜索、主页资料返回的那串长 ID）。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页；不传从第一页开始。令牌 24 小时有效，每页算一次调用。每页最多 20 个账号。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| user_id | 用户在原平台的唯一 ID。 |
| username | 用户名（@handle）。 |
| display_name | 显示名，可能与 username 不同。 |
| url | 该记录在原平台上的可访问链接。 |
| sec_uid | 账号的 secUid（user_search），TikTok 网页接口里长期不变的账号标识。 |
| bio | 个人简介，账号自己填写的文本。可能含换行和 emoji。 |
| follower_count | 粉丝数。null 表示不公开，不等于 0。 |
| following_count | 关注数。null 表示不公开，不等于 0。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| video_count | 视频数。 |
| is_verified | 是否为平台认证账号（蓝V等）。null 表示无法判定。 |
| verified_label | 认证说明（user_search），如 Verified account；没认证的没有这个字段。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| country | 国家或地区。可能是全称也可能是 ISO 代码，取决于平台，未归一。 |
| next_page_token | platform-native meaning |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "tiktok",
  "action": "following",
  "params": {
    "username": "nasa"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "tiktok",
        "action": "following",
        "params": {
            "username": "nasa",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "tiktok",
  "action": "following",
  "results": [
    {
      "user_id": …,
      "username": …,
      "display_name": …,
      "url": …,
      "sec_uid": …,
      "bio": …,
      "follower_count": …,
      "following_count": …,
      "like_count": …,
      "video_count": …,
      "is_verified": …,
      "verified_label": …,
      "avatar_url": …,
      "country": …,
      "next_page_token": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 为什么返回的是空列表？

多数是因为这个账号把关注列表设成了仅自己可见，平台不对外展示，接口拿到的也就是空的，这不算出错。也可能这个账号确实没有关注任何人，可以先读它的主页资料，看关注数是不是零。

### 能拿到一个账号的粉丝名单吗？

不能。这里列的是这个账号关注的人，方向和粉丝正好相反；TikTok 的粉丝能力只返回粉丝数量，不提供粉丝名单。想看谁在关注某个账号，只能从你已知的账号出发，逐个查它们的关注列表里有没有它。

### 怎么一层层扩展出行业圈子？

从一个种子账号的关注列表出发，按 `follower_count` 和 `is_verified` 挑出值得深挖的账号，再把它们的 `username` 或 `sec_uid` 传进来读第二层。按 `user_id` 去重，并给每一层设个数量上限，避免名单无限膨胀。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=tiktok
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
