Go / Golang Client

High-performance Go client for Gender-API.com built with native Go idioms and standard libraries. Our specialized API provides 99.5% accurate gender detection in under 100ms, perfect for concurrent processing and microservices. The client supports goroutines for parallel batch processing and includes proper context handling. Unlike generic AI solutions that are slow and resource-intensive, our API is 10x-90x faster with superior accuracy. Ideal for high-throughput applications, data pipelines, and cloud-native services. Access over 9 million names across 150+ countries with intelligent fallback. Memory-efficient and production-ready with comprehensive error handling. Start free with 100 API calls monthly.

सबसे पहले composer के साथ हमारी लाइब्रेरी स्थापित करें:

यहाँ पूरी क्लाइंट दस्तावेज़ीकरण देखें:

https://github.com/markus-perl/gender-api-client

सबसे पहले npm के साथ हमारी लाइब्रेरी स्थापित करें:

यहाँ पूरी क्लाइंट दस्तावेज़ीकरण देखें:

https://github.com/markus-perl/gender-api-client-npm

सबसे पहले npm के साथ हमारी लाइब्रेरी स्थापित करें:

यहाँ पूरी क्लाइंट दस्तावेज़ीकरण देखें:

https://github.com/markus-perl/gender-api-client-npm

सबसे पहले pip से हमारी लाइब्रेरी इंस्टॉल करो:

यहाँ पूरी क्लाइंट दस्तावेज़ीकरण देखें:

https://github.com/markus-perl/gender-api-client-python
https://pypi.org/project/gender-api-client/

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

// Response defines the structure of the JSON response from Gender-API.com
type Response struct {
    ResultFound bool    `json:"result_found"`
    FirstName   string  `json:"first_name"`
    Gender      string  `json:"gender"`
    Probability float64 `json:"probability"`
}

func main() {
    // Determine the gender of a first name using API V2
    // ---------------------------------------------------
    apiKey := "YOUR_API_KEY" // Get your key at https://gender-api.com/en/account/auth-tokens
    firstName := "Theresa"

    // Construct the JSON payload
    requestBody, _ := json.Marshal(map[string]string{
        "first_name": firstName,
    })

    // Create the request
    req, err := http.NewRequest("POST", "https://gender-api.com/v2/gender/by-first-name", bytes.NewBuffer(requestBody))
    if err != nil {
        fmt.Printf("Error creating request: %s\n", err)
        return
    }

    // Set headers
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer "+apiKey)

    // Perform the request
    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        fmt.Printf("Error making request: %s\n", err)
        return
    }
    defer resp.Body.Close()

    // Read the response body
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Printf("Error reading response: %s\n", err)
        return
    }

    // Parse the JSON response
    var result Response
    if err := json.Unmarshal(body, &result); err != nil {
        fmt.Printf("Error parsing JSON: %s\n", err)
        return
    }

    // Output the result
    fmt.Printf("Name: %s\n", result.FirstName)
    fmt.Printf("Gender: %s\n", result.Gender)
    fmt.Printf("Probability: %.2f\n", result.Probability)
}

तुमच्या अॅप्लिकेशन्ससाठी प्रोफेशनल लिंग ओळख

Gender-API.com 150+ देशों में 99.5% सटीकता के साथ एंटरप्राइज़-ग्रेड gender detection देता है। हमारा specialized API, generic AI solutions की तुलना में 10x-90x तेज़ response times और 9-34% बेहतर accuracy के साथ साफ़ तौर पर आगे है।

क्यों चुनो Gender-API को Generic AI के बजाय?

  • उद्देश्य के लिए विशेष रूप से बनाया गया : जेंडर पहचान के लिए खास तौर पर बनाया गया है, यह सामान्य उपयोग वाला AI नहीं है
  • अत्यंत तेज़ : सामान्य AI की तुलना में 100ms से कम रिस्पॉन्स टाइम — सेकंड्स नहीं
  • और भी ज़्यादा सटीक सांस्कृतिक और क्षेत्रीय समझ के साथ 99.5% सटीकता
  • और भी बड़ा डेटाबेस 9+ मिलियन नाम, सामान्य AI प्रशिक्षण डेटा की तुलना में 37% ज़्यादा
  • विश्वसनीय 99.9% अपटाइम SLA, साथ में भरोसेमंद और अनुमानित परफॉर्मेंस

मुख्य विशेषताएँ

  • सिर्फ़ कुछ लाइनों के कोड के साथ आसान इंटीग्रेशन
  • उच्च-वॉल्यूम ऐप्लिकेशनों के लिए बैच प्रोसेसिंग
  • क्षेत्रीय नामों के अलग-अलग रूपों के लिए देश-विशिष्ट सटीकता
  • टाइपो और अलग-अलग वैरिएंट्स को स्मार्ट तरीके से नॉर्मलाइज़ करने की सुविधा
  • GDPR के अनुरूप और एंटरप्राइज़ के लिए तैयार

आज ही मुफ़्त में शुरू करो

हर महीने 100 मुफ्त API कॉल्स पाओ — बिना क्रेडिट कार्ड के। जैसे-जैसे तुम बढ़ो, हर यूज़ केस के लिए लचीली प्राइसिंग के साथ आसानी से स्केल करो।

संवाद