डेवलपर दस्तावेज़

GenderAPI Hindi API documentation

Simple REST requests से first name, full name, email address या username का gender पता करें और structured JSON response पाएँ।

REST + JSONGET requestsSingle और bulkCountry context

बुनियादी उपयोग

अपना पहला GenderAPI request भेजें

एक input value भेजकर predicted gender, probability, country और usage information पाएँ। Name के लिए base endpoint और उपलब्ध data email या username होने पर उसका dedicated endpoint इस्तेमाल करें।

प्रमाणीकरण

key query parameter से API key जोड़ें। Production keys अपने server पर रखें—private key को browser code या public repository में expose न करें।

प्रमाणीकरण गाइड पढ़ें →
मशीन-पठनीय API संसाधन

वर्तमान GenderAPI अनुबंध को OpenAPI, Swagger या Postman प्रारूप में उपयोग करें।

GET

Name से gender

First name या full name

Input first name या full name हो तो base endpoint इस्तेमाल करें।

https://api.genderapi.io/api
cURL
curl "https://api.genderapi.io/api?name=Alice&key=YOUR_API_KEY"

वैकल्पिक पैरामीटर

ParameterTypeDescription
countrystringIN या US जैसा two-letter country code।
askToAIbooleantrue होने पर database में name न मिलने पर AI fallback से analysis माँगा जाता है।
forceToGenderizebooleanऐसे unusual inputs का prediction try करता है जो human name जैसे न दिखें।
सावधानी से इस्तेमाल करें: Fantasy names, nicknames या low-signal inputs पर forced predictions कम accurate हो सकते हैं।
GET

Email से gender

Email address

Email endpoint gender detection से पहले address से संभावित name extract करता है।

https://api.genderapi.io/api/email
cURL
curl "https://api.genderapi.io/api/email?email=alice.smith%40example.com&country=IN&askToAI=true&key=YOUR_API_KEY"
forceToGenderize इस endpoint में उपलब्ध नहीं है क्योंकि name internally extract होता है।
GET

Username से gender

Social username

ऐसे usernames, handles और nicknames के लिए यह endpoint इस्तेमाल करें जिनमें recognizable name हो सकता है।

https://api.genderapi.io/api/username
cURL
curl "https://api.genderapi.io/api/username?username=sparkling_unicorn&country=IN&askToAI=true&forceToGenderize=true&key=YOUR_API_KEY"

JSON response

GenderAPI response को समझें

तीनों endpoints एक core response structure इस्तेमाल करते हैं।

200 OK
{
  "status": true,
  "used_credits": 1,
  "remaining_credits": 4999,
  "expires": 1743659200,
  "q": "Alice",
  "name": "alice",
  "gender": "female",
  "country": "US",
  "total_names": 325,
  "probability": 98,
  "duration": "4ms"
}

Response fields की जानकारी

FieldTypeDescription
statusbooleanRequest सफलतापूर्वक पूरा हुआ या नहीं।
used_creditsintegerइस request में इस्तेमाल हुए API credits।
remaining_creditsintegerRequest के बाद बचे API credits।
expiresintegerPackage expiry time का UNIX timestamp।
qstringOriginal name, email या username query।
namestringNormalized या input से निकाला गया first name।
genderstringPredicted gender: male, female या "null"।
countrystringसबसे संभावित ISO 3166-1 alpha-2 country code।
total_namesintegerPrediction के पीछे उपलब्ध name records की संख्या।
probabilityintegerप्रतिशत में prediction probability।
durationstringRequest का server processing time।

Input values को हमेशा URL-encode करें

Spaces और special characters आपके HTTP client से encode होने चाहिए। उदाहरण के लिए raw space की जगह sparkling%20unicorn इस्तेमाल करें।

आगे बढ़ें

अपने workflow के लिए गाइड चुनें

नाम के अनुरोधएकल और bulk उदाहरण →क्लाइंट लाइब्रेरीअपनी पसंद की programming language चुनें →त्रुटि प्रबंधनStatus और error reference →