Find the gender of a name

Ajeet Verma
2 min readApr 10, 2020
Female or Male ?

Many times we come across the requirements of knowing the gender of names. One scenario maybe let’s say we have a CSV file having a ‘name’ column and we want to derive another column ‘gender’ into the file from the given ‘name’ column. So how can we do that?

Well we have a simple API to predict the gender of a person given their name using genderize.io.

Using Python

Now it’s very simple to use the API in python to make a Http get request using requests library. let’s see how can we do it…

This would render a JSON response like the following.

{
"name": "patrick",
"gender": "male",
"probability": 1,
"count": 2877
}

The count represents the number of data entries examined in order to calculate the response while probability shows the certainty of the assigned gender.

There is also an option to process maximum 10 names per request (for free usage) and one can purchase their API key in case has the requirement of processing more names in one go.

https://api.genderize.io/?name[0]=patrick&name[1]=allen&name[2]=sophiya

To achieve more qualified guesses, it is also possible to use localisation filters to retrieve a guess based only on data for a certain country or language.

https://api.genderize.io/?name=kim&country_id=dk

The endpoint accepts two optional localisation parameters country_id and language_id and both parameters are available both when genderizing a single or multiple names.

Hope this will be useful and feel free to ask questions and if you like it, please let me know in the comment section below. Happy :) reading!

References: what is API, genderize.io , image

--

--