Ruby Client
Elegant Ruby client for Gender-API.com designed for Rails, Sinatra, and Ruby applications. Our AI-powered API delivers 99.5% accurate gender detection with beautiful, idiomatic Ruby syntax. Process names in under 100ms with 10x-90x better performance than generic AI models. The gem provides simple methods for single and batch lookups, perfect for user registration, email personalization, and CRM integration. Unlike ChatGPT or other LLMs, our specialized database contains 37% more names with country-specific accuracy across 150+ countries. Supports smart normalization and handles international character sets. Start free with 100 monthly API calls. GDPR compliant and trusted globally.
require 'net/http'
require 'json'
require 'uri'
# Determine the gender of a first name using API V2
# ---------------------------------------------------
api_key = 'YOUR_API_KEY' # Get your key at https://gender-api.com/en/account/auth-tokens
uri = URI('https://gender-api.com/v2/gender/by-first-name')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = "Bearer #{api_key}"
request.body = JSON.dump({ first_name: 'Theresa' })
begin
response = http.request(request)
# Parse the JSON response
result = JSON.parse(response.read_body)
puts "Gender: #{result['gender']}"
puts "Probability: #{result['probability']}"
rescue StandardError => e
puts "Error: #{e.message}"
end
Rilevamento professionale del genere per le tue applicazioni
Gender-API.com offre un rilevamento del gender di livello enterprise con un’accuratezza del 99,5% in oltre 150 Paesi. La nostra API specializzata supera le soluzioni AI generiche con tempi di risposta 10-90 volte più rapidi e una precisione migliore del 9-34%.
Perché scegliere Gender-API invece di un’IA generica?
- Progettato appositamente : Specializzato per il rilevamento del gender, non un'AI per uso generale
- Fulmineo : Tempi di risposta sotto i 100 ms vs. secondi con l’IA generica
- Più preciso Accuratezza del 99,5% con intelligenza culturale e regionale
- Database più grande 9+ milioni di nomi, il 37% in più rispetto ai tipici dati di addestramento dell’IA
- Affidabile SLA con uptime del 99,9% e prestazioni prevedibili
Funzionalità principali
- Integrazione facile con poche righe di codice
- Elaborazione in batch per applicazioni ad alto volume
- Precisione specifica per Paese per le varianti regionali dei nomi
- Normalizzazione intelligente per gestire refusi e varianti
- Conforme al GDPR e pronto per l’uso in ambito enterprise
Inizia gratis oggi
Ottieni 100 chiamate API gratuite al mese, senza bisogno di carta di credito. Scala man mano che cresci, con prezzi flessibili per ogni caso d’uso.