New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

what-gender

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

what-gender

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

latest
npmnpm
Version
3.1.2
Version published
Maintainers
1
Created
Source

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:

  • List of names, or single string of name
  • Optional Object with options
  • 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 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 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 and get your key you are bumping that to 500 names, not requests but names.

Made with support from vanila.io, probably one of the best places to code your dream app.

Keywords

guess gender

FAQs

Package last updated on 20 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts