Request overview
Email address से prediction तक
GenderAPI address के local part को analyze करता है, सबसे संभावित first name निकालता है और उसी name से gender prediction करता है। User का region पता हो तो country context दें।
01Email input
→priya.sharma@example.com02Name extraction
→Priya03Prediction
female · 98%MethodPOST
Content typeapplication/json
AuthenticationBearer token
Credit cost1 lookup
HDR
जरूरी HTTP headers
Request authorize करें
Content-Typeapplication/jsonAuthorizationBearer YOUR_API_KEYJSON request body
Parameters
| Parameter | Type | Requirement | Description |
|---|---|---|---|
email | string | जरूरी | Analyze किया जाने वाला पूरा email address। Prediction से पहले सबसे संभावित first name निकाला जाता है। |
country | string | वैकल्पिक | Regional context के लिए US या IN जैसा ISO 3166-1 alpha-2 country code। |
askToAI | boolean | वैकल्पिक | Extracted name का database result न मिलने पर true value AI fallback चालू करती है। |
AI fallback
askToAI, name extraction के बाद और केवल extracted name database में न मिलने पर evaluate होता है। Email endpoint forceToGenderize स्वीकार नहीं करता।
Code examples
Email request भेजें
cURL
curl -X POST "https://api.genderapi.io/api/email" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"email":"priya.sharma@example.com","country":"IN","askToAI":true}'JavaScript
const response = await fetch("https://api.genderapi.io/api/email", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer YOUR_API_KEY" },
body: JSON.stringify({ email: "priya.sharma@example.com", country: "IN", askToAI: true })
});
const data = await response.json();Python
import requests
response = requests.post(
"https://api.genderapi.io/api/email",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"email": "priya.sharma@example.com", "country": "IN", "askToAI": True}
)
print(response.json())200 response
Extracted name और prediction
JSON
{
"status": true,
"used_credits": 1,
"remaining_credits": 4999,
"expires": 1788628316,
"q": "priya.sharma@example.com",
"name": "Priya",
"gender": "female",
"country": "IN",
"total_names": 18342,
"probability": 98,
"duration": "5ms"
}Response fields
| Field | Type | Description |
|---|---|---|
status | boolean | Request सफलतापूर्वक पूरा हुआ या नहीं। |
used_credits | integer | इस request में इस्तेमाल हुए credits। |
remaining_credits | integer | Request के बाद उपलब्ध credits। |
expires | integer | Package expiry का UNIX timestamp। |
q | string | Request में भेजा गया original email address। |
name | string | Email address से निकाला गया first name। |
gender | string | null | Predicted value: male, female या null। |
country | string | Prediction में इस्तेमाल हुआ country code। |
total_names | integer | Prediction को support करने वाले samples की संख्या। |
probability | integer | प्रतिशत में prediction confidence। |
duration | string | Server processing time। |
Valid और पूरा email address इस्तेमाल करें
Name extraction address structure पर निर्भर करता है। Generic inbox, alias या पहचान योग्य name के बिना local part कोई result नहीं दे सकता; prediction इस्तेमाल करने से पहले name, gender और probability जाँचें।
अगली गाइड