Ruby - Validate API

Step 1 - Add the Client with the Gem Package Manager

Add the Ruby client to your Gemfile:

gem 'cloudmersive-validate-api-client', '~> 1.2.9'

Step 2 - Create an API Client object with API Key

Get your API Key (available in your Account Dashboard) and instantiate the API Client object:

# Load the gem
require 'cloudmersive-validate-api-client'

# Setup authorization
CloudmersiveValidateApiClient.configure do |config|
    # Configure API key authorization: Apikey
    config.api_key['Apikey'] = 'YOUR API KEY'
    # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
    #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveValidateApiClient::DomainApi.new

domain = "domain_example" # String | Domain name to check, for example \"cloudmersive.com\".  The input is a string so be sure to enclose it in double-quotes.


begin
    #Validate a domain name
    result = api_instance.domain_check(domain)
    p result
rescue CloudmersiveValidateApiClient::ApiError => e
    puts "Exception when calling DomainApi->domain_check: #{e}"
end




Ruby Client - Image API

Step 1 - Add the Client with the Gem Package Manager

Add the Ruby client to your Gemfile:

gem 'cloudmersive-image-recognition-api-client', '~> 1.2.9'

Step 2 - Create an API Client object with API Key

Get your API Key (available in your Account Dashboard) and instantiate the API Client object:

# Load the gem
require 'cloudmersive-image-recognition-api-client'

# Setup authorization
CloudmersiveImageRecognitionApiClient.configure do |config|
    # Configure API key authorization: Apikey
    config.api_key['Apikey'] = 'YOUR API KEY'
    # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
    #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveImageRecognitionApiClient::ArtisticApi.new

style = "style_example" # String | The style of the painting to apply.  To start, try \"udnie\" a painting style.  Possible values are: \"udnie\", \"wave\", \"la_muse\", \"rain_princess\".

image_file = File.new("/path/to/file.txt") # File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.


begin
    #Transform an image into an artistic painting automatically
    result = api_instance.artistic_painting(style, image_file)
    p result
rescue CloudmersiveImageRecognitionApiClient::ApiError => e
    puts "Exception when calling ArtisticApi->artistic_painting: #{e}"
end


Ruby Client - Convert API

Step 1 - Add the Client with the Gem Package Manager

Add the Ruby client to your Gemfile:

gem 'cloudmersive-convert-api-client', '~> 1.2.9'

Step 2 - Create an API Client object with API Key

Import the API Client package by adding this line to the top of your .js file:

# Load the gem
require 'cloudmersive-convert-api-client'

# Setup authorization
CloudmersiveConvertApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveConvertApiClient::CompareDocumentApi.new

input_file1 = File.new("/path/to/file.txt") # File | First input file to perform the operation on.

input_file2 = File.new("/path/to/file.txt") # File | Second input file to perform the operation on (more than 2 can be supplied).


begin
  #Compare Two Word DOCX
  result = api_instance.compare_document_docx(input_file1, input_file2)
  p result
rescue CloudmersiveConvertApiClient::ApiError => e
  puts "Exception when calling CompareDocumentApi->compare_document_docx: #{e}"
end


Ruby Client - Natural Language Processing (NLP) API

Step 1 - Add the Ruby Client with the Gem Package Manager

Add the Ruby client to your Gemfile:

gem 'cloudmersive-nlp-api-client', '~> 1.2.9'

Step 2 - Create an API Client object with API Key

Import the API Client package by adding this line to the top of your .js file:

# Load the gem
require 'cloudmersive-nlp-api-client'

# Setup authorization
CloudmersiveNlpApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveNlpApiClient::ExtractEntitiesStringApi.new

value = "value_example" # String | Input string


begin
  #Extract entities from string
  result = api_instance.extract_entities_string_post(value)
  p result
rescue CloudmersiveNlpApiClient::ApiError => e
  puts "Exception when calling ExtractEntitiesStringApi->extract_entities_string_post: #{e}"
end


Ruby Client - Optical Character Recognition (OCR) API

Step 1 - Add the Client with the Gem Package Manager

Add the Ruby client to your Gemfile:

gem 'cloudmersive-ocr-api-client', '~> 1.2.9'

Step 2 - Create an API Client object with API Key

Get your API Key (available in your Account Dashboard) and instantiate the API Client object:

# Load the gem
require 'cloudmersive-ocr-api-client'

# Setup authorization
CloudmersiveOcrApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveOcrApiClient::ImageOcrApi.new

image_file = File.new("/path/to/file.txt") # File | Image file to perform OCR on.  Common file formats such as PNG, JPEG are supported.

opts = { 
  language: "language_example" # String | Optional, language of the input document, default is English (ENG).  Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
}

begin
  #Convert a photo of a document into text
  result = api_instance.image_ocr_photo_to_text(image_file, opts)
  p result
rescue CloudmersiveOcrApiClient::ApiError => e
  puts "Exception when calling ImageOcrApi->image_ocr_photo_to_text: #{e}"
end


Ruby Client - Barcode API

Step 1 - Add the Client with the Gem Package Manager

Add the Ruby client to your Gemfile:

gem 'cloudmersive-barcode-api-client', '~> 1.2.9'

Step 2 - Create an API Client object with API Key

Get your API Key (available in your Account Dashboard) and instantiate the API Client object:

# Load the gem
require 'cloudmersive-barcode-api-client'

# Setup authorization
CloudmersiveBarcodeApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveBarcodeApiClient::BarcodeLookupApi.new

value = "value_example" # String | Barcode value


begin
  #Lookup a barcode value and return product data
  result = api_instance.barcode_lookup_ean_lookup(value)
  p result
rescue CloudmersiveBarcodeApiClient::ApiError => e
  puts "Exception when calling BarcodeLookupApi->barcode_lookup_ean_lookup: #{e}"
end


Ruby Client - Virus Scan API

Step 1 - Add the Client with the Gem Package Manager

Add the Ruby client to your Gemfile:

gem 'cloudmersive-virus-scan-api-client', '~> 1.2.9'

Step 2 - Create an API Client object with API Key

Import the API Client package by adding this line to the top of your .js file:

# Load the gem
require 'cloudmersive-virus-scan-api-client'

# Setup authorization
CloudmersiveVirusScanApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveVirusScanApiClient::ScanApi.new

input_file = File.new("/path/to/file.txt") # File | Input file to perform the operation on.


begin
  #Scan a file for viruses
  result = api_instance.scan_file(input_file)
  p result
rescue CloudmersiveVirusScanApiClient::ApiError => e
  puts "Exception when calling ScanApi->scan_file: #{e}"
end


50,000 free API calls/month, no credit card required

Get started now!