Get Gender by Name - Multiple Request
The Multiple Names endpoint allows you to analyze the gender of up to 100 names in a single request. This is useful for bulk processing and high-performance integrations. All parameters are sent via a POST request as JSON. You must authenticate using the Bearer token method in the Authorization header.
By adding the country
filter to each name, you can obtain gender predictions
specific to a certain country. If there is no result for the given country, the API will
provide a global name result.
You can also pass an optional id
field for each name. This value can be any
string or integer from your own database. The API will return the same id
in the response, so you can match your input with the results.
askToAI
are not available in bulk operations. If your data often includes names written in non-Latin characters (e.g. Chinese), we strongly recommend sending single requests instead, using the
askToAI
parameter to achieve more accurate results.
Request URL
POST https://api.genderapi.io/api/name/multi/country
Required HTTP Headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
Request Body Parameters
Field | Type | Required | Description |
---|---|---|---|
data | Array of Objects | Yes | Array of names and their optional parameters. Maximum 100 entries per request. |
name | String | Yes (inside each object) | The first name you want to analyze. |
country | String | No |
A two-letter country code (ISO 3166-1 alpha-2)
to improve prediction accuracy. Example: TR for Turkey.
|
id | String or Integer | No |
Optional ID you define to match results with your own database records.
The same id will be returned in the response for mapping purposes.
|
Example Request Body
{
"data": [
{ "name": "Andrea", "country": "DE", "id": "123" },
{ "name": "andrea", "country": "IT", "id": "456" },
{ "name": "james", "country": "US", "id": "789" }
]
}
Example Requests
cURL Example
curl -X POST "https://api.genderapi.io/api/name/multi/country" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"data":[{"name":"Andrea","country":"DE","id":"123"},{"name":"andrea","country":"IT","id":"456"},{"name":"james","country":"US","id":"789"}]}'
PHP cURL Example
<?php
$url = "https://api.genderapi.io/api/name/multi/country";
$data = array(
"data" => array(
array(
"name" => "Andrea",
"country" => "DE",
"id" => "123"
),
array(
"name" => "andrea",
"country" => "IT",
"id" => "456"
),
array(
"name" => "james",
"country" => "US",
"id" => "789"
)
)
);
$payload = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer YOUR_API_KEY"
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
JavaScript fetch Example
fetch("https://api.genderapi.io/api/name/multi/country", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
body: JSON.stringify({
data: [
{ name: "Andrea", country: "DE", id: "123" },
{ name: "andrea", country: "IT", id: "456" },
{ name: "james", country: "US", id: "789" }
]
})
})
.then(response => response.json())
.then(data => console.log(data));
Python requests Example
import requests
url = "https://api.genderapi.io/api/name/multi/country"
payload = {
"data": [
{ "name": "Andrea", "country": "DE", "id": "123" },
{ "name": "andrea", "country": "IT", "id": "456" },
{ "name": "james", "country": "US", "id": "789" }
]
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Example JSON Response
{
"status": true,
"used_credits": 3,
"remaining_credits": 7265,
"expires": 1717069765,
"names": [
{
"name": "andrea",
"q": "Andrea",
"gender": "female",
"country": "DE",
"total_names": 644,
"probability": 88,
"id": "optional"
},
{
"name": "andrea",
"q": "andrea",
"gender": "male",
"country": "IT",
"total_names": 13537,
"probability": 98,
"id": "optional"
},
{
"name": "james",
"q": "james",
"gender": "male",
"country": "US",
"total_names": 45274,
"probability": 100,
"id": "optional"
}
],
"duration": "5ms"
}
Response Fields
Field | Type | Description |
---|---|---|
status | Boolean | Indicates whether the request was successful. |
used_credits | Integer | Number of credits consumed for this request. |
remaining_credits | Integer | Credits left in your account after this request. |
expires | Integer (timestamp) | Your package expiration date as a UNIX timestamp. |
names | Array of objects | List of results for each input name. |
names[].name | String | Normalized version of the name (lowercase). |
names[].q | String | Original query as sent by you (case-sensitive). |
names[].gender | Enum[String] | Predicted gender: male , female , or null . |
names[].country | String | Country code considered during the prediction. |
names[].total_names | Integer | Number of samples used for this prediction. |
names[].probability | Integer | Confidence percentage for the gender prediction. |
names[].id | String / Integer | The same id you sent in the request. Used to match your records. |
duration | String | Total processing time for the request (e.g. 5ms ). |
id
field to correlate your own records with the results returned by the API.