大量リクエストの概要
50件までのメールアドレスを処理
送信するdata配列。GenderAPIは各住所から可能性のある名前を抽出し、該当する予測を返します。あなたのオプションidはデータベースの相関を決定論的に行います。
MethodPOST
Maximum50件のメール
AuthenticationBearerトークン
結果のフォーマットnames[]
50件のメール max→名前抽出→国ごとの結果
HDR
必要なHTTPヘッダー
ブロックリクエストの認可
Content-Typeapplication/jsonAuthorizationBearer YOUR_API_KEYJSONリクエストボディ
パラメータ
| Field | Type | Requirement | Description |
|---|---|---|---|
data | object[] | 必須 | 1から50までのメールレコードを含む配列。 |
data[].email | string | 必須 | GenderAPIが可能性のある初めの名前を抽出するメールアドレス。 |
data[].country | string | オプション | 地域コンテキストとして使用されるISO 3166-1 alpha-2国コード。 |
data[].id | string | 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"
}レスポンスフィールド
| Field | Type | Description |
|---|---|---|
status | boolean | ブロックスリクエストが成功したかどうか。 |
used_credits | integer | すべての送信メールに対して消費されたクレジット。 |
remaining_credits | integer | このリクエスト後の利用可能なクレジット。 |
expires | integer | パッケージの有効期限をUNIXタイムスタンプで表す。 |
names | object[] | 送信されたメールの結果を順に並べたオーダー付きのコレクション。 |
names[].name | string | メールアドレスから抽出された名前(初名)。 |
names[].q | string | リクエストで送信された元のメールアドレス。 |
names[].gender | string | null | 予測値:男性、女性、またはnull。 |
names[].country | string | この結果に使用された国コード。 |
names[].total_names | integer | この結果を支持するサンプルの数。 |
names[].probability | integer | 予測信頼度(パーセンテージ)。 |
names[].id | string | integer | 記録の相関のために返された入力識別子。 |
duration | string | サーバー処理時間の合計。 |
各リクエストは50件までに保つこと
すべての住所を検証し、大きなデータセットは50件以下のバッチに分割する。抽出した内容を確認するname and probability結果を適用する前に
次へのガイド