Open hartator opened 2 years ago
Happened again
Request: {
:engine=>"yahoo",
:p=>"serpapi",
:api_key=>"<censored>"
}
/home/<censored>/.gem/ruby/3.0.0/gems/google_search_results-2.2.0/lib/search/serp_api_search.rb:178:in `check_params': missing required keys in params: (SerpApiException)
- q
from /home/<censored>/.gem/ruby/3.0.0/gems/google_search_results-2.2.0/lib/search/google_search.rb:36:in `initialize'
from se_everywhere.rb:41:in `new'
from se_everywhere.rb:41:in `block in <main>'
from se_everywhere.rb:32:in `each'
from se_everywhere.rb:32:in `<main>'
Actually,
The library the right, and playground is false.
Yahoo requirements are already defined under the YahooSearch
class:
class YahooSearch < SerpApiSearch
def initialize(params = {})
super(params, YAHOO_ENGINE)
check_params([:p, :engine])
end
...
end
By replacing the GoogleSearch
class by YahooSearch
.
It's now working.
We should fix code generation from API Playground to change class depending of the engine used.
I'm still facing the same issue with yahoo
This is resolved by https://github.com/serpapi/serpapi-ruby The gem should be published soon.
+1 Seeing this issue when using the google_search_results ruby gem. Is there a pending fix for this? Also, I noticed the gem for the https://github.com/serpapi/serpapi-ruby library doesn't exist and that the library is in draft stage at the moment. I want to suggest adding a note about it in the github documentation (readme, etc) can be helpful.
We have several engines that work without a
q
parameter.For example, Yande uses
text
:And you can't submit your search to the API.
Hash with all engines that don't use
q
parameter:We can explicitly check on this but I think it will easier to just drop the requirement of a
q
parameter for all engines.