Love Calculator API - Ruby Gem
Love Calculator is a simple tool for calculating love compatibility. It returns the love compatibility percentage between two names.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_lovecalculator'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_lovecalculator
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_lovecalculator'
# Initialize the client
client = APIVerve::Lovecalculator::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
name1: "John",
name2: "Jane"
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ name1: "John", name2: "Jane" })
puts response["data"]
rescue APIVerve::Lovecalculator::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Lovecalculator::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Lovecalculator::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"name1": "Jane",
"name2": "John",
"lovePercentage": "62%",
"response": "You have good chemistry. Keep getting to know each other and see where it leads.",
"additionalText": "The love percentage between Jane and John is 62%."
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/lovecalculator?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.