Class: ScrapeBadger::DuckDuckGoApi
- Inherits:
-
Object
- Object
- ScrapeBadger::DuckDuckGoApi
- Defined in:
- lib/scrapebadger/api/duck_duck_go_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#duckduckgo_duckduckgo_scraper_health_check(opts = {}) ⇒ Object
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
-
#duckduckgo_duckduckgo_scraper_health_check_head(opts = {}) ⇒ Object
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
-
#duckduckgo_duckduckgo_scraper_health_check_head_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
-
#duckduckgo_duckduckgo_scraper_health_check_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
-
#duckduckgo_image_search(query, opts = {}) ⇒ Object
Image search DuckDuckGo image search with size/color/type/layout/license filters.
-
#duckduckgo_image_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Image search DuckDuckGo image search with size/color/type/layout/license filters.
-
#duckduckgo_instant_answer(query, opts = {}) ⇒ Object
Instant Answer DuckDuckGo Instant Answer — abstract, definition, direct answer, related topics.
-
#duckduckgo_instant_answer_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Instant Answer DuckDuckGo Instant Answer — abstract, definition, direct answer, related topics.
-
#duckduckgo_list_supported_regions(opts = {}) ⇒ Object
List supported regions The full DuckDuckGo region (kl) code list.
-
#duckduckgo_list_supported_regions_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
List supported regions The full DuckDuckGo region (kl) code list.
-
#duckduckgo_news_search(query, opts = {}) ⇒ Object
News search DuckDuckGo news search — headline, source, excerpt, unix + ISO date, image.
-
#duckduckgo_news_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
News search DuckDuckGo news search — headline, source, excerpt, unix + ISO date, image.
-
#duckduckgo_search_suggestions(query, opts = {}) ⇒ Object
Search suggestions DuckDuckGo search-box suggestions.
-
#duckduckgo_search_suggestions_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Search suggestions DuckDuckGo search-box suggestions.
-
#duckduckgo_video_search(query, opts = {}) ⇒ Object
Video search DuckDuckGo video search — title, publisher, uploader, duration, views, thumbnails.
-
#duckduckgo_video_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Video search DuckDuckGo video search — title, publisher, uploader, duration, views, thumbnails.
-
#duckduckgo_web_search(query, opts = {}) ⇒ Object
Web search DuckDuckGo web SERP — organic results, the zero-click abstract box, ads flagged.
-
#duckduckgo_web_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Web search DuckDuckGo web SERP — organic results, the zero-click abstract box, ads flagged.
-
#initialize(api_client = ApiClient.default) ⇒ DuckDuckGoApi
constructor
A new instance of DuckDuckGoApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ DuckDuckGoApi
Returns a new instance of DuckDuckGoApi.
19 20 21 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#duckduckgo_duckduckgo_scraper_health_check(opts = {}) ⇒ Object
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
26 27 28 29 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 26 def duckduckgo_duckduckgo_scraper_health_check(opts = {}) data, _status_code, _headers = duckduckgo_duckduckgo_scraper_health_check_with_http_info(opts) data end |
#duckduckgo_duckduckgo_scraper_health_check_head(opts = {}) ⇒ Object
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
83 84 85 86 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 83 def duckduckgo_duckduckgo_scraper_health_check_head(opts = {}) data, _status_code, _headers = duckduckgo_duckduckgo_scraper_health_check_head_with_http_info(opts) data end |
#duckduckgo_duckduckgo_scraper_health_check_head_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 92 def duckduckgo_duckduckgo_scraper_health_check_head_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check_head ...' end # resource path local_var_path = '/v1/duckduckgo/health' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check_head", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_duckduckgo_scraper_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_duckduckgo_scraper_health_check_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
DuckDuckGo scraper health check Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 35 def duckduckgo_duckduckgo_scraper_health_check_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check ...' end # resource path local_var_path = '/v1/duckduckgo/health' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_duckduckgo_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_image_search(query, opts = {}) ⇒ Object
Image search DuckDuckGo image search with size/color/type/layout/license filters.
149 150 151 152 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 149 def duckduckgo_image_search(query, opts = {}) data, _status_code, _headers = duckduckgo_image_search_with_http_info(query, opts) data end |
#duckduckgo_image_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Image search DuckDuckGo image search with size/color/type/layout/license filters.
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 167 def duckduckgo_image_search_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_image_search ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_image_search" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_image_search, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_image_search, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/duckduckgo/images' # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = query query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil? query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil? query_params[:'color'] = opts[:'color'] if !opts[:'color'].nil? query_params[:'image_type'] = opts[:'image_type'] if !opts[:'image_type'].nil? query_params[:'layout'] = opts[:'layout'] if !opts[:'layout'].nil? query_params[:'license'] = opts[:'license'] if !opts[:'license'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_image_search", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_image_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_instant_answer(query, opts = {}) ⇒ Object
Instant Answer DuckDuckGo Instant Answer — abstract, definition, direct answer, related topics.
237 238 239 240 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 237 def duckduckgo_instant_answer(query, opts = {}) data, _status_code, _headers = duckduckgo_instant_answer_with_http_info(query, opts) data end |
#duckduckgo_instant_answer_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Instant Answer DuckDuckGo Instant Answer — abstract, definition, direct answer, related topics.
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 247 def duckduckgo_instant_answer_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_instant_answer ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_instant_answer" end # resource path local_var_path = '/v1/duckduckgo/instant' # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = query # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_instant_answer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_instant_answer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_list_supported_regions(opts = {}) ⇒ Object
List supported regions The full DuckDuckGo region (kl) code list.
300 301 302 303 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 300 def duckduckgo_list_supported_regions(opts = {}) data, _status_code, _headers = duckduckgo_list_supported_regions_with_http_info(opts) data end |
#duckduckgo_list_supported_regions_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
List supported regions The full DuckDuckGo region (kl) code list.
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 309 def duckduckgo_list_supported_regions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_list_supported_regions ...' end # resource path local_var_path = '/v1/duckduckgo/regions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_list_supported_regions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_list_supported_regions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_news_search(query, opts = {}) ⇒ Object
News search DuckDuckGo news search — headline, source, excerpt, unix + ISO date, image.
362 363 364 365 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 362 def duckduckgo_news_search(query, opts = {}) data, _status_code, _headers = duckduckgo_news_search_with_http_info(query, opts) data end |
#duckduckgo_news_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
News search DuckDuckGo news search — headline, source, excerpt, unix + ISO date, image.
376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 376 def duckduckgo_news_search_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_news_search ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_news_search" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_news_search, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_news_search, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/duckduckgo/news' # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = query query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil? query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil? query_params[:'timelimit'] = opts[:'timelimit'] if !opts[:'timelimit'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_news_search", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_news_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_search_suggestions(query, opts = {}) ⇒ Object
Search suggestions DuckDuckGo search-box suggestions.
443 444 445 446 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 443 def duckduckgo_search_suggestions(query, opts = {}) data, _status_code, _headers = duckduckgo_search_suggestions_with_http_info(query, opts) data end |
#duckduckgo_search_suggestions_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Search suggestions DuckDuckGo search-box suggestions.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 454 def duckduckgo_search_suggestions_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_search_suggestions ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_search_suggestions" end # resource path local_var_path = '/v1/duckduckgo/autocomplete' # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = query query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_search_suggestions", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_search_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_video_search(query, opts = {}) ⇒ Object
Video search DuckDuckGo video search — title, publisher, uploader, duration, views, thumbnails.
514 515 516 517 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 514 def duckduckgo_video_search(query, opts = {}) data, _status_code, _headers = duckduckgo_video_search_with_http_info(query, opts) data end |
#duckduckgo_video_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Video search DuckDuckGo video search — title, publisher, uploader, duration, views, thumbnails.
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 529 def duckduckgo_video_search_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_video_search ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_video_search" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_video_search, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_video_search, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/duckduckgo/videos' # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = query query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil? query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'duration'] = opts[:'duration'] if !opts[:'duration'].nil? query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_video_search", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_video_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#duckduckgo_web_search(query, opts = {}) ⇒ Object
Web search DuckDuckGo web SERP — organic results, the zero-click abstract box, ads flagged.
600 601 602 603 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 600 def duckduckgo_web_search(query, opts = {}) data, _status_code, _headers = duckduckgo_web_search_with_http_info(query, opts) data end |
#duckduckgo_web_search_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>
Web search DuckDuckGo web SERP — organic results, the zero-click abstract box, ads flagged.
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
# File 'lib/scrapebadger/api/duck_duck_go_api.rb', line 614 def duckduckgo_web_search_with_http_info(query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_web_search ...' end # verify the required parameter 'query' is set if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_web_search" end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 25 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_web_search, must be smaller than or equal to 25.' end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_web_search, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/duckduckgo/search' # query parameters query_params = opts[:query_params] || {} query_params[:'query'] = query query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil? query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil? query_params[:'timelimit'] = opts[:'timelimit'] if !opts[:'timelimit'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKeyAuth'] = opts.merge( :operation => :"DuckDuckGoApi.duckduckgo_web_search", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_web_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |