이메일로 성별 조회 - 다중 요청
다중 이메일 엔드포인트를 사용하면 한 번의 요청으로 최대 50개의 이메일 주소에 대한 성별을 분석할 수 있습니다.
이 기능은 대량 처리 및 고성능 통합에 유용합니다.
모든 파라미터는 JSON 형식의 POST 요청으로 전송되며, 인증은 Authorization 헤더의 Bearer 토큰 방식을 사용해야 합니다.
API는 각 이메일 주소에서 추정되는 이름을 추출하고 해당 이름의 성별을 판단합니다.
또한 각 항목에 대해 선택적으로 country
필터와 커스텀 id
필드를 전달하여 데이터베이스와 결과를 매칭할 수 있습니다.
요청 URL
POST https://api.genderapi.io/api/email/multi/country
필수 HTTP 헤더
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
요청 본문 파라미터
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
data | 객체 배열 | 예 | 이메일과 선택적 파라미터들을 포함한 배열입니다. 요청당 최대 50개까지 가능합니다. |
문자열 | 예 (각 객체 내부) | 성별을 분석할 이메일 주소입니다. API는 추정 이름을 추출합니다. | |
country | 문자열 | 아니오 |
예측 정확도를 높이기 위한 2자리 국가 코드입니다 (ISO 3166-1 alpha-2).
예: TR (터키)
|
id | 문자열 또는 정수 | 아니오 |
결과를 사용자의 데이터베이스와 매칭하기 위해 정의하는 선택적 ID입니다.
이 id 는 응답에도 동일하게 포함되어 반환됩니다.
|
요청 본문 예시
{
"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" }
]
}
요청 예시
cURL 예제
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 예제
<?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 예제
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 예제
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())
예시 JSON 응답
{
"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"
}
응답 필드 설명
필드 | 타입 | 설명 |
---|---|---|
status | Boolean | 요청이 성공했는지를 나타냅니다. |
used_credits | Integer | 이번 요청에 사용된 크레딧 수입니다. |
remaining_credits | Integer | 요청 후 계정에 남은 크레딧 수입니다. |
expires | Integer (timestamp) | UNIX 타임스탬프로 표시된 패키지 만료 날짜입니다. |
names | 객체 배열 | 각 입력 이메일에 대한 결과 목록입니다. |
names[].name | String | 이메일에서 추출된 이름입니다. |
names[].q | String | 입력한 원래 이메일 주소입니다. |
names[].gender | Enum[String] | 예측된 성별: male , female , 또는 null . |
names[].country | String | 성별 예측 시 참고된 국가 코드입니다. |
names[].total_names | Integer | 해당 예측에 사용된 샘플 수입니다. |
names[].probability | Integer | 성별 예측의 신뢰도 백분율입니다. |
names[].id | String / Integer | 요청 시 보낸 id 값과 동일하며, 결과 매핑에 사용됩니다. |
duration | String | 요청 처리에 걸린 총 시간입니다. 예: 5ms . |