Bulk request overview
अधिकतम 100 names process करें
data array भेजें और हर record के लिए एक result पाएँ। हर prediction को source record से सही ढंग से जोड़ने के लिए अपने system का id दें।
askToAI और forceToGenderize उपलब्ध नहीं हैं। Non-Latin script या AI fallback की जरूरत वाले name के लिए single-name endpoint इस्तेमाल करें।
जरूरी HTTP headers
Bulk request authorize करें
Content-Typeapplication/jsonAuthorizationBearer YOUR_API_KEYJSON request body
Parameters
| Field | Type | Requirement | Description |
|---|---|---|---|
data | object[] | जरूरी | 1 से 100 name records वाली array। |
data[].name | string | जरूरी | Analyze करने के लिए first name। |
data[].country | string | वैकल्पिक | ISO 3166-1 alpha-2 country code। Country result न मिलने पर global result इस्तेमाल होता है। |
data[].id | string | integer | वैकल्पिक | आपका record identifier, जो result को source record से जोड़ने के लिए बिना बदलाव लौटता है। |
Supplied country के लिए match न मिले तो GenderAPI उपलब्ध global name result लौटाता है। IN, DE या US जैसे ISO 3166-1 alpha-2 values इस्तेमाल करें।
Request payload
Data array बनाएँ
{
"data": [
{ "name": "Priya", "country": "IN", "id": "123" },
{ "name": "Andrea", "country": "IT", "id": "456" },
{ "name": "James", "country": "US", "id": "789" }
]
}Code examples
Multiple-name request भेजें
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":"Priya","country":"IN","id":"123"},{"name":"Andrea","country":"IT","id":"456"}]}'const data = [
{ name: "Priya", country: "IN", id: "123" },
{ name: "Andrea", country: "IT", id: "456" }
];
const response = await 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 })
});200 response
Results को अपने records से match करें
{
"status": true,
"used_credits": 2,
"remaining_credits": 7265,
"expires": 1717069765,
"names": [
{ "name": "priya", "q": "Priya", "gender": "female", "country": "IN", "total_names": 1000, "probability": 95, "id": "123" },
{ "name": "andrea", "q": "Andrea", "gender": "male", "country": "IT", "total_names": 13537, "probability": 98, "id": "456" }
],
"duration": "5ms"
}Response fields की जानकारी
| Field | Type | Description |
|---|---|---|
status | boolean | Bulk request सफलतापूर्वक पूरा हुआ या नहीं। |
used_credits | integer | सभी submitted names में इस्तेमाल हुए credits। |
remaining_credits | integer | Request के बाद उपलब्ध credits। |
expires | integer | Package expiry का UNIX timestamp। |
names | object[] | Name prediction results का ordered collection। |
names[].name | string | Prediction के लिए इस्तेमाल हुआ normalized name। |
names[].q | string | Request में भेजा गया original name। |
names[].gender | string | null | Predicted value: male, female या null। |
names[].country | string | इस result में इस्तेमाल हुआ country code। |
names[].total_names | integer | इस result को support करने वाले samples की संख्या। |
names[].probability | integer | प्रतिशत में prediction probability। |
names[].id | string | integer | Record matching के लिए लौटाया गया input identifier। |
duration | string | कुल server processing time। |
हर request को 100 records के भीतर रखें
Array भेजने से पहले validate करें और deterministic record matching के लिए unique id इस्तेमाल करें। बड़े datasets को अधिकतम 100 names के batches में बाँटें।
अगली गाइड