Gender Detector API - Ruby Gem

Easily detect the gender of an individual based on their name. This API uses AI to predict the likely gender of a person by their name

Installation

Add this line to your application's Gemfile:

gem 'apiverve_genderdetector'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_genderdetector

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_genderdetector'

# Initialize the client
client = APIVerve::Genderdetector::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({
  name: "John Mcdonald",
  country: "us"
})

# Print the response
puts response

Error Handling

begin
  response = client.execute({ name: "John Mcdonald", country: "us" })
  puts response["data"]
rescue APIVerve::Genderdetector::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Genderdetector::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Genderdetector::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "name": "John Mcdonald",
    "country": "US",
    "detected": true,
    "gender": "male"
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.