class ClearbitApi::Company
Public Class Methods
search(company)
click to toggle source
# File lib/clearbit_api.rb, line 6 def self.search(company) # get call on REST API base_url = "https://autocomplete.clearbit.com/v1/companies/suggest?query=" response = HTTParty.get(base_url + company) # parse data begin data = JSON.parse(response.body, {symbolize_names: true}) rescue JSON::ParserError data = {error: "Clearbit Error"} end end