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.message}"
  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

License

This gem is available under the MIT License.