Username Generator API - Ruby Gem
Username Generator is a simple tool for generating usernames. It returns a list of usernames based on the specified criteria.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_usernamegenerator'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_usernamegenerator
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_usernamegenerator'
# Initialize the client
client = APIVerve::Usernamegenerator::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
email: "sean@mail.com",
count: 1
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ email: "sean@mail.com", count: 1 })
puts response["data"]
rescue APIVerve::Usernamegenerator::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Usernamegenerator::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Usernamegenerator::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"count": 10,
"suggestions": [
"doxologysean",
"sean",
"downpoursean",
"tonsilarsean",
"interdependencysean",
"seantrivant",
"seansquireen",
"seankillifish",
"seantiltyard",
"seaninterrupt"
],
"email": "sean@mail.com"
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://usernamegenerator.apiverve.com?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.