Continue → Overview
← All notes

What is a name gender API? How a name becomes male, female or unknown

6 min read guide api

A name gender API is a web service that takes a name, an email address or a username and returns the gender most often recorded for that first name, along with the evidence behind it. It does not detect anything about a person. It looks the name up in aggregated records, such as national birth registrations, and reports how one-sided those records are. A good one also tells you how many records it used, where the answer came from, and when it does not know.

Developers use a name gender API to add a gender column to a CRM, to analyse the gender balance of a large list, or to choose a greeting in an email. This post explains what happens between the request and the answer, using the NameGender API as the worked example.

What goes in and what comes out

A request needs one value. A country code is optional but often changes the answer.

curl "https://namegender.com/api/v1/gender?name=Micheal" \
  -H "Authorization: Bearer $NAMEGENDER_API_KEY"
{
  "query": "Micheal",
  "name": "Micheal",
  "gender": "male",
  "probability": 86,
  "sample_size": 152388,
  "confidence": "high",
  "source": "fuzzy",
  "matched_as": "michael",
  "country": null,
  "data_version": "2026.08"
}

The response is trimmed here; the API documentation lists every field. Four of them do most of the work:

Field What it tells you
gender male, female, or null when there is not enough evidence
probability Share of recorded people with this name who have that gender, 0 to 100
sample_size How many people that share is based on; 0 when the source has no counts
source How the answer was reached: exact match, script conversion, closest spelling, language model, or none

In the example above, Micheal is not in the data as written. The API matched it to michael, reported that in matched_as, and lowered the probability to reflect the correction.

How the answer is reached, step by step

1. Find the given name. A value like Dr. Ayşe Yılmaz is reduced to Ayşe. For an email address, only the part before the @ is used, and john.doe@example.com becomes John. Usernames lose digits, separators and common suffixes. This step causes more wrong answers than any other, which is why the response returns the name it actually looked up. Gender from an email address or a username covers the failure cases.

2. Choose the population. With a country code, the lookup uses that country's records. Without one, it uses a worldwide figure. For most names this makes no difference. For names like Jean, which is male in French records and female in US ones, it decides the answer.

3. Look the name up. The API tries, in order:

  • db: an exact match in the name data
  • script: a match after converting a non-Latin name, such as Arabic or Cyrillic, into a comparable form
  • fuzzy: the closest known spelling, with matched_as showing which one

4. Optionally ask a language model. Only if the caller sets ai_fallback and the account owner has agreed to send names to the third-party AI provider. These answers are marked source: "llm", so they can be filtered out.

5. Otherwise, say unknown. gender is null and source is none. This is a successful response, not an error.

Where the data comes from

The answer is only as good as the records behind it, and there are two very different kinds.

Counted records. Seven countries publish how many babies were registered with each name: the United States, the United Kingdom, France, Canada, Spain, Ireland and Norway. For names found there, sample_size is a real count of people, and probability is a measured share.

Presence records. For the other countries, the source is WGND 2.0, an open dataset that records that a name is used with a gender in a place, but not how many people have it. Answers from this layer return sample_size: 0 and confidence: "unverified", and their probability is capped at 95.

Together they cover about eight million names across 198 countries. The name gender database page lists each source. The distinction matters in practice: a Turkish name can be answered correctly and still come back unverified, because Turkey does not publish name counts.

What a name gender API cannot tell you

  • A person's gender identity. The answer describes a group of people who share a name, not the individual.
  • Anything beyond male and female. The registration records behind the answers use those two categories, so the data cannot say more.
  • Where a name comes from. Knowing which countries record a name is not the same as knowing its origin. Mehmet is recorded in French statistics, but that does not make it a French name.
  • A certain answer for a split name. Taylor comes back at 51% female. That is the correct description of the records, and it should be read as unknown.

How accurate is it?

In our 2026 benchmark of 4,610 labelled names from 25 countries, the API gave an answer for 87.9% of names, and 96.0% of those answers were correct. That means 84.4% of all names ended up with a correct answer. The spread by writing system is wide: Latin-script names are much easier than Greek, and Hebrew is not covered at all. How accurate is gender prediction from a name? has the full breakdown, including the failures.

When to use one, and when not to

Reasonable uses:

  • measuring the gender balance of a large list, with unknowns reported separately
  • adding a gender column to customer data that you will filter by confidence
  • choosing a greeting, with a neutral fallback below a threshold

Uses to avoid: any decision about employment, credit, insurance, health care, legal status or eligibility. A name is not reliable enough for any of them, and in many places using it that way can breach anti-discrimination law.

Frequently asked questions

What is a gender API? A gender API is a web service that estimates the gender associated with a first name, email address or username, based on how that name appears in aggregated records. It returns a gender, a probability, and ideally the evidence behind the answer.

How does a gender API determine gender from a name? It extracts the given name, optionally narrows the data to one country, and looks up the share of people with that name recorded as male or female. If no match exists, a good API returns unknown instead of guessing.

Is there a free name gender API? Yes. A free NameGender account includes 100 credits a day and full API access. Free name gender checkers compared lists what other services include for free.

What is the difference between a gender checker and a gender API? A checker is a web form for looking up names by hand. An API does the same lookup from code, so it can process lists and run inside an application. Running a name gender API in production covers that side.

Every claim on this page is measurable against your own list. The free tier is enough to check it.