ユーザー名から性別を判定 · 個別リクエスト

ユーザー名から性別を決定

ソーシャルハンドル、ニックネーム、または別名から可能性のある名前を抽出し、信頼度付きの予測を返す。

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

リクエストの概要

ユーザー名から可能性のある名前へ

GenderAPIは、提出されたハンドル内に名前に関するシグナルを検出し、データベースの証拠、国別コンテキスト、および必要に応じてAIのフォールバックを用いて性別を予測します。

Inputsparkling_unicorn
抽出されたシグナルSparkling
Prediction女性 · 92%
MethodPOST
コンテンツタイプapplication/json
Authenticationベアラーティケット
AIオプションAvailable
HDR

必須HTTPヘッダー

リクエストを認可

Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY

JSON リクエストボディ

パラメータ

ParameterTypeRequirementDescription
usernamestring必須分析するユーザー名、ソーシャルハンドル、表示名、またはニックネーム
countrystring任意地域コンテキストのために、ISO 3166-1 alpha-2国コード(例:USまたはTR)
askToAIboolean任意trueの場合、抽出された名前がデータベースに結果がない場合にAIフィールドを活用する
forceToGenderizeboolean任意trueの場合、通常の名前とは似ていないエイリアスまたは入力に対して予測を試みる
askToAI

抽出された名前がデータベースに一致しない場合にのみ使用する。

forceToGenderize

ファンタジー用語、ブランド類似のエイリアス、不自然なニックネームへの試行を許可する。

信頼性は重要である:弱いまたは人間ではない名前シグナルに対する強制結果は、信頼性が低い可能性がある。行動前に評価する。probability行動前に評価する。

コード例

ユーザー名のリクエストを送信

cURL
curl -X POST "https://api.genderapi.io/api/username" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"username":"sparkling_unicorn","country":"US","askToAI":true,"forceToGenderize":true}'
JavaScript
const response = await fetch("https://api.genderapi.io/api/username", {
  method: "POST",
  headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" },
  body: JSON.stringify({ username: "sparkling_unicorn", country: "US", askToAI: true, forceToGenderize: true })
});
Python
import requests
response = requests.post(
  "https://api.genderapi.io/api/username",
  headers={"Authorization": "Bearer YOUR_API_KEY"},
  json={"username": "sparkling_unicorn", "country": "US", "askToAI": True, "forceToGenderize": True}
)
print(response.json())

200レスポンス

抽出されたシグナル and prediction

JSON
{
  "status": true, "used_credits": 1, "remaining_credits": 4999,
  "expires": 1743659200, "q": "sparkling_unicorn",
  "name": "Sparkling", "gender": "female", "country": "US",
  "total_names": 9876, "probability": 92, "duration": "6ms"
}

レスポンスフィールド

FieldTypeDescription
statusbooleanリクエストが成功したかどうか
used_creditsintegerこのリクエストで消費されたクレジット
remaining_creditsintegerリクエスト後の残りのクレジット
expiresintegerパッケージの有効期限をUNIXタイムスタンプで表す
qstringリクエストで送信された元のユーザー名。
namestringユーザー名から抽出された可能性のある名前。
genderstring | null予測値:男性、女性、またはnull。
countrystring予測に使用された国コード。
total_namesinteger予測を支持するサンプルの数。
probabilityinteger予測の信頼度(パーセンテージ)。
durationstringサーバー処理時間。

ユーザー名を間接的なシグナルとして扱う

ユーザー名はブランド、キャラクター、またはコンセプトを表す場合もあり、人間を表すものではない可能性がある。抽出された結果が意味のあるものかどうかを確認し、用途に応じて適切な確率閾値を設定する。name

次に進むガイド

複数のユーザー名を分析

複数のユーザー名を一括リクエスト1つのリクエストで複数のハンドルを処理 →メールアドレス一括リクエストメールアドレスから名前を抽出 →