Scrabble Word Scorer API - Ruby Gem
Scrabble Word Scorer is a tool for calculating Scrabble points for words. It supports multiple languages including English, French, Spanish, German, and Italian with language-specific letter values.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_scrabblescorer'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_scrabblescorer
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_scrabblescorer'
# Initialize the client
client = APIVerve::Scrabblescorer::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
word: "QUIZ",
language: "english"
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ word: "QUIZ", language: "english" })
puts response["data"]
rescue APIVerve::Scrabblescorer::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Scrabblescorer::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Scrabblescorer::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"word": "QUIZ",
"language": "english",
"total_score": 22,
"letter_count": 4,
"letter_scores": [
{
"letter": "Q",
"score": 10
},
{
"letter": "U",
"score": 1
},
{
"letter": "I",
"score": 1
},
{
"letter": "Z",
"score": 10
}
],
"highest_scoring_letter": {
"letter": "Q",
"score": 10
},
"average_letter_score": 5.5,
"note": "Scores do not include board multipliers (double/triple letter/word)"
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/scrabblescorer?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.