---
title: "抖音用户搜索 API (V2)"
description: "按关键词搜索抖音用户，支持基于页面的分页和可选的账号类型筛选。用于发现创作者、品牌或认证账号进行研究。"
aiUsagePrompt: true
---

# 抖音用户搜索 API \(V2\)

<ApiTester
  method="GET"
  :path='JSON.parse("\"/api/douyin/search-user/v2\"")'
  :summary='JSON.parse("\"用户搜索 (V2)\"")'
  openapiDefinitionUrl="https://docs.justoneapi.com/openapi/douyin-tiktok-china/user-search-v2-zh.json"
  openapiVersion="3.1.0"
  :parameters='JSON.parse("[{\"name\":\"token\",\"in\":\"query\",\"description\":\"此 API 服务的访问令牌。\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"keyword\",\"in\":\"query\",\"description\":\"搜索关键词。\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"page\",\"in\":\"query\",\"description\":\"页码（从1开始）。\",\"required\":false,\"schema\":{\"type\":\"integer\",\"format\":\"int32\",\"default\":1}},{\"name\":\"userType\",\"in\":\"query\",\"description\":\"按用户类型筛选。\\n\\n可用值：\\n- `common_user`: 普通用户\\n- `enterprise_user`: 企业用户\\n- `personal_user`: 已认证个人用户\",\"required\":false,\"schema\":{\"type\":\"string\",\"description\":\"按用户类型筛选。\",\"enum\":[\"common_user\",\"enterprise_user\",\"personal_user\"]}}]")'
  :requestBody='JSON.parse("null")'
  :responses='JSON.parse("{\"200\":{\"description\":\"好的\",\"content\":{\"application/json\":{\"schema\":{\"if\":{\"properties\":{\"code\":{\"const\":0}},\"required\":[\"code\"]},\"then\":{\"properties\":{\"data\":{\"type\":\"object\",\"description\":\"抖音账号搜索的一页结果。\",\"properties\":{\"business_data\":{\"type\":\"array\",\"description\":\"当前页的搜索结果卡片，可能包含账号资料或仅用于展示的内容。账号结果可能跨页重复。\",\"items\":{\"type\":\"object\",\"description\":\"搜索结果中的一张卡片。\",\"properties\":{\"data_id\":{\"type\":\"string\",\"description\":\"将这张卡片关联到结果条目的文本标识。\"},\"card_id\":{\"type\":\"string\",\"description\":\"搜索结果返回的卡片标识。\"},\"type\":{\"type\":\"integer\",\"description\":\"搜索结果返回的数值型卡片类型代码。\"},\"data\":{\"type\":\"object\",\"description\":\"这张结果卡片携带的数据。\",\"properties\":{\"raw_data\":{\"type\":\"string\",\"contentMediaType\":\"application/json\",\"contentSchema\":{\"type\":\"object\",\"description\":\"结果 JSON 字符串解析后的内容。\",\"properties\":{\"user_info\":{\"type\":\"object\",\"description\":\"用户结果返回的抖音公开账号资料。\",\"properties\":{\"uid\":{\"type\":\"string\",\"description\":\"抖音账号 ID，以文本返回。跨页合并账号结果时可用它去重。\"},\"sec_uid\":{\"type\":\"string\",\"description\":\"抖音个人主页链接使用的公开账号标识。\"},\"unique_id\":{\"type\":\"string\",\"description\":\"这个账号返回的抖音号。\"},\"nickname\":{\"type\":\"string\",\"description\":\"账号展示名称。\"},\"follower_count\":{\"type\":\"integer\",\"description\":\"这个账号返回的粉丝数。\"},\"verification_type\":{\"type\":\"integer\",\"description\":\"账号返回的数值型认证类型代码。\"},\"enterprise_verify_reason\":{\"type\":\"string\",\"description\":\"展示的企业认证说明，可能为空。\"},\"account_cert_info\":{\"type\":\"string\",\"contentMediaType\":\"application/json\",\"contentSchema\":{\"type\":\"object\",\"description\":\"解析后的认证标识资料，可能为空对象。\",\"properties\":{\"label_style\":{\"type\":\"integer\",\"description\":\"认证标识返回的数值型展示样式代码。\"},\"label_text\":{\"type\":\"string\",\"description\":\"认证标识上展示的文本。\"},\"is_biz_account\":{\"type\":\"integer\",\"description\":\"认证标识附带的数值型企业账号标记。\"}}},\"description\":\"可选的认证标识资料，以 JSON 字符串返回，需再次解析。\"},\"is_star\":{\"type\":\"boolean\",\"description\":\"是否带有明星账号标记。\"},\"live_status\":{\"type\":\"integer\",\"description\":\"账号返回的数值型直播状态代码。\"},\"avatar_thumb\":{\"type\":\"object\",\"description\":\"头像缩略图版本。\",\"properties\":{\"uri\":{\"type\":\"string\",\"description\":\"头像资源在平台中的标识。\"},\"url_list\":{\"type\":\"array\",\"description\":\"这一尺寸版本返回的头像链接列表。\",\"items\":{\"type\":\"string\",\"description\":\"一个头像链接。\"}},\"width\":{\"type\":\"integer\",\"description\":\"回包报告的头像宽度，单位为像素。\"},\"height\":{\"type\":\"integer\",\"description\":\"回包报告的头像高度，单位为像素。\"}}},\"avatar_medium\":{\"type\":\"object\",\"description\":\"中等尺寸的头像版本。\",\"properties\":{\"uri\":{\"type\":\"string\",\"description\":\"头像资源在平台中的标识。\"},\"url_list\":{\"type\":\"array\",\"description\":\"这一尺寸版本返回的头像链接列表。\",\"items\":{\"type\":\"string\",\"description\":\"一个头像链接。\"}},\"width\":{\"type\":\"integer\",\"description\":\"回包报告的头像宽度，单位为像素。\"},\"height\":{\"type\":\"integer\",\"description\":\"回包报告的头像高度，单位为像素。\"}}},\"avatar_larger\":{\"type\":\"object\",\"description\":\"大尺寸的头像版本。\",\"properties\":{\"uri\":{\"type\":\"string\",\"description\":\"头像资源在平台中的标识。\"},\"url_list\":{\"type\":\"array\",\"description\":\"这一尺寸版本返回的头像链接列表。\",\"items\":{\"type\":\"string\",\"description\":\"一个头像链接。\"}},\"width\":{\"type\":\"integer\",\"description\":\"回包报告的头像宽度，单位为像素。\"},\"height\":{\"type\":\"integer\",\"description\":\"回包报告的头像高度，单位为像素。\"}}},\"versatile_display\":{\"type\":\"string\",\"description\":\"账号附带的展示文本。\"},\"display_info\":{\"type\":\"array\",\"description\":\"随账号结果展示的说明条目。\",\"items\":{\"type\":\"object\",\"description\":\"一条展示说明。\",\"properties\":{\"title\":{\"type\":\"string\",\"description\":\"这条展示说明的标题。\"},\"text\":{\"type\":\"string\",\"description\":\"这条展示说明的文本。\"},\"tag\":{\"type\":\"array\",\"description\":\"这条展示说明上的标签。\",\"items\":{\"type\":\"object\",\"description\":\"展示说明中的一个标签。\",\"properties\":{\"type\":{\"type\":\"string\",\"description\":\"这个标签的文本类型。\"},\"description\":{\"type\":\"string\",\"description\":\"这个标签的显示描述。\"},\"icon_url\":{\"type\":\"string\",\"description\":\"标签图标链接，可能为空。\"}}}}}}},\"user_tags\":{\"type\":\"array\",\"description\":\"这个账号返回的标签。\",\"items\":{\"type\":\"object\",\"description\":\"一个账号标签。\",\"properties\":{\"type\":{\"type\":\"string\",\"description\":\"这个标签的文本类型。\"},\"description\":{\"type\":\"string\",\"description\":\"这个标签的显示描述。\"},\"icon_url\":{\"type\":\"string\",\"description\":\"标签图标链接，可能为空。\"}}}}}},\"display\":{\"type\":\"object\",\"description\":\"没有账号资料的结果可以带有此展示内容。\",\"properties\":{\"card_rank\":{\"type\":\"integer\",\"description\":\"这张展示卡片返回的排序位置。\"},\"is_last_item\":{\"type\":\"integer\",\"description\":\"这张展示卡片返回的数值型末项标记。\"},\"feedback\":{\"type\":\"object\",\"description\":\"展示卡片附带的反馈信息。\"}}}}},\"description\":\"以 JSON 字符串返回的结果数据，需先解析。仅用于展示的卡片可能没有 user_info。\"}}}}}},\"business_config\":{\"type\":\"object\",\"description\":\"当前结果页返回的查询及分页信息。\",\"properties\":{\"keyword\":{\"type\":\"string\",\"description\":\"当前页返回的搜索关键词。\"},\"card_count\":{\"type\":\"integer\",\"description\":\"当前页返回的结果卡片数量。\"},\"has_more\":{\"type\":\"integer\",\"description\":\"分页标记。1 表示还可以翻页，0 表示结束。\"},\"next_page\":{\"type\":\"object\",\"description\":\"附带的分页信息。继续查询时递增请求参数 page。\",\"properties\":{\"cursor\":{\"type\":\"integer\",\"description\":\"回包中报告的分页位置。\"},\"keyword\":{\"type\":\"string\",\"description\":\"分页信息中附带的关键词。\"}}}}},\"status_code\":{\"type\":\"integer\",\"description\":\"搜索回包的内部状态代码。\"},\"success\":{\"type\":\"boolean\",\"description\":\"搜索数据中报告的成功标记。\"}}}}},\"allOf\":[{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}]}}}},\"400\":{\"description\":\"请求参数或请求体无效\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"401\":{\"description\":\"访问令牌无效或未激活\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"403\":{\"description\":\"权限不足\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"429\":{\"description\":\"请求速率或每日配额已超限\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"500\":{\"description\":\"服务器内部错误\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}},\"503\":{\"description\":\"服务暂时不可用\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"enum\":[0,100,101,202,300,301,302,303,400,404,500,503,600,601,602]},\"message\":{\"type\":[\"string\",\"null\"]},\"data\":{},\"recordTime\":{\"type\":[\"string\",\"null\"]},\"requestId\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"requestParams\":{\"type\":\"object\",\"properties\":{\"query\":{\"type\":\"object\",\"additionalProperties\":{\"type\":\"object\"}},\"body\":{\"type\":\"object\",\"properties\":{\"empty\":{\"type\":\"boolean\"},\"array\":{\"type\":\"boolean\"},\"null\":{\"type\":\"boolean\"},\"object\":{\"type\":\"boolean\"},\"float\":{\"type\":\"boolean\"},\"container\":{\"type\":\"boolean\"},\"valueNode\":{\"type\":\"boolean\"},\"integralNumber\":{\"type\":\"boolean\"},\"floatingPointNumber\":{\"type\":\"boolean\"},\"missingNode\":{\"type\":\"boolean\"},\"boolean\":{\"type\":\"boolean\"},\"binary\":{\"type\":\"boolean\"},\"nodeType\":{\"type\":\"string\",\"enum\":[\"ARRAY\",\"BINARY\",\"BOOLEAN\",\"MISSING\",\"NULL\",\"NUMBER\",\"OBJECT\",\"POJO\",\"STRING\"]},\"string\":{\"type\":\"boolean\"},\"pojo\":{\"type\":\"boolean\"},\"short\":{\"type\":\"boolean\"},\"int\":{\"type\":\"boolean\"},\"long\":{\"type\":\"boolean\"},\"double\":{\"type\":\"boolean\"},\"bigDecimal\":{\"type\":\"boolean\"},\"bigInteger\":{\"type\":\"boolean\"},\"textual\":{\"type\":\"boolean\",\"deprecated\":true},\"number\":{\"type\":\"boolean\"},\"embeddedValue\":{\"type\":\"boolean\"}}}}}},\"required\":[\"code\",\"data\",\"message\",\"recordTime\"]}}}}}")'
  :servers='JSON.parse("[{\"url\":\"https://api.justoneapi.com\",\"description\":\"全球生产 API（默认）\"}]")'
  :security='JSON.parse("[]")'
  :securitySchemes='JSON.parse("{}")'
  :schemas='JSON.parse("{}")'
