Lottery Numbers API - Ruby Gem
Lottery Numbers is a simple tool for looking up winning lottery numbers. It returns the winning lottery numbers based on the lottery name provided. Supports Powerball, Mega Millions, EuroMillions, and Canada Lotto Max with historical data lookup.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_lottery'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_lottery
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_lottery'
# Initialize the client
client = APIVerve::Lottery::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
numbers: "powerball",
date: "2024-01-15"
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ numbers: "powerball", date: "2024-01-15" })
puts response["data"]
rescue APIVerve::Lottery::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Lottery::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Lottery::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"lotteryType": "megamillions",
"drawDate": "2026-02-04",
"numbers": [
10,
50,
55,
58,
59,
5
],
"megaBall": 5,
"jackpot": "$70 Million"
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://lottery.apiverve.com?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.