PHPackages                             richweber/yii2-gender-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. richweber/yii2-gender-api

ActiveYii2-extension[API Development](/categories/api)

richweber/yii2-gender-api
=========================

Yii2 extension of Gender API

1.0.0(9y ago)57.2k1BSD-3-ClausePHP

Since Dec 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/RichWeber/yii2-gender-api)[ Packagist](https://packagist.org/packages/richweber/yii2-gender-api)[ RSS](/packages/richweber-yii2-gender-api/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Yii2 Gender API
===============

[](#yii2-gender-api)

This extension provides the [Gender API](https://gender-api.com) for the [Yii framework 2.0](http://www.yiiframework.com).

### Installation

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist richweber/yii2-gender-api

```

or add

```
"richweber/yii2-gender-api": "^1.0.0"

```

to the require section of your composer.json

### Configure

[](#configure)

```
'components' => [
    ...
    'gender' => [
        'class' => 'richweber\gender\components\Gender',
        'serverKey' => '',
    ],
    ...
],

```

### Basic Usage

[](#basic-usage)

```
/** @var \richweber\gender\components\Gender $component */
$component = Yii::$app->gender;

$result = $component->checkName('Roman');
if (!isset($result->errno) && $result->accuracy > 60) {
    $gender = (string) $result->gender;
    var_dump($gender);
}
```

#### As multiple names

[](#as-multiple-names)

```
$result = $component->checkName(['Roman', 'Богдан']);
if (!isset($result->errno)) {
    var_dump($result->result);
}
```

#### Localization by country

[](#localization-by-country)

```
$result = $component->byLocalization('UA')->checkName('Roman');
if (!isset($result->errno) && $result->accuracy > 60) {
    $gender = (string) $result->gender;
    var_dump($gender);
}
```

#### Localization by IP

[](#localization-by-ip)

```
$result = $component->byIP('54.201.16.177')->checkName('Roman');
if (!isset($result->errno) && $result->accuracy > 60) {
    $gender = (string) $result->gender;
    var_dump($gender);
}
```

#### Localization by language

[](#localization-by-language)

```
$result = $component->byLanguage('de-DE')->checkName('Roman');
if (!isset($result->errno) && $result->accuracy > 60) {
    $gender = (string) $result->gender;
    var_dump($gender);
}
```

#### Get gender by an email address

[](#get-gender-by-an-email-address)

```
$result = $component->checkNameByEmail('markus.p@gmail.com');
if (!isset($result->errno) && $result->accuracy > 60) {
    $gender = (string) $result->gender;
    var_dump($gender);
}
```

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3498d ago

Major Versions

0.1.0 → 1.0.02016-12-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1702252?v=4)[Roman Bahatyi](/maintainers/RichWeber)[@RichWeber](https://github.com/RichWeber)

---

Top Contributors

[![RichWeber](https://avatars.githubusercontent.com/u/1702252?v=4)](https://github.com/RichWeber "RichWeber (5 commits)")

---

Tags

apiyii2gender

### Embed Badge

![Health badge](/badges/richweber-yii2-gender-api/health.svg)

```
[![Health](https://phpackages.com/badges/richweber-yii2-gender-api/health.svg)](https://phpackages.com/packages/richweber-yii2-gender-api)
```

###  Alternatives

[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1143.8k1](/packages/skeeks-yii2-google-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
