Birthstones API - Ruby Gem
Birthstones is a comprehensive lookup API for birthstone information. It returns detailed data about gemstones associated with each birth month, including the primary stone, alternate stones, colors, meanings, and zodiac associations.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_birthstones'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_birthstones
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_birthstones'
# Initialize the client
client = APIVerve::Birthstones::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ month: "5" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ month: "5" })
puts response["data"]
rescue APIVerve::Birthstones::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Birthstones::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Birthstones::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"month": 5,
"monthName": "May",
"primaryStone": "Emerald",
"alternateStones": [
"Chrysoprase",
"Agate"
],
"color": "Green",
"meaning": "Rebirth, love, fertility",
"zodiacSigns": [
"Taurus",
"Gemini"
],
"hardness": 7.5,
"mineralFamily": "Beryl",
"anniversaryYear": 55
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/birthstones?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.