PHP Composer Client

Gender-API.com offers an official PHP client library with Composer support for seamless integration into your PHP applications. Our AI-powered gender detection API determines the gender of first names and email addresses with 99.5% accuracy across 150+ countries. Unlike generic AI models, Gender-API is 10x-90x faster with 9-34% better accuracy and 37% more names in our specialized database. The PHP client provides easy-to-use methods for single and batch lookups, perfect for user registration forms, CRM systems, and marketing automation. Start free with 100 API calls per month, no credit card required. Trusted by over 10,000 companies worldwide including Fortune 500s.

First install our library with composer:

composer require gender-api/client
<?php

use GenderApi\Client as GenderApiClient;

$client = new GenderApiClient('your-api-key');

// Simple gender lookup
$result = $client->getByFirstName('Elisabeth');

if ($result->genderFound()) {
    echo $result->getGender();    // "female"
    echo $result->getAccuracy();  // 99
}

// First name with country (e.g., "Andrea" varies by country)
$result = $client->getByFirstNameAndCountry('Andrea', 'IT');
echo $result->getGender(); // "male" (in Italy)

// Full name with automatic first/last name splitting
$result = $client->getByFirstNameAndLastName('Sandra Miller');

echo $result->getFirstName(); // "Sandra"
echo $result->getLastName();  // "Miller"
echo $result->getGender();    // "female"

// Email address analysis
$result = $client->getByEmailAddress('elisabeth.smith@company.com');
echo $result->getGender();  // "female"

// Batch processing - multiple names in one call
$names = ['Michael', 'Sarah', 'Kim'];
$results = $client->getByMultipleNames($names);

foreach ($results as $result) {
    printf(
        "%s: %s (%d%% confidence)\n",
        $result->getFirstName(),
        $result->getGender(),
        $result->getAccuracy()
    );
}

See full client documentation here:

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

First install our library with npm:

See full client documentation here:

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

First install our library with npm:

See full client documentation here:

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

First install our library with pip:

See full client documentation here:

https://github.com/markus-perl/gender-api-client-python
https://pypi.org/project/gender-api-client/

Professional Gender Detection for PHP Applications

Gender-API.com provides the most comprehensive and accurate gender detection solution for PHP developers. Our official Composer package brings enterprise-grade gender determination capabilities to your PHP applications with just a few lines of code. Whether you're building user registration systems, CRM platforms, email marketing tools, or customer analytics dashboards, our PHP client library seamlessly integrates into your existing codebase.

Why Choose Gender-API Over Generic AI Solutions?

While generic AI models like ChatGPT and other large language models can attempt gender detection, they fall short in several critical areas. Gender-API.com is purpose-built for this specific task, delivering:

  • 10x to 90x Faster Response Times : Our specialized infrastructure processes names in under 100ms, while generic AI solutions can take several seconds
  • 9% to 34% Better Accuracy : Our database is specifically trained on name-gender associations across cultures and countries
  • 37% More Comprehensive Database : We maintain over 9 million names with continuous updates, far exceeding generic AI training data
  • Country-Specific Accuracy : Names like "Andrea" or "Kim" have different gender associations in different countries - we handle these nuances perfectly
  • Consistent Performance : 99.9% uptime SLA with predictable response times, unlike AI services that can be throttled or unavailable

Key Features of Our PHP Client Library

  • Composer Integration : Install with a single command: composer require gender-api/client
  • PSR-4 Autoloading : Follows PHP-FIG standards for seamless integration
  • Batch Processing : Process thousands of names efficiently with our bulk lookup endpoints
  • Smart Caching : Built-in caching mechanisms to optimize API usage and reduce costs
  • Exception Handling : Comprehensive error handling with detailed exception messages
  • Type Safety : Full type hints for modern PHP 7.4+ and PHP 8.x compatibility
  • Framework Agnostic : Works with Laravel, Symfony, CodeIgniter, WordPress, and any PHP framework

Perfect for These Use Cases

  • User Registration Forms : Automatically detect gender during signup to personalize user experience
  • Email Marketing : Segment your email lists by gender for targeted campaigns
  • CRM Systems : Enrich customer profiles with accurate gender data
  • E-commerce Personalization : Show relevant products based on customer gender
  • Analytics & Reporting : Generate demographic insights from your user base
  • Data Cleaning : Validate and complete existing customer databases

Unmatched Accuracy & Coverage

Our API achieves 99.5% accuracy across 150+ countries and territories. We process names in multiple character sets including Latin, Cyrillic, Arabic, Chinese, Japanese, Korean, and many more. Our intelligent fallback system automatically searches our global database if a name isn't found in a specific country, ensuring maximum coverage.

Enterprise-Ready & GDPR Compliant

Trusted by over 10,000 companies worldwide including Fortune 500 enterprises, Gender-API.com is built with security and privacy at its core. We're fully GDPR compliant and never store or share your query data. Our infrastructure is hosted in secure European data centers with 99.9% uptime SLA.

Start Free Today

Get started immediately with 100 free API calls per month - no credit card required. As your needs grow, our flexible pricing scales with you. From startups to enterprises processing millions of names monthly, we have a plan that fits your requirements.

Chat