Dog Breeds API - Ruby Gem
Dog Breeds is a simple tool for getting information about dog breeds. It returns information such as breed name, temperament, lifespan, and more.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_dogbreeds'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_dogbreeds
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_dogbreeds'
# Initialize the client
client = APIVerve::Dogbreeds::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ breed: "beagle" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ breed: "beagle" })
puts response["data"]
rescue APIVerve::Dogbreeds::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Dogbreeds::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Dogbreeds::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"breed": "beagle",
"foundCount": 1,
"foundBreeds": [
{
"name": "Beagle",
"weight": {
"lowerLbs": 20,
"upperLbs": 35
},
"height": {
"lowerInches": 13,
"upperInches": 15
},
"bredFor": "rabbit, hare hunting",
"group": "hound",
"life_span": {
"lowerYears": 13,
"upperYears": 16
},
"traits": [
"amiable",
"even tempered",
"excitable",
"determined",
"gentle",
"intelligent"
]
}
]
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/dogbreeds?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.