hotrush / genderapi-client
0.1.2
2019-06-26 12:33 UTC
Requires
- ext-json: *
Requires (Dev)
- guzzlehttp/guzzle: ^6.3
- phpunit/phpunit: ^5.7
Suggests
- guzzlehttp/guzzle: To use GuzzleHttpAdapter, require guzzlehttp/guzzle:^6.0
This package is auto-updated.
Last update: 2026-02-27 03:42:45 UTC
README
PHP SDK for GenderApi.io API
Simple to use, api key is optional. See API docs here - https://genderapi.io/api-documentation
Installation
composer require hotrush/genderapi-client
Usage
use Hotrush\GenderApi\GenderApiClient; use Hotrush\GenderApi\Adapter\GuzzleHttpAdapter; $client = new GenderApiClient( new GuzzleHttpAdapter($apiToken) ); $nameData = $client->getGender($name, $countryCode); echo $nameData->getGender(); $namesData = $client->getGendersBatch($namesArray, $countryCode); foreach ($namesData as $nameData) { echo $nameData->getGender().PHP_EOL; echo $nameData->getName().PHP_EOL; echo $nameData->getProbability().PHP_EOL; } $nameData = $client->getGenderByEmail($name, $countryCode); echo $nameData->getGender();