×

Ruby client library

How to use the Autocomplete API with Ruby

Use Ruby client library to integrate AutoComplete API into your Ruby application

require "unirest" # install from: http://unirest.io/ruby.html

#Replace the following string value with your valid X-RapidAPI-Key.
Your_X_RapidAPI_Key = "XXXXXXXXXXXXXXXXXXX"

#The query parameters: Update according to your search query.
q = "tay"; #the search query
response = Unirest.get "https://contextualwebsearch-websearch-v1.p.rapidapi.com/api/spelling/AutoComplete?text=#{q}",
  headers:{
    "X-RapidAPI-Key":Your_X_RapidAPI_Key
  }
end