Skip to content
POST AI agent ready /v1/gender/estimate

Gender Detection API - Predict Gender from First Name

Predicts the gender associated with a first name using statistical models trained on public demographic data. Returns "male" or "female" with a probability score (0-1) and the sample count. Optionally narrow results by country for region-specific accuracy.

Parameters

stringrequired

First name to predict gender for.

string

ISO 3166-1 alpha-2 country code for country-specific prediction.

Code examples

curl -X POST https://api.botoi.com/v1/gender/estimate \
  -H "Content-Type: application/json" \
  -d '{"name":"Maria","country_id":"US"}'

When to use this API

Personalized email salutations

When your CRM has a first name but no gender field, use this endpoint to predict gender and generate appropriate salutations ("Dear Mr. Smith" vs "Dear Ms. Johnson"). Only apply predictions with probability above 0.90 to avoid errors.

Survey and analytics demographic enrichment

Enrich survey responses or user analytics with predicted gender when the information was not collected directly. Use the data for aggregate reporting on gender distribution across your user base, product usage patterns, or A/B test results.

E-commerce product recommendations

Predict gender from the account holder's first name to personalize default product categories. Show clothing, accessories, or gift recommendations aligned with the predicted gender, while providing an easy option for users to update their preferences.

Frequently asked questions

What values does the gender field return?
The gender field returns "male" or "female" based on the statistical majority for that name. For names with near-equal probability (e.g., "Alex"), the response reflects the slight majority, and the probability will be close to 0.50.
What does the probability score mean?
The probability is a value between 0 and 1 indicating confidence. A score of 0.98 means 98% of people with that name in the dataset identify with the predicted gender. Scores below 0.60 indicate the name is strongly unisex.
Does the country_id affect results?
Yes. Some names have different gender associations in different countries. "Andrea" is predominantly female in English-speaking countries but male in Italy. Providing a country_id gives more accurate regional predictions.
How should I handle low-probability predictions?
For predictions with probability below 0.70, treat the name as gender-ambiguous. Use gender-neutral language in communications and consider asking the user directly rather than assuming.
Can I predict gender for nicknames or shortened names?
Yes, if the nickname is common enough to appear in the dataset. "Mike" will return male, "Liz" will return female. Uncommon abbreviations may have lower sample counts and less reliable predictions.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.