# what-gender

> Determine the gender of person using first name, accepts up to 100 names at the time

Latest version **3.1.2** (published 2017-06-20) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install what-gender
pnpm add what-gender
yarn add what-gender
bun add what-gender
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.1.2 |
| Published | 2017-06-20 |
| First published | 2017-06-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | Marko Vujanic |
| Maintainers | marko.vujanic |
| Keywords | guess gender, determine gender, gender api |

## Links

- npm: https://www.npmjs.com/package/what-gender
- npm.io page: https://npm.io/package/what-gender

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.16.2

## Recent versions

- 3.1.2 (latest) — 2017-06-20
- 1.0.2 — 2017-06-19
- 1.0.0 — 2017-06-19

## README

### Gender API

Guessing the name based on the first name. You can pass it one name or an array
to up to 100 names, if you try pass more you'll get the error back.


## Multiple names use

```
var gender = require('what-gender');

gender(['mike', 'joe', 'donald'], function(err, result) {
		if(err) console.log('this is error', err)
		console.log(result) 

});
```
Response will look like this: Array of objects

```
[
	{"name":"Anna","gender":"female","samples":211,"accuracy":97},
	{"name":"Jack","gender":"male","samples":105,"accuracy":100},
	{"name":"Stephen","gender":"male","samples":48,"accuracy":100}
]
```

## Single name Use

```
gender('mike', {key: EUU123Af}, function(err, result) {
		console.log(result) 
		// {"name":"diana","gender":"female","samples":36,"accuracy":100,"duration":"41ms"} 
})

```

Pass up to 3 arguments:

1. List of names, or single string of name
2. Optional Object with options
3. Callback function

#### Options (object) OPTIONAL

You can add couple of options, so results could be more accurate.

* **key:** This is your private api key you can get
[here](https://gender-api.com/en/account/login) and 500 free names with the key
* **ip:** you can pass IP and country will be auto determined
* **country:** this is actually standard country code [ISO
3166-1](https://en.wikipedia.org/wiki/Country_code) ex: (US, NL, DE)
* **language:** based on browser locale language (en-US, de-DE)

Request will be returned as:
```
{"name":"John","country":"US","gender":"male","samples":4,"accuracy":100,"duration":"38ms"} //Country: US
{"name":"Tanja","country":"DE","gender":"female","samples":10,"accuracy":100,"duration":"36ms"} //Country: Germany.
{"name":"Thomas","country":"DE","gender":"male","samples":13,"accuracy":100,"duration":"39ms"} //Country: Based on the browser language.
```


### Additional Notes:

Keep in mind this is commercial API, and you get only 50 names per month, WITHOUT
the key, if you [register account](https://gender-api.com/en/account) and get your key you are bumping that to 500
names, not requests but names.

Made with support from [vanila.io](http://www.vanila.io), probably one of the
best places to code your dream app.

---
_Source: https://npm.io/package/what-gender · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
