从用户名推断性别 · 多个请求

分析多个用户名

提取潜在姓名并预测最多50个账号的性别,包含国家和记录上下文。

POSThttps://api.genderapi.io/api/username/multi/country

批量请求概览

处理最多50个用户名

发送一个data数组。GenderAPI 会从每个用户名中提取潜在的名称信号,并返回带有您可选记录的结果id.

MethodPOST
Maximum50 个用户名
AuthenticationBearer 认证令牌
AI 选项不支持
批量用户名结果需要仔细审核。

用户名可能包含品牌、幻想词汇或无关词语。批量请求不接受askToAI or forceToGenderize. 为更可靠地处理异常输入,使用单次请求.

HDR

所需的HTTP头

授权批量请求

Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY

JSON请求体

参数

FieldTypeRequirementDescription
dataobject[]必填包含 1 到 50 个用户名记录的数组。
data[].usernamestring必填要分析的用户名或账号;支持下划线和数字。
data[].countrystring可选作为区域上下文使用的 ISO 3166-1 alpha-2 国家代码。
data[].idstring | integer可选您的标识符,将以原样形式返回对应结果。
输入指导

拉丁字符用户名通常能提供更清晰的名称信号。使用唯一值并在更新记录前进行评估。id提取的name and probability值

请求体

构建用户名数组

JSON
{
  "data": [
    { "username": "anna_smith88", "country": "US", "id": "123" },
    { "username": "michael_bauer", "country": "DE", "id": "456" },
    { "username": "giulia_rossi", "country": "IT", "id": "789" }
  ]
}

代码示例

发送多个用户名请求

cURL
curl -X POST "https://api.genderapi.io/api/username/multi/country" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"data":[{"username":"anna_smith88","country":"US","id":"123"},{"username":"michael_bauer","country":"DE","id":"456"}]}'
JavaScript
const data = [
  { username: "anna_smith88", country: "US", id: "123" },
  { username: "michael_bauer", country: "DE", id: "456" }
];
const response = await fetch("https://api.genderapi.io/api/username/multi/country", {
  method: "POST", headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" },
  body: JSON.stringify({ data })
});

200 响应

提取的姓名和预测结果

JSON
{
  "status": true, "used_credits": 3, "remaining_credits": 7265, "expires": 1717069765,
  "names": [
    { "name": "Anna", "q": "anna_smith88", "gender": "female", "country": "US", "total_names": 1234, "probability": 92, "id": "123" },
    { "name": "Michael", "q": "michael_bauer", "gender": "male", "country": "DE", "total_names": 5678, "probability": 89, "id": "456" }
  ], "duration": "5ms"
}

响应字段

FieldTypeDescription
statusboolean批量请求是否成功完成。
used_creditsinteger提交的用户名所消耗的信用额度。
remaining_creditsinteger请求后剩余的信用额度。
expiresinteger包的过期时间,以UNIX时间戳表示。
namesobject[]提交用户名的查询结果。
names[].namestring从用户名中提取的潜在姓名。
names[].qstring请求中提交的原始用户名。
names[].genderstring | null预测值:男、女或空值。
names[].countrystring本结果所考虑的国家代码。
names[].total_namesinteger支持该结果的样本数量。
names[].probabilityinteger预测置信度,以百分比表示。
names[].idstring | integer用于记录关联的输入标识符。
durationstring服务器处理总时间。

每个请求限制在50条记录内

将较大的输入拆分为批次。用户名是间接信号,因此需验证提取的姓名,并建立可接受的概率阈值后再应用结果。

下一个参考

验证并格式化电话号码

电话号码验证审查验证和格式化方法 →Username 单次请求Use AI 选项 for one handle →