GENDER API PHP

Installeer eerst onze bibliotheek met composer:

$ composer require gender-api/client
use GenderApi\Client as GenderApiClient;

try {
    $apiClient = new GenderApiClient('insert your API key');

    // Query a single name
    $lookup = $apiClient->getByFirstName('elisabeth');
    if ($lookup->genderFound()) {
        echo $lookup->getGender();      // female
    }

    // Query a full name and improve the result by providing a country code
    $lookup = $apiClient->getByFirstNameAndLastNameAndCountry('Thomas Johnson', 'US');
    if ($lookup->genderFound()) {
        echo $lookup->getGender();      // male
        echo $lookup->getFirstName();   // Thomas
        echo $lookup->getLastName();    // Johnson
    }

} catch (GenderApi\Exception $e) {
    // Name lookup failed due to a network error or insufficient remaining requests
    // left. See https://gender-api.com/en/api-docs/error-codes
    echo 'Exception: ' . $e->getMessage();
}

Bekijk hier de volledige klantdocumentatie:

https://github.com/markus-perl/gender-api-client

Installeer eerst onze bibliotheek met npm:

Bekijk hier de volledige klantdocumentatie:

https://github.com/markus-perl/gender-api-client-npm

Installeer eerst onze bibliotheek met npm:

Bekijk hier de volledige klantdocumentatie:

https://github.com/markus-perl/gender-api-client-npm

Download een voorbeeldproject hier:

Documentatie:

https://github.com/microknights/Gender-API
Chat