/>

<ApiHealthSection :api='JSON.parse("\"/api/douyin/search-user/v2\"")' />

<p>按关键词搜索抖音用户，支持基于页面的分页和可选的账号类型筛选。用于发现创作者、品牌或认证账号进行研究。</p>

## 请求参数

<div class="api-doc-table api-doc-table--params">

| 参数名 | 位置 | 类型 | 必填 | 默认值 | 说明 |
| --- | --- | --- | --- | --- | --- |
| <code>token</code> | query | <code>string</code> | 是 | - | 此 API 服务的访问令牌。 |
| <code>keyword</code> | query | <code>string</code> | 是 | - | 搜索关键词。 |
| <code>page</code> | query | <code>integer</code> | 否 | <code>1</code> | 页码（从1开始）。 |
| <code>userType</code> | query | <code>string</code> | 否 | - | 按用户类型筛选。<br /><br><br>可用值：<br /><br>- <code>common_user</code>: 普通用户<br /><br>- <code>enterprise_user</code>: 企业用户<br /><br>- <code>personal_user</code>: 已认证个人用户 |

</div>

## 代码示例

::: code-group

```bash [🐚 cURL]
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE'
```

```text [🤖 AI 提示词]
我想使用 JustOneAPI 提供的“用户搜索 (V2)”接口。
接入地址: https://api.justoneapi.com。
接口路径: /api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE
接口地址: BASE_URL + /api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE
HTTP 方法: GET
身份验证: 在 URL 中传入 token 查询参数。
OpenAPI 定义: https://docs.justoneapi.com/openapi/douyin-tiktok-china/user-search-v2-zh.json

请求参数说明:
- token (query): 此 API 服务的访问令牌。 (必填)
- keyword (query): 搜索关键词。 (必填)
- page (query): 页码（从1开始）。
- userType (query): 按用户类型筛选。

可用值：
- `common_user`: 普通用户
- `enterprise_user`: 企业用户
- `personal_user`: 已认证个人用户

返回格式: 请根据实际 Content-Type 安全处理 JSON 或文本响应。

响应处理与错误码：
1. 需通过返回体中的 "code" 字段判断业务结果（code 为 0 表示成功）。
2. 超时建议：建议将请求超时时间设置为 120 秒；如果 120 秒偏长，请至少设置为 60 秒，但可能会有少量请求因超时而未接收到结果。
3. 业务码说明：
   - 0: 成功
   - 100: Token 无效或已失效
   - 301: 采集失败，请重试
   - 302: 超出速率限制
   - 303: 超出每日配额
   - 400: 参数错误
   - 500: 内部服务器错误
   - 600: 权限不足
   - 601: 账户余额不足
   - 602: TOKEN 限额超限
4. code 601 表示账户共享余额不足。code 602 表示当前 API TOKEN 自身的累计消费上限已达到。TOKEN 限额不是资金划拨，多个 TOKEN 仍共享同一个账户余额。

请帮我用我擅长的编程语言写一个脚本来调用这个接口，并处理返回结果。
```

