Download the PHP package gender-api/client without Composer
On this page you can find all versions of the php package gender-api/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gender-api/client
More information about gender-api/client
Files in gender-api/client
Package client
Short Description An easy to use API client for Gender-API.com
License MIT
Homepage https://github.com/markus-perl/gender-api-client
Informations about the package client
Gender-API.com PHP Client
A modern, type-safe PHP client for the Gender-API.com service. Determine gender from first names, full names, or email addresses with high accuracy across 200+ countries.
β¨ Features
- π Name Gender Detection - Detect gender from first names with 99%+ accuracy
- π Country Localization - Improve accuracy with country-specific results
- π§ Email Analysis - Extract and analyze names from email addresses
- πΊοΈ Country of Origin - Discover name origins and geographic distribution
- π Batch Processing - Query multiple names in a single API call
- π Type-Safe - Full PHP 8.3+ support with strict typing
- β‘ Modern - PSR-4 autoloading, PHPUnit 11, PHPStan Level 6
π¦ Installation
Install via Composer:
π API Key
Get your free API key at: gender-api.com/account
π Quick Start
π Usage Examples
First Name with Country
For names that vary by country (e.g., "Andrea" is male in Italy, female in Germany):
First Name with Localization
Detect country from IP address or browser locale:
Full Name (First + Last Name Split)
The API automatically splits full names and identifies the first name:
With country and strict mode:
Email Address
Extract and analyze names from email addresses:
Multiple Names (Batch)
Query multiple names in a single API call for efficiency:
With country filter:
Country of Origin
Discover where a name originates from:
Account Statistics
Monitor your API usage:
βοΈ Configuration
Proxy Server
Custom API URL
For enterprise or on-premise installations:
π§ͺ Development
Requirements
- PHP 8.3 or higher
- Composer
Setup
Running Tests
Static Analysis
π API Response Properties
SingleName Result
| Property | Type | Description |
|---|---|---|
getFirstName() |
?string |
The queried name |
getProbability() |
?float |
Probability (e.g. 0.99) |
getGender() |
?string |
"male", "female", or "unknown" |
getAccuracy() |
?int |
Confidence percentage (0-100) |
getSamples() |
?int |
Number of data samples |
getCountry() |
?string |
ISO 3166-1 country code |
genderFound() |
bool |
Whether a gender was determined |
Stats Result
| Property | Type | Description |
|---|---|---|
getRemainingCredits() |
?int |
API credits remaining |
isLimitReached() |
?bool |
Whether quota is exhausted |
π οΈ Error Handling
π Resources
- Homepage: gender-api.com
- API Documentation: gender-api.com/api-docs
- OpenAPI Specification: docs/openapi.yml
- FAQ: gender-api.com/faq
- Error Codes: gender-api.com/error-codes
- Support: gender-api.com/contact
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
All versions of client with dependencies
ext-mbstring Version *
ext-fileinfo Version *
ext-curl Version *