リクエストの概要
メールアドレスから性別判定へ
GenderAPIはメールアドレスの@より前を解析し、最も可能性の高い名前を抽出して性別を判定します。利用者の地域が分かる場合は、国情報も指定してください。
01メールを入力
→michael.smith@example.com02名前を抽出
→Michael03性別を判定
male · 97%メソッドPOST
コンテンツ形式application/json
認証Bearer token
クレジット消費1件の検索
HDR
必須HTTPヘッダー
リクエストを認証
Content-Typeapplication/jsonAuthorizationBearer YOUR_API_KEYJSONリクエストボディ
パラメータ
| パラメータ | 型 | 要否 | 説明 |
|---|---|---|---|
email | string | 必須 | 分析するメールアドレス。GenderAPIが最も可能性の高い名前を抽出し、性別を判定します。 |
country | string | 任意 | 地域情報として使用するISO 3166-1 alpha-2国コード(例:JP、US)。 |
askToAI | boolean | 任意 | trueにすると、抽出した名前がデータベースで見つからない場合にAIフォールバックを使用します。 |
AIフォールバック
askToAI は名前を抽出した後に評価され、抽出名がデータベースで見つからない場合にのみ有効になります。メールAPIはforceToGenderize を受け付けません。
コード例
メール検索リクエストを送信
cURL
curl -X POST "https://api.genderapi.io/api/email" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"email":"michael.smith@example.com","country":"US","askToAI":true}'JavaScript
const response = await fetch("https://api.genderapi.io/api/email", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" },
body: JSON.stringify({ email: "michael.smith@example.com", country: "US", askToAI: true })
});
const data = await response.json();Python
import requests
response = requests.post(
"https://api.genderapi.io/api/email",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"email": "michael.smith@example.com", "country": "US", "askToAI": True}
)
print(response.json())200レスポンス
抽出した名前と性別判定
JSON
{
"status": true,
"used_credits": 1,
"remaining_credits": 4999,
"expires": 1743659200,
"q": "michael.smith@example.com",
"name": "Michael",
"gender": "male",
"country": "US",
"total_names": 10345,
"probability": 97,
"duration": "5ms"
}レスポンスフィールド
| フィールド | 型 | 説明 |
|---|---|---|
status | boolean | リクエストが正常に完了したかどうか。 |
used_credits | integer | このリクエストで消費したクレジット数。 |
remaining_credits | integer | リクエスト完了後の残りクレジット数。 |
expires | integer | パッケージの有効期限を示すUNIXタイムスタンプ。 |
q | string | リクエストで送信した元のメールアドレス。 |
name | string | メールアドレスから抽出された名前。 |
gender | string | null | 判定値:male、female、またはnull。 |
country | string | 判定時に使用された国コード。 |
total_names | integer | 判定結果の根拠となったサンプル数。 |
probability | integer | 判定の信頼度(パーセント)。 |
duration | string | サーバー処理時間。 |
完全で有効なメールアドレスを使用
名前の抽出精度はメールアドレスの構造に左右されます。共有アドレス、エイリアス、識別可能な名前を含まないローカル部では結果が返らない場合があります。判定を利用する前にname、gender、probability を確認してください。
次のガイド