```python [🐍 Python]
import requests

BASE_URL = "https://api.justoneapi.com"  # 由 OpenAPI servers 提供

url = BASE_URL + "/api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
    content_type = response.headers.get("content-type", "").lower()
    if "json" in content_type:
        try:
            print(response.json())
        except ValueError:
            print(response.text)
    elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
        print(response.text)
    else:
        with open("response.bin", "wb") as output:
            output.write(response.content)
        print(f"Saved {len(response.content)} bytes to response.bin")
```

```js [🌐 JavaScript]
const BASE_URL = "https://api.justoneapi.com"; // 由 OpenAPI servers 提供
const url = BASE_URL + "/api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE";

const response = await fetch(url, {
  method: "GET",
  signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
  const contentType = (response.headers.get("content-type") || "").toLowerCase();
  const mediaType = contentType.split(";", 1)[0].trim();
  const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
  if (textual) {
    const responseText = new TextDecoder().decode(responseBytes);
    let data = responseText;
    if (contentType.includes("json")) {
      try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
    }
    console.log(data);
  } else {
    console.log(`Received ${responseBytes.byteLength} binary bytes`);
  }
}
```

```java [☕ Java]
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    public static void main(String[] args) throws Exception {
        final String BASE_URL = "https://api.justoneapi.com"; // 由 OpenAPI servers 提供
        final String url = BASE_URL + "/api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE";

        HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
        HttpRequest.Builder builder = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .timeout(Duration.ofSeconds(120))
            .method("GET", HttpRequest.BodyPublishers.noBody());

        HttpRequest request = builder.build();

        HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
        System.out.println(response.statusCode());
        String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
        String mediaType = contentType.split(";", 2)[0].trim();
        if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
            System.out.println(new String(response.body(), StandardCharsets.UTF_8));
        } else {
            Files.write(Path.of("response.bin"), response.body());
            System.out.println("Saved " + response.body().length + " bytes to response.bin");
        }
    }
}
```

