# TikTok 账号搜索 API (tiktok.user_search)

- Canonical page: https://everyinfra.com/tiktok-api/user_search
- Endpoint: POST /api/v1/social with {"platform": "tiktok", "action": "user_search", "params": {...}}
- Price: $0.000556 per call ($0.56 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 账号搜索按 `keyword` 找相关的创作者和品牌号，顺序与 TikTok 站内搜索一致，每个账号带粉丝数、关注数、获赞数、作品数、认证标识，以及正在直播时的 `is_live`。它回答「这个领域有哪些账号值得关注」：达人营销团队用它从一个品类词出发建立候选名单，品牌方用它排查冒充官方的账号。

结果按搜索相关度排列，不是粉丝排行；需要按粉丝数筛选时，拿到结果后自己排序。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 要找的账号名、昵称或领域词，如 cooking；返回相关账号，不是排行。 |
| 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 网页接口里长期不变的账号标识。 |
| 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 链接，可能有时效。 |
| is_live | 账号此刻是否在直播（user_search）。 |
| 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": "user_search",
  "params": {
    "keyword": "coffee"
  }
}'
```

```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": "user_search",
        "params": {
            "keyword": "coffee",
        },
    },
    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": "user_search",
  "results": [
    {
      "user_id": …,
      "username": …,
      "display_name": …,
      "url": …,
      "sec_uid": …,
      "follower_count": …,
      "following_count": …,
      "like_count": …,
      "video_count": …,
      "is_verified": …,
      "verified_label": …,
      "avatar_url": …,
      "is_live": …,
      "next_page_token": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `username` 和 `sec_uid` 该存哪个？

两个都存。`username` 是主页 @ 后面的短名，好读，但账号可以改名；`sec_uid` 是长期不变的账号标识，改名后也能对上同一个人。需要长期跟踪的名单，以 `sec_uid` 作为主键更稳妥。

### 能只搜认证账号吗？

不能在请求里筛选，但每个结果都带 `is_verified`，认证类型写在 `verified_label` 里。拿到一页后在本地过滤即可；找品牌官方号时，这一项是分辨真假账号的第一道关。

### `like_count` 是这个账号的什么数？

`like_count` 是账号所有作品累计收到的点赞，`video_count` 是作品数，两者相除可以粗略估算平均每条作品的点赞。比较体量不同的账号时，这个比值比单看粉丝数更不容易被刷粉的账号误导。

## 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
