Gender from email · Single request

Determine gender from an email

Extract a likely first name from one email address, then return a country-aware gender prediction.

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

Request overview

From email address to prediction

GenderAPI analyzes the local part of the address, extracts the most likely first name and uses that name for gender prediction. Supply country context when you know the user’s region.

MethodPOST
Content typeapplication/json
AuthenticationBearer token
Credit cost1 lookup
HDR

Required HTTP headers

Authorize the request

Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY

JSON request body

Parameters

ParameterTypeRequirementDescription
emailstringRequiredEmail address to analyze. GenderAPI extracts the most likely first name before prediction.
countrystringOptionalISO 3166-1 alpha-2 country code, such as US or TR, to add regional context.
askToAIbooleanOptionalWhen true, use the AI fallback if the extracted name has no database result.
AI fallback

askToAI is evaluated after name extraction and only when that extracted name is not found in the database. The email endpoint does not accept forceToGenderize.

Code examples

Send an email request

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 response

Extracted name and prediction

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"
}

Response fields

FieldTypeDescription
statusbooleanWhether the request completed successfully.
used_creditsintegerCredits consumed by this request.
remaining_creditsintegerCredits available after the request.
expiresintegerPackage expiration time as a UNIX timestamp.
qstringOriginal email submitted in the request.
namestringFirst name extracted from the email address.
genderstring | nullPredicted value: male, female or null.
countrystringCountry code considered for the prediction.
total_namesintegerNumber of samples supporting the prediction.
probabilityintegerPrediction confidence as a percentage.
durationstringServer processing time.

Use a valid, complete email address

Name extraction depends on the address structure. Generic inboxes, aliases or local parts without recognizable names may produce no result; check name, gender and probability before using a prediction.

Next guide

Analyze multiple email addresses

Email multiple requestProcess several addresses in one request →Name single requestSend a known first name directly →