```go [🐹 Go]
package main

import (
	"fmt"
	"io"
	"os"
	"strings"
	"net/http"
	"time"
)

const BASE_URL = "https://api.justoneapi.com" // 由 OpenAPI servers 提供

func main() {
	client := &http.Client{Timeout: 120 * time.Second}
	url := BASE_URL + "/api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE"
	req, _ := http.NewRequest("GET", url, nil)
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	fmt.Println(resp.StatusCode)
	bodyBytes, _ := io.ReadAll(resp.Body)
	contentType := strings.ToLower(resp.Header.Get("Content-Type"))
	mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
	if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
		fmt.Println(string(bodyBytes))
	} else {
		os.WriteFile("response.bin", bodyBytes, 0600)
		fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
	}
}
```

```php [🐘 PHP]
<?php
$BASE_URL = 'https://api.justoneapi.com'; // 由 OpenAPI servers 提供
$url = $BASE_URL . '/api/douyin/search-user/v2?token=YOUR_API_KEY&keyword=VALUE';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
    echo $response;
} else {
    file_put_contents('response.bin', $response);
    echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}
```

:::

<div style="text-align: right; margin-top: -20px; margin-bottom: 20px;">
<a href="/openapi/douyin-tiktok-china/user-search-v2-zh.json" target="_blank" style="font-size: 12px; color: var(--vp-c-text-3); text-decoration: none; opacity: 0.8;">[OpenAPI 定义 (JSON)]</a>
</div>

