Random Data Generator API - Ruby Gem
Random Generator is a simple tool for generating random data. It returns random data such as numbers, strings, and more.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_randomgenerator'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_randomgenerator
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_randomgenerator'
# Initialize the client
client = APIVerve::Randomgenerator::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
type: "number",
count: 1,
includeAvatar: true
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ type: "number", count: 1, includeAvatar: true })
puts response["data"]
rescue APIVerve::Randomgenerator::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Randomgenerator::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Randomgenerator::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"type": "phone",
"count": 10,
"data": [
"967-950-4587",
"792-611-7468 x1293",
"(933) 311-9829",
"389.357.7403 x793",
"1-621-490-6394",
"1-699-562-6833 x8558",
"875.226.1530 x641",
"744-991-0150 x1974",
"1-393-784-0533 x15199",
"954-876-6958 x0398"
]
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://randomgenerator.apiverve.com?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.