Class: GoogleSearch
- Inherits:
-
SerpApiSearch
- Object
- SerpApiSearch
- GoogleSearch
- Defined in:
- lib/search/google_search.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 = GoogleSearch.new(parameter) search.params = “Portland”
html_results = search.get_html hash_results = search.get_hash json_results = search.get_json “‘
Constant Summary
Constants inherited from SerpApiSearch
SerpApiSearch::BACKEND, SerpApiSearch::VERSION
Instance Attribute Summary
Attributes inherited from SerpApiSearch
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ GoogleSearch
constructor
A new instance of GoogleSearch.
Methods inherited from SerpApiSearch
#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 = {}) ⇒ GoogleSearch
Returns a new instance of GoogleSearch.
34 35 36 37 |
# File 'lib/search/google_search.rb', line 34 def initialize(params = {}) super(params, GOOGLE_ENGINE) check_params([:q, :engine]) end |