## 返回字段

业务成功时（`code = 0`）的主要返回字段。

<div class="api-doc-table api-doc-table--response">

| 字段路径 | 类型 | 说明 |
| --- | --- | --- |
| <code>data</code> | <code>object</code> | 抖音账号搜索的一页结果。 |
| <code>data.business_data</code> | <code>array</code> | 当前页的搜索结果卡片，可能包含账号资料或仅用于展示的内容。账号结果可能跨页重复。 |
| <code>data.business_data[]</code> | <code>object</code> | 搜索结果中的一张卡片。 |
| <code>data.business_data[].data_id</code> | <code>string</code> | 将这张卡片关联到结果条目的文本标识。 |
| <code>data.business_data[].card_id</code> | <code>string</code> | 搜索结果返回的卡片标识。 |
| <code>data.business_data[].type</code> | <code>integer</code> | 搜索结果返回的数值型卡片类型代码。 |
| <code>data.business_data[].data</code> | <code>object</code> | 这张结果卡片携带的数据。 |
| <code>data.business_data[].data.raw_data</code> | <code>string</code> | 以 JSON 字符串返回的结果数据，需先解析。仅用于展示的卡片可能没有 user_info。 |
| <code>data.business_data[].data.raw_data (JSON)</code> | <code>object</code> | 结果 JSON 字符串解析后的内容。 |
| <code>data.business_data[].data.raw_data (JSON).user_info</code> | <code>object</code> | 用户结果返回的抖音公开账号资料。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.uid</code> | <code>string</code> | 抖音账号 ID，以文本返回。跨页合并账号结果时可用它去重。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.sec_uid</code> | <code>string</code> | 抖音个人主页链接使用的公开账号标识。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.unique_id</code> | <code>string</code> | 这个账号返回的抖音号。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.nickname</code> | <code>string</code> | 账号展示名称。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.follower_count</code> | <code>integer</code> | 这个账号返回的粉丝数。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.verification_type</code> | <code>integer</code> | 账号返回的数值型认证类型代码。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.enterprise_verify_reason</code> | <code>string</code> | 展示的企业认证说明，可能为空。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.account_cert_info</code> | <code>string</code> | 可选的认证标识资料，以 JSON 字符串返回，需再次解析。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.account_cert_info (JSON)</code> | <code>object</code> | 解析后的认证标识资料，可能为空对象。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.account_cert_info (JSON).label_style</code> | <code>integer</code> | 认证标识返回的数值型展示样式代码。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.account_cert_info (JSON).label_text</code> | <code>string</code> | 认证标识上展示的文本。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.account_cert_info (JSON).is_biz_account</code> | <code>integer</code> | 认证标识附带的数值型企业账号标记。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.is_star</code> | <code>boolean</code> | 是否带有明星账号标记。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.live_status</code> | <code>integer</code> | 账号返回的数值型直播状态代码。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_thumb</code> | <code>object</code> | 头像缩略图版本。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_thumb.uri</code> | <code>string</code> | 头像资源在平台中的标识。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_thumb.url_list</code> | <code>array</code> | 这一尺寸版本返回的头像链接列表。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_thumb.url_list[]</code> | <code>string</code> | 一个头像链接。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_thumb.width</code> | <code>integer</code> | 回包报告的头像宽度，单位为像素。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_thumb.height</code> | <code>integer</code> | 回包报告的头像高度，单位为像素。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_medium</code> | <code>object</code> | 中等尺寸的头像版本。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_medium.uri</code> | <code>string</code> | 头像资源在平台中的标识。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_medium.url_list</code> | <code>array</code> | 这一尺寸版本返回的头像链接列表。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_medium.url_list[]</code> | <code>string</code> | 一个头像链接。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_medium.width</code> | <code>integer</code> | 回包报告的头像宽度，单位为像素。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_medium.height</code> | <code>integer</code> | 回包报告的头像高度，单位为像素。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_larger</code> | <code>object</code> | 大尺寸的头像版本。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_larger.uri</code> | <code>string</code> | 头像资源在平台中的标识。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_larger.url_list</code> | <code>array</code> | 这一尺寸版本返回的头像链接列表。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_larger.url_list[]</code> | <code>string</code> | 一个头像链接。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_larger.width</code> | <code>integer</code> | 回包报告的头像宽度，单位为像素。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.avatar_larger.height</code> | <code>integer</code> | 回包报告的头像高度，单位为像素。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.versatile_display</code> | <code>string</code> | 账号附带的展示文本。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info</code> | <code>array</code> | 随账号结果展示的说明条目。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[]</code> | <code>object</code> | 一条展示说明。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[].title</code> | <code>string</code> | 这条展示说明的标题。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[].text</code> | <code>string</code> | 这条展示说明的文本。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[].tag</code> | <code>array</code> | 这条展示说明上的标签。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[].tag[]</code> | <code>object</code> | 展示说明中的一个标签。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[].tag[].type</code> | <code>string</code> | 这个标签的文本类型。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[].tag[].description</code> | <code>string</code> | 这个标签的显示描述。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.display_info[].tag[].icon_url</code> | <code>string</code> | 标签图标链接，可能为空。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.user_tags</code> | <code>array</code> | 这个账号返回的标签。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.user_tags[]</code> | <code>object</code> | 一个账号标签。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.user_tags[].type</code> | <code>string</code> | 这个标签的文本类型。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.user_tags[].description</code> | <code>string</code> | 这个标签的显示描述。 |
| <code>data.business_data[].data.raw_data (JSON).user_info.user_tags[].icon_url</code> | <code>string</code> | 标签图标链接，可能为空。 |
| <code>data.business_data[].data.raw_data (JSON).display</code> | <code>object</code> | 没有账号资料的结果可以带有此展示内容。 |
| <code>data.business_data[].data.raw_data (JSON).display.card_rank</code> | <code>integer</code> | 这张展示卡片返回的排序位置。 |
| <code>data.business_data[].data.raw_data (JSON).display.is_last_item</code> | <code>integer</code> | 这张展示卡片返回的数值型末项标记。 |
| <code>data.business_data[].data.raw_data (JSON).display.feedback</code> | <code>object</code> | 展示卡片附带的反馈信息。 |
| <code>data.business_config</code> | <code>object</code> | 当前结果页返回的查询及分页信息。 |
| <code>data.business_config.keyword</code> | <code>string</code> | 当前页返回的搜索关键词。 |
| <code>data.business_config.card_count</code> | <code>integer</code> | 当前页返回的结果卡片数量。 |
| <code>data.business_config.has_more</code> | <code>integer</code> | 分页标记。1 表示还可以翻页，0 表示结束。 |
| <code>data.business_config.next_page</code> | <code>object</code> | 附带的分页信息。继续查询时递增请求参数 page。 |
| <code>data.business_config.next_page.cursor</code> | <code>integer</code> | 回包中报告的分页位置。 |
| <code>data.business_config.next_page.keyword</code> | <code>string</code> | 分页信息中附带的关键词。 |
| <code>data.status_code</code> | <code>integer</code> | 搜索回包的内部状态代码。 |
| <code>data.success</code> | <code>boolean</code> | 搜索数据中报告的成功标记。 |

</div>

## 响应示例

<ApiExampleSection :api='JSON.parse("\"/api/douyin/search-user/v2\"")' />

