@sebbo2002/genderize
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

genderize

MIT License Module Size CI Status


genderize is a simple client for genderize.io, a gender prediction API using a person's name. The library supports both normal and batch usage, allows free and paid usage via an optional API key, and makes it very easy to access rate limiting information. It's written in TypeScript.

📦 Installation

npm install @sebbo2002/genderize

⚡️ Quick Start

import Genderize from '@sebbo2002/genderize';

const genderize = new Genderize('API-KEY'); // or just `new Genderize()` for free usage

// { name: 'Mia', gender: 'female', probability: 0.96, count: 19266 }
await genderize.predict('Mia');

// {name: 'Steven', gender: 'male, probability: 0.98, count: 5207, country_id: 'US' }
await genderize.predict('Alex', 'US');

// [
//   { name: 'Noah', gender: 'male', probability: 0.88, count: 3939 },
//   { name: 'Evelyn', gender: 'female', probability: 0.98, count: 12188 }
// ]
await genderize.predict(['Noah', 'Evelyn']);

// { limit: 1000, remaining: 978, reset: 2022-05-23T00:00:02.203Z }
genderize.limit

📑 API-Reference

Every hot detail about the API can be found in the documentation.

🚦 Tests

npm test
npm run coverage

🙆🏼‍♂️ Copyright and license

Copyright (c) Sebastian Pekarek under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @sebbo2002/genderize

Weekly Downloads

7

Version

4.1.0

License

MIT

Unpacked Size

28.5 kB

Total Files

7

Last publish

Collaborators

  • sebbo2002