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
اكتشاف احترافي للجنس لتطبيقاتك
Gender-API.com يقدّم لك تحديد جنس الاسم بمستوى مؤسسي وبدقة 99.5% عبر أكثر من 150 دولة. واجهة الـAPI المتخصصة عندنا تتفوّق على حلول الذكاء الاصطناعي العامة بسرعات استجابة أسرع بـ10 إلى 90 مرة، وبدقة أعلى بنسبة 9% إلى 34%.
ليش تختار Gender-API بدل الذكاء الاصطناعي العام؟
- مصمّم خصيصًا متخصص في تحديد gender، وليس ذكاءً اصطناعيًا عامًا متعدد الاستخدامات
- سرعة البرق : أوقات استجابة أقل من 100 ملّي ثانية مقابل ثوانٍ مع الذكاء الاصطناعي العام
- أكثر دقة دقّة 99.5% مع ذكاء ثقافي وإقليمي
- Larger Database : 9+ million names, 37% more than typical AI training data
- Reliable : 99.9% uptime SLA with predictable performance
Key Features
- Easy integration with just a few lines of code
- Batch processing for high-volume applications
- Country-specific accuracy for regional name variations
- Smart normalization handling typos and variants
- GDPR compliant and enterprise-ready
ابدأ مجانًا اليوم
Get 100 free API calls per month with no credit card required. Scale as you grow with flexible pricing for every use case.