# 账号搜索接口

> 11 个平台的 11 个接口，用同一个 Account 对象返回账号搜索结果。按名称或关键词搜到的账号，结果来自平台自己的搜索，每个都带着后续查这个账号要用的 ID。每次 $0.0004 到 $0.058，各接口按自己的价格计费；失败的调用不扣费。

网页版：https://okdata.online/zh/roles/accounts-search/

## 各平台接口

| 平台 | 接口 | 路径 | 每页 | 价格 |
|---|---|---|---|---|
| 微信公众号 | [公众号搜索](https://okdata.online/zh/apis/wechat_mp/accounts/search/) | `GET /v1/wechat_mp/accounts/search` | 10 | $0.058/条 · 每次最多 $0.58 |
| Instagram | [Instagram 账号搜索](https://okdata.online/zh/apis/instagram/users/search/) | `GET /v1/instagram/users/search` | 20 | $0.002/次 · 每页约 20 个账号 |
| 快手 | [快手账号搜索](https://okdata.online/zh/apis/kuaishou/users/search/) | `GET /v1/kuaishou/users/search` | 20 | $0.02/次 · 每页约 20 个账号 |
| 知乎 | [知乎用户搜索](https://okdata.online/zh/apis/zhihu/users/search/)（即将上线） | `GET /v1/zhihu/users/search` | 20 | $0.002/次 · 每页约 20 个账号 |
| 微信视频号 | [视频号账号搜索](https://okdata.online/zh/apis/wechat_channels/users/search/) | `GET /v1/wechat_channels/users/search` | 1 | $0.02/次 · 每页约 1 个账号 |
| 抖音 | [抖音账号搜索](https://okdata.online/zh/apis/douyin/users/search/) | `GET /v1/douyin/users/search` | 30 | $0.002/次 · 每页约 30 个账号 |
| 小红书 | [小红书账号搜索](https://okdata.online/zh/apis/xiaohongshu/users/search/) | `GET /v1/xiaohongshu/users/search` | 20 | $0.02/次 · 每页约 20 个账号 |
| 微博 | [微博用户搜索](https://okdata.online/zh/apis/weibo/users/search/) | `GET /v1/weibo/users/search` | 20 | $0.002/次 · 每页约 20 个账号 |
| 微信搜一搜 | [微信公众号实时查找](https://okdata.online/zh/apis/wechat/accounts/search/) | `GET /v1/wechat/accounts/search` | 8 | $0.02/次 · 每页约 8 个账号 |
| TikTok | [TikTok 账号搜索](https://okdata.online/zh/apis/tiktok/users/search/) | `GET /v1/tiktok/users/search` | 30 | $0.002/次 · 每页约 30 个账号 |
| X（推特） | [X 账号搜索](https://okdata.online/zh/apis/x/users/search/) | `GET /v1/x/users/search` | 20 | $0.0004/条 · 每次最多 $0.008 |

## 返回的对象：[Account](https://okdata.online/zh/docs/objects/account/)

上面每个接口返回的字段名和类型都一样。平台不展示的字段返回 null，并在 meta.unavailable 里注明。

| 字段 | 类型 | 含义 |
|---|---|---|
| `id` | `string` | 账号在平台上的 ID。 |
| `url` | `string` | 主页链接。 |
| `username` | `string \| null` | 用户名（平台有的话）。 |
| `name` | `string` | 昵称。 |
| `bio` | `string \| null` | 简介。 |
| `avatar_url` | `string \| null` | 头像图片地址。 |
| `verified` | `boolean \| null` | 平台是否显示认证标识。 |
| `followers` | `integer \| null` | 粉丝数。 |
| `following` | `integer \| null` | 关注数。 |
| `posts` | `integer \| null` | 发布的作品、笔记或文章数。 |
| `likes` | `integer \| null` | 累计获赞（平台展示的话）。 |
| `ext` | `object` | 平台特有字段，只在 view=full 时返回。 |

## 两个平台上的同一个调用

参数一样、翻页方式一样、返回结构一样，只换路径。

```bash
# 微信公众号
curl -G "https://api.okdata.online/v1/wechat_mp/accounts/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=36氪'

# Instagram
curl -G "https://api.okdata.online/v1/instagram/users/search" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'query=nike'
```

## 常见用途

- 把一串品牌名变成可以跟踪的账号 ID。
- 先按关键词找出某个领域的账号，再看它们发的内容。
- 用公众号名称查出它的原始 ID。

## 常见问题

### 能按话题搜，还是只能按名称？

取决于平台自己的搜索。快手和公众号搜索可以用任意关键词；视频号搜索通常只返回名称最匹配的那一个账号，适合查你已经知道名字的号。

### 怎么计费？

这类接口大多按次计费。公众号搜索按返回的账号数计费，跑一长串名称之前，先看一下上表里的计费单位。

### 搜到之后做什么？

把每个账号的 id 存下来。传给账号信息接口拿粉丝数和简介，传给账号作品列表接口拿它发布过的内容。

## 其他数据类型

- [评论接口](https://okdata.online/zh/roles/posts-comments-list/)
- [热榜接口](https://okdata.online/zh/roles/trends-list/)
- [评论回复接口](https://okdata.online/zh/roles/comments-replies-list/)
- [话题内容接口](https://okdata.online/zh/roles/topics-posts-list/)
- [账号信息接口](https://okdata.online/zh/roles/accounts-get/)
- [账号作品列表接口](https://okdata.online/zh/roles/accounts-posts-list/)
- [内容详情接口](https://okdata.online/zh/roles/posts-get/)
- [内容搜索接口](https://okdata.online/zh/roles/posts-search/)
- [热门内容接口](https://okdata.online/zh/roles/posts-trending/)
- [内容数据接口](https://okdata.online/zh/roles/posts-metrics/)
- [社区帖子接口](https://okdata.online/zh/roles/communities-posts-list/)
- [广告详情接口](https://okdata.online/zh/roles/ads-get/)
- [广告主广告列表接口](https://okdata.online/zh/roles/advertisers-ads-list/)
- [广告搜索接口](https://okdata.online/zh/roles/ads-search/)
- [字幕接口](https://okdata.online/zh/roles/transcripts-get/)
- [粉丝列表接口](https://okdata.online/zh/roles/accounts-followers-list/)
- [商品详情接口](https://okdata.online/zh/roles/products-get/)
- [商品评价接口](https://okdata.online/zh/roles/products-reviews-list/)
- [商品搜索接口](https://okdata.online/zh/roles/products-search/)
- [达人搜索接口](https://okdata.online/zh/roles/creators-search/)
- [达人详情接口](https://okdata.online/zh/roles/creators-get/)
- [达人粉丝画像接口](https://okdata.online/zh/roles/creators-audience-get/)
