Geslacht bepalen via e-mail – Meervoudig verzoek
Het Multiple Email endpoint stelt je in staat om het geslacht van maximaal 50 e-mailadressen in één enkele aanvraag te analyseren. Dit is handig voor bulkverwerking en integraties met hoge prestaties. Alle parameters worden via een POST-verzoek als JSON verstuurd. Je moet authenticeren met de Bearer-token methode in de Authorization-header.
De API haalt een waarschijnlijk voornaam uit elk e-mailadres en bepaalt voor ieder het geslacht.
Je kunt ook optioneel een country
filter en een aangepaste id
veld meesturen om resultaten te matchen met jouw eigen database.
Request URL
POST https://api.genderapi.io/api/email/multi/country
Vereiste HTTP-headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
Request body parameters
Veld | Type | Vereist | Beschrijving |
---|---|---|---|
data | Array van objecten | Ja | Array van e-mails en optionele parameters. Maximaal 50 per verzoek. |
String | Ja (in elk object) | Het te analyseren e-mailadres. De API haalt de waarschijnlijke voornaam eruit. | |
country | String | Nee |
Tweeletterige landcode (ISO 3166-1 alpha-2)
voor meer nauwkeurigheid. Bijvoorbeeld: TR voor Turkije.
|
id | String of Integer | Nee |
Optioneel ID dat je meegeeft om resultaten aan je eigen database te koppelen. Hetzelfde id wordt in de response teruggegeven.
|
Voorbeeld van request body
{
"data": [
{ "email": "andrea.schmidt@example.com", "country": "DE", "id": "123" },
{ "email": "andrea.rossi@example.it", "country": "IT", "id": "456" },
{ "email": "james.brown@example.com", "country": "US", "id": "789" }
]
}
Voorbeeld aanvragen
cURL voorbeeld
curl -X POST "https://api.genderapi.io/api/email/multi/country" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"data":[{"email":"andrea.schmidt@example.com","country":"DE","id":"123"},{"email":"andrea.rossi@example.it","country":"IT","id":"456"},{"email":"james.brown@example.com","country":"US","id":"789"}]}'
PHP cURL voorbeeld
<?php
$url = "https://api.genderapi.io/api/email/multi/country";
$data = array(
"data" => array(
array(
"email" => "andrea.schmidt@example.com",
"country" => "DE",
"id" => "123"
),
array(
"email" => "andrea.rossi@example.it",
"country" => "IT",
"id" => "456"
),
array(
"email" => "james.brown@example.com",
"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 voorbeeld
fetch("https://api.genderapi.io/api/email/multi/country", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
body: JSON.stringify({
data: [
{ email: "andrea.schmidt@example.com", country: "DE", id: "123" },
{ email: "andrea.rossi@example.it", country: "IT", id: "456" },
{ email: "james.brown@example.com", country: "US", id: "789" }
]
})
})
.then(response => response.json())
.then(data => console.log(data));
Python requests voorbeeld
import requests
url = "https://api.genderapi.io/api/email/multi/country"
payload = {
"data": [
{ "email": "andrea.schmidt@example.com", "country": "DE", "id": "123" },
{ "email": "andrea.rossi@example.it", "country": "IT", "id": "456" },
{ "email": "james.brown@example.com", "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())
Voorbeeld van JSON response
{
"status": true,
"used_credits": 3,
"remaining_credits": 7265,
"expires": 1717069765,
"names": [
{
"name": "Andrea",
"q": "andrea.schmidt@example.com",
"gender": "female",
"country": "DE",
"total_names": 644,
"probability": 88,
"id": "123"
},
{
"name": "Andrea",
"q": "andrea.rossi@example.it",
"gender": "male",
"country": "IT",
"total_names": 13537,
"probability": 98,
"id": "456"
},
{
"name": "James",
"q": "james.brown@example.com",
"gender": "male",
"country": "US",
"total_names": 45274,
"probability": 100,
"id": "789"
}
],
"duration": "5ms"
}
Response velden
Veld | Type | Beschrijving |
---|---|---|
status | Boolean | Geeft aan of het verzoek succesvol was. |
used_credits | Integer | Aantal verbruikte credits voor dit verzoek. |
remaining_credits | Integer | Credits die na dit verzoek overblijven op jouw account. |
expires | Integer (timestamp) | Vervaldatum van het pakket als UNIX-timestamp. |
names | Array van objecten | Lijst met resultaten voor elke e-mailinput. |
names[].name | String | De gevonden voornaam uit het e-mailadres. |
names[].q | String | Jouw originele e-mailinput. |
names[].gender | Enum[String] | Voorspeld geslacht: male , female of null . |
names[].country | String | Landcode gebruikt bij de voorspelling. |
names[].total_names | Integer | Aantal voorbeelden gebruikt voor deze voorspelling. |
names[].probability | Integer | Vertrouwenspercentage van de voorspelling. |
names[].id | String / Integer | Hetzelfde id als je in de aanvraag stuurde, om te matchen met je database. |
duration | String | Totaal verwerkingstijd voor het verzoek (bijv. 5ms ). |