Class: GoogleSearchResults

Inherits:
SerpApiClient show all
Defined in:
lib/google_search_results.rb

Overview

Google Search Result for Ruby powered by SerpApi

Search API Usage

“‘ruby parameter =

q: "query",
google_domain: "Google Domain", 
location: "Location Requested", 
device: device,
hl: "Google UI Language",
gl: "Google Country",
safe: "Safe Search Flag",
num: "Number of Results",
start: "Pagination Offset",
tbm: "to be matched field",
tbs: "to be searched field",
api_key: "Your SERP API Key"

search = GoogleSearchResults.new(parameter) search.params = “Portland”

html_results = search.get_html hash_results = search.get_hash json_results = search.get_json “‘

doc: serpapi.com/search-api

Constant Summary

Constants inherited from SerpApiClient

SerpApiClient::BACKEND, SerpApiClient::VERSION

Instance Attribute Summary

Attributes inherited from SerpApiClient

#params

Instance Method Summary collapse

Methods inherited from SerpApiClient

#api_key, api_key=, #construct_url, #engine, #get_account, #get_hash, #get_hash_with_images, #get_html, #get_json, #get_json_with_images, #get_location, #get_search_archive, serp_api_key=

Constructor Details

#initialize(params = {}) ⇒ GoogleSearchResults

Returns a new instance of GoogleSearchResults.



34
35
36
37
# File 'lib/google_search_results.rb', line 34

def initialize(params = {})
  super(params, GOOGLE_ENGINE)
  check_params([:q, :engine])
end