Text to Emoji API - Ruby Gem
Text to Emoji is a simple tool for converting text into emojis. It returns the emojis that represent the given text.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_texttoemoji'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_texttoemoji
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_texttoemoji'
# Initialize the client
client = APIVerve::Texttoemoji::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ text: "I am so excited to go to the lake and swim" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ text: "I am so excited to go to the lake and swim" })
puts response["data"]
rescue APIVerve::Texttoemoji::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Texttoemoji::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Texttoemoji::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"emojis": [
"ππΎ",
"β¨π",
"π₯ππ½",
"ππΎπͺπΎ",
"π₯π€πΌ",
"π€π½π₯",
"π€©ππ»",
"πππ",
"π",
"ππ½ππ½"
]
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/texttoemoji?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.