从邮箱推断性别 · 多个请求

一次请求分析多个邮箱

提取姓名并预测最多50个邮箱地址的性别,可选国家和记录ID。

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

批量请求概览

处理最多50个邮箱地址

发送一个data数组。GenderAPI 从每个地址中提取一个可能的姓名并返回匹配的预测;您的可选id使数据库关联确定性。

MethodPOST
Maximum50 个邮箱
AuthenticationBearer Token
结果格式names[]
HDR

所需的HTTP头信息

授权批量请求

Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY

JSON请求体

参数

FieldTypeRequirementDescription
dataobject[]必填包含1到50个邮件记录的数组。
data[].emailstring必填GenderAPI提取可能的姓氏的邮箱地址。
data[].countrystring可选作为区域上下文使用的ISO 3166-1 alpha-2国家代码。
data[].idstring | integer可选您的记录标识符,与对应结果一起原样返回。
记录匹配

使用唯一id每个项目,GenderAPI 都会返回该项目的结果,使您可以更新正确的数据库记录,而无需仅依赖数组位置。

请求数据体

构建电子邮件数组

JSON
{
  "data": [
    { "email": "andrea.schmidt@example.com", "country": "DE", "id": "123" },
    { "email": "andrea.rossi@example.it", "country": "IT", "id": "456" },
    { "email": "james.brown@example.com", "country": "US", "id": "789" }
  ]
}

代码示例

发送多邮箱请求

cURL
curl -X POST "https://api.genderapi.io/api/email/multi/country" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"data":[{"email":"andrea.schmidt@example.com","country":"DE","id":"123"},{"email":"james.brown@example.com","country":"US","id":"789"}]}'
JavaScript
const data = [
  { email: "andrea.schmidt@example.com", country: "DE", id: "123" },
  { email: "james.brown@example.com", country: "US", id: "789" }
];
const response = await fetch("https://api.genderapi.io/api/email/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": "Andrea", "q": "andrea.schmidt@example.com", "gender": "female", "country": "DE", "total_names": 644, "probability": 88, "id": "123" },
    { "name": "James", "q": "james.brown@example.com", "gender": "male", "country": "US", "total_names": 45274, "probability": 100, "id": "789" }
  ], "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条

验证每个地址,并将较大的数据集拆分为不超过50条的批次。在应用结果前检查提取的name and probability内容

下一步指南

从用户名中判断性别

用户名单次请求从一个用户名中提取姓名 →邮箱单次请求使用AI回退处理一封邮件 →