scrapebadger 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +548 -0
  5. data/Rakefile +10 -0
  6. data/docs/AccountApi.md +76 -0
  7. data/docs/AccountInfo.md +28 -0
  8. data/docs/AmazonApi.md +1244 -0
  9. data/docs/ApartmentsApi.md +373 -0
  10. data/docs/BaiduApi.md +447 -0
  11. data/docs/BillingLogListResponse.md +24 -0
  12. data/docs/BillingLogResponse.md +32 -0
  13. data/docs/BingApi.md +610 -0
  14. data/docs/ChatGPTApi.md +521 -0
  15. data/docs/DepopApi.md +542 -0
  16. data/docs/DuckDuckGoApi.md +700 -0
  17. data/docs/EBayApi.md +1019 -0
  18. data/docs/FacebookApi.md +1671 -0
  19. data/docs/FilterRuleCreate.md +28 -0
  20. data/docs/FilterRuleDeliveryLogListResponse.md +24 -0
  21. data/docs/FilterRuleDeliveryLogResponse.md +44 -0
  22. data/docs/FilterRuleListResponse.md +24 -0
  23. data/docs/FilterRuleResponse.md +40 -0
  24. data/docs/FilterRuleUpdate.md +30 -0
  25. data/docs/FilterRuleValidateRequest.md +18 -0
  26. data/docs/FilterRuleValidateResponse.md +22 -0
  27. data/docs/GoogleApi.md +3175 -0
  28. data/docs/HTTPValidationError.md +18 -0
  29. data/docs/IdealistaApi.md +822 -0
  30. data/docs/ImmobiliareApi.md +773 -0
  31. data/docs/InstagramApi.md +1673 -0
  32. data/docs/LeboncoinApi.md +884 -0
  33. data/docs/LinkedInApi.md +925 -0
  34. data/docs/LoopNetApi.md +529 -0
  35. data/docs/PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse.md +20 -0
  36. data/docs/RealtorApi.md +474 -0
  37. data/docs/RedditApi.md +1677 -0
  38. data/docs/RedfinApi.md +616 -0
  39. data/docs/StreamMonitorCreate.md +26 -0
  40. data/docs/StreamMonitorListResponse.md +24 -0
  41. data/docs/StreamMonitorResponse.md +42 -0
  42. data/docs/StreamMonitorUpdate.md +28 -0
  43. data/docs/SubscriptionInfo.md +40 -0
  44. data/docs/TikTokApi.md +2104 -0
  45. data/docs/TweetDeliveryLogListResponse.md +24 -0
  46. data/docs/TweetDeliveryLogResponse.md +44 -0
  47. data/docs/TwitterApi.md +4091 -0
  48. data/docs/ValidationError.md +22 -0
  49. data/docs/ValidationErrorLocInner.md +15 -0
  50. data/docs/VintedApi.md +766 -0
  51. data/docs/WalmartApi.md +904 -0
  52. data/docs/WebApi.md +634 -0
  53. data/docs/WebhookCreate.md +22 -0
  54. data/docs/WebhookListItem.md +28 -0
  55. data/docs/WebhookListResponse.md +20 -0
  56. data/docs/WebhookResponse.md +26 -0
  57. data/docs/WebhookTestRequest.md +18 -0
  58. data/docs/WebhookTestResponse.md +24 -0
  59. data/docs/YahooApi.md +602 -0
  60. data/docs/YandexApi.md +450 -0
  61. data/docs/YouTubeApi.md +2872 -0
  62. data/docs/ZillowApi.md +622 -0
  63. data/git_push.sh +57 -0
  64. data/lib/scrapebadger/api/account_api.rb +79 -0
  65. data/lib/scrapebadger/api/amazon_api.rb +1165 -0
  66. data/lib/scrapebadger/api/apartments_api.rb +377 -0
  67. data/lib/scrapebadger/api/baidu_api.rb +436 -0
  68. data/lib/scrapebadger/api/bing_api.rb +580 -0
  69. data/lib/scrapebadger/api/chat_gpt_api.rb +466 -0
  70. data/lib/scrapebadger/api/depop_api.rb +518 -0
  71. data/lib/scrapebadger/api/duck_duck_go_api.rb +675 -0
  72. data/lib/scrapebadger/api/e_bay_api.rb +1029 -0
  73. data/lib/scrapebadger/api/facebook_api.rb +1492 -0
  74. data/lib/scrapebadger/api/google_api.rb +3191 -0
  75. data/lib/scrapebadger/api/idealista_api.rb +864 -0
  76. data/lib/scrapebadger/api/immobiliare_api.rb +734 -0
  77. data/lib/scrapebadger/api/instagram_api.rb +1555 -0
  78. data/lib/scrapebadger/api/leboncoin_api.rb +818 -0
  79. data/lib/scrapebadger/api/linked_in_api.rb +832 -0
  80. data/lib/scrapebadger/api/loop_net_api.rb +503 -0
  81. data/lib/scrapebadger/api/realtor_api.rb +481 -0
  82. data/lib/scrapebadger/api/reddit_api.rb +1601 -0
  83. data/lib/scrapebadger/api/redfin_api.rb +625 -0
  84. data/lib/scrapebadger/api/tik_tok_api.rb +2029 -0
  85. data/lib/scrapebadger/api/twitter_api.rb +3696 -0
  86. data/lib/scrapebadger/api/vinted_api.rb +705 -0
  87. data/lib/scrapebadger/api/walmart_api.rb +876 -0
  88. data/lib/scrapebadger/api/web_api.rb +547 -0
  89. data/lib/scrapebadger/api/yahoo_api.rb +560 -0
  90. data/lib/scrapebadger/api/yandex_api.rb +422 -0
  91. data/lib/scrapebadger/api/you_tube_api.rb +2520 -0
  92. data/lib/scrapebadger/api/zillow_api.rb +634 -0
  93. data/lib/scrapebadger/api_client.rb +394 -0
  94. data/lib/scrapebadger/api_error.rb +58 -0
  95. data/lib/scrapebadger/configuration.rb +308 -0
  96. data/lib/scrapebadger/models/account_info.rb +288 -0
  97. data/lib/scrapebadger/models/billing_log_list_response.rb +272 -0
  98. data/lib/scrapebadger/models/billing_log_response.rb +334 -0
  99. data/lib/scrapebadger/models/filter_rule_create.rb +427 -0
  100. data/lib/scrapebadger/models/filter_rule_delivery_log_list_response.rb +272 -0
  101. data/lib/scrapebadger/models/filter_rule_delivery_log_response.rb +422 -0
  102. data/lib/scrapebadger/models/filter_rule_list_response.rb +272 -0
  103. data/lib/scrapebadger/models/filter_rule_response.rb +390 -0
  104. data/lib/scrapebadger/models/filter_rule_update.rb +389 -0
  105. data/lib/scrapebadger/models/filter_rule_validate_request.rb +250 -0
  106. data/lib/scrapebadger/models/filter_rule_validate_response.rb +248 -0
  107. data/lib/scrapebadger/models/http_validation_error.rb +216 -0
  108. data/lib/scrapebadger/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response.rb +238 -0
  109. data/lib/scrapebadger/models/stream_monitor_create.rb +373 -0
  110. data/lib/scrapebadger/models/stream_monitor_list_response.rb +272 -0
  111. data/lib/scrapebadger/models/stream_monitor_response.rb +406 -0
  112. data/lib/scrapebadger/models/stream_monitor_update.rb +335 -0
  113. data/lib/scrapebadger/models/subscription_info.rb +352 -0
  114. data/lib/scrapebadger/models/tweet_delivery_log_list_response.rb +272 -0
  115. data/lib/scrapebadger/models/tweet_delivery_log_response.rb +422 -0
  116. data/lib/scrapebadger/models/validation_error.rb +255 -0
  117. data/lib/scrapebadger/models/validation_error_loc_inner.rb +104 -0
  118. data/lib/scrapebadger/models/webhook_create.rb +282 -0
  119. data/lib/scrapebadger/models/webhook_list_item.rb +302 -0
  120. data/lib/scrapebadger/models/webhook_list_response.rb +240 -0
  121. data/lib/scrapebadger/models/webhook_response.rb +286 -0
  122. data/lib/scrapebadger/models/webhook_test_request.rb +223 -0
  123. data/lib/scrapebadger/models/webhook_test_response.rb +259 -0
  124. data/lib/scrapebadger/version.rb +15 -0
  125. data/lib/scrapebadger.rb +96 -0
  126. data/scrapebadger.gemspec +39 -0
  127. data/spec/api/account_api_spec.rb +46 -0
  128. data/spec/api/amazon_api_spec.rb +258 -0
  129. data/spec/api/apartments_api_spec.rb +98 -0
  130. data/spec/api/baidu_api_spec.rb +109 -0
  131. data/spec/api/bing_api_spec.rb +141 -0
  132. data/spec/api/chat_gpt_api_spec.rb +123 -0
  133. data/spec/api/depop_api_spec.rb +132 -0
  134. data/spec/api/duck_duck_go_api_spec.rb +162 -0
  135. data/spec/api/e_bay_api_spec.rb +222 -0
  136. data/spec/api/facebook_api_spec.rb +326 -0
  137. data/spec/api/google_api_spec.rb +649 -0
  138. data/spec/api/idealista_api_spec.rb +197 -0
  139. data/spec/api/immobiliare_api_spec.rb +174 -0
  140. data/spec/api/instagram_api_spec.rb +309 -0
  141. data/spec/api/leboncoin_api_spec.rb +184 -0
  142. data/spec/api/linked_in_api_spec.rb +197 -0
  143. data/spec/api/loop_net_api_spec.rb +127 -0
  144. data/spec/api/realtor_api_spec.rb +123 -0
  145. data/spec/api/reddit_api_spec.rb +331 -0
  146. data/spec/api/redfin_api_spec.rb +147 -0
  147. data/spec/api/tik_tok_api_spec.rb +413 -0
  148. data/spec/api/twitter_api_spec.rb +735 -0
  149. data/spec/api/vinted_api_spec.rb +169 -0
  150. data/spec/api/walmart_api_spec.rb +192 -0
  151. data/spec/api/web_api_spec.rb +136 -0
  152. data/spec/api/yahoo_api_spec.rb +137 -0
  153. data/spec/api/yandex_api_spec.rb +111 -0
  154. data/spec/api/you_tube_api_spec.rb +500 -0
  155. data/spec/api/zillow_api_spec.rb +150 -0
  156. data/spec/models/account_info_spec.rb +66 -0
  157. data/spec/models/billing_log_list_response_spec.rb +54 -0
  158. data/spec/models/billing_log_response_spec.rb +78 -0
  159. data/spec/models/filter_rule_create_spec.rb +66 -0
  160. data/spec/models/filter_rule_delivery_log_list_response_spec.rb +54 -0
  161. data/spec/models/filter_rule_delivery_log_response_spec.rb +114 -0
  162. data/spec/models/filter_rule_list_response_spec.rb +54 -0
  163. data/spec/models/filter_rule_response_spec.rb +102 -0
  164. data/spec/models/filter_rule_update_spec.rb +72 -0
  165. data/spec/models/filter_rule_validate_request_spec.rb +36 -0
  166. data/spec/models/filter_rule_validate_response_spec.rb +48 -0
  167. data/spec/models/http_validation_error_spec.rb +36 -0
  168. data/spec/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response_spec.rb +42 -0
  169. data/spec/models/stream_monitor_create_spec.rb +60 -0
  170. data/spec/models/stream_monitor_list_response_spec.rb +54 -0
  171. data/spec/models/stream_monitor_response_spec.rb +108 -0
  172. data/spec/models/stream_monitor_update_spec.rb +66 -0
  173. data/spec/models/subscription_info_spec.rb +102 -0
  174. data/spec/models/tweet_delivery_log_list_response_spec.rb +54 -0
  175. data/spec/models/tweet_delivery_log_response_spec.rb +114 -0
  176. data/spec/models/validation_error_loc_inner_spec.rb +21 -0
  177. data/spec/models/validation_error_spec.rb +48 -0
  178. data/spec/models/webhook_create_spec.rb +48 -0
  179. data/spec/models/webhook_list_item_spec.rb +66 -0
  180. data/spec/models/webhook_list_response_spec.rb +42 -0
  181. data/spec/models/webhook_response_spec.rb +60 -0
  182. data/spec/models/webhook_test_request_spec.rb +36 -0
  183. data/spec/models/webhook_test_response_spec.rb +54 -0
  184. data/spec/spec_helper.rb +111 -0
  185. metadata +324 -0
@@ -0,0 +1,675 @@
1
+ =begin
2
+ #ScrapeBadger API
3
+
4
+ #Unified credit-based scraping API. https://docs.scrapebadger.com
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module ScrapeBadger
16
+ class DuckDuckGoApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # DuckDuckGo scraper health check
23
+ # Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Object]
26
+ def duckduckgo_duckduckgo_scraper_health_check(opts = {})
27
+ data, _status_code, _headers = duckduckgo_duckduckgo_scraper_health_check_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # DuckDuckGo scraper health check
32
+ # Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
35
+ def duckduckgo_duckduckgo_scraper_health_check_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v1/duckduckgo/health'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'Object'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_duckduckgo_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # DuckDuckGo scraper health check
80
+ # Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [Object]
83
+ def duckduckgo_duckduckgo_scraper_health_check_head(opts = {})
84
+ data, _status_code, _headers = duckduckgo_duckduckgo_scraper_health_check_head_with_http_info(opts)
85
+ data
86
+ end
87
+
88
+ # DuckDuckGo scraper health check
89
+ # Check health of the DuckDuckGo scraper service (accepts HEAD for UptimeRobot).
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
92
+ def duckduckgo_duckduckgo_scraper_health_check_head_with_http_info(opts = {})
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check_head ...'
95
+ end
96
+ # resource path
97
+ local_var_path = '/v1/duckduckgo/health'
98
+
99
+ # query parameters
100
+ query_params = opts[:query_params] || {}
101
+
102
+ # header parameters
103
+ header_params = opts[:header_params] || {}
104
+ # HTTP header 'Accept' (if needed)
105
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
106
+
107
+ # form parameters
108
+ form_params = opts[:form_params] || {}
109
+
110
+ # http body (model)
111
+ post_body = opts[:debug_body]
112
+
113
+ # return_type
114
+ return_type = opts[:debug_return_type] || 'Object'
115
+
116
+ # auth_names
117
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
118
+
119
+ new_options = opts.merge(
120
+ :operation => :"DuckDuckGoApi.duckduckgo_duckduckgo_scraper_health_check_head",
121
+ :header_params => header_params,
122
+ :query_params => query_params,
123
+ :form_params => form_params,
124
+ :body => post_body,
125
+ :auth_names => auth_names,
126
+ :return_type => return_type
127
+ )
128
+
129
+ data, status_code, headers = @api_client.call_api(:HEAD, local_var_path, new_options)
130
+ if @api_client.config.debugging
131
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_duckduckgo_scraper_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
132
+ end
133
+ return data, status_code, headers
134
+ end
135
+
136
+ # Image search
137
+ # DuckDuckGo image search with size/color/type/layout/license filters.
138
+ # @param query [String] Search query
139
+ # @param [Hash] opts the optional parameters
140
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
141
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
142
+ # @option opts [Integer] :page 100 results per page (default to 1)
143
+ # @option opts [String] :size Small | Medium | Large | Wallpaper (default to '')
144
+ # @option opts [String] :color color | Monochrome | Red | Blue | … (default to '')
145
+ # @option opts [String] :image_type photo | clipart | gif | transparent | line (default to '')
146
+ # @option opts [String] :layout Square | Tall | Wide (default to '')
147
+ # @option opts [String] :license Any | Public | Share | ShareCommercially | Modify (default to '')
148
+ # @return [Object]
149
+ def duckduckgo_image_search(query, opts = {})
150
+ data, _status_code, _headers = duckduckgo_image_search_with_http_info(query, opts)
151
+ data
152
+ end
153
+
154
+ # Image search
155
+ # DuckDuckGo image search with size/color/type/layout/license filters.
156
+ # @param query [String] Search query
157
+ # @param [Hash] opts the optional parameters
158
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
159
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
160
+ # @option opts [Integer] :page 100 results per page (default to 1)
161
+ # @option opts [String] :size Small | Medium | Large | Wallpaper (default to '')
162
+ # @option opts [String] :color color | Monochrome | Red | Blue | … (default to '')
163
+ # @option opts [String] :image_type photo | clipart | gif | transparent | line (default to '')
164
+ # @option opts [String] :layout Square | Tall | Wide (default to '')
165
+ # @option opts [String] :license Any | Public | Share | ShareCommercially | Modify (default to '')
166
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
167
+ def duckduckgo_image_search_with_http_info(query, opts = {})
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_image_search ...'
170
+ end
171
+ # verify the required parameter 'query' is set
172
+ if @api_client.config.client_side_validation && query.nil?
173
+ fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_image_search"
174
+ end
175
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10
176
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_image_search, must be smaller than or equal to 10.'
177
+ end
178
+
179
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
180
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_image_search, must be greater than or equal to 1.'
181
+ end
182
+
183
+ # resource path
184
+ local_var_path = '/v1/duckduckgo/images'
185
+
186
+ # query parameters
187
+ query_params = opts[:query_params] || {}
188
+ query_params[:'query'] = query
189
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
190
+ query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil?
191
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
192
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
193
+ query_params[:'color'] = opts[:'color'] if !opts[:'color'].nil?
194
+ query_params[:'image_type'] = opts[:'image_type'] if !opts[:'image_type'].nil?
195
+ query_params[:'layout'] = opts[:'layout'] if !opts[:'layout'].nil?
196
+ query_params[:'license'] = opts[:'license'] if !opts[:'license'].nil?
197
+
198
+ # header parameters
199
+ header_params = opts[:header_params] || {}
200
+ # HTTP header 'Accept' (if needed)
201
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
202
+
203
+ # form parameters
204
+ form_params = opts[:form_params] || {}
205
+
206
+ # http body (model)
207
+ post_body = opts[:debug_body]
208
+
209
+ # return_type
210
+ return_type = opts[:debug_return_type] || 'Object'
211
+
212
+ # auth_names
213
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
214
+
215
+ new_options = opts.merge(
216
+ :operation => :"DuckDuckGoApi.duckduckgo_image_search",
217
+ :header_params => header_params,
218
+ :query_params => query_params,
219
+ :form_params => form_params,
220
+ :body => post_body,
221
+ :auth_names => auth_names,
222
+ :return_type => return_type
223
+ )
224
+
225
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_image_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+
232
+ # Instant Answer
233
+ # DuckDuckGo Instant Answer — abstract, definition, direct answer, related topics.
234
+ # @param query [String] Query for the Instant Answer API
235
+ # @param [Hash] opts the optional parameters
236
+ # @return [Object]
237
+ def duckduckgo_instant_answer(query, opts = {})
238
+ data, _status_code, _headers = duckduckgo_instant_answer_with_http_info(query, opts)
239
+ data
240
+ end
241
+
242
+ # Instant Answer
243
+ # DuckDuckGo Instant Answer — abstract, definition, direct answer, related topics.
244
+ # @param query [String] Query for the Instant Answer API
245
+ # @param [Hash] opts the optional parameters
246
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
247
+ def duckduckgo_instant_answer_with_http_info(query, opts = {})
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_instant_answer ...'
250
+ end
251
+ # verify the required parameter 'query' is set
252
+ if @api_client.config.client_side_validation && query.nil?
253
+ fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_instant_answer"
254
+ end
255
+ # resource path
256
+ local_var_path = '/v1/duckduckgo/instant'
257
+
258
+ # query parameters
259
+ query_params = opts[:query_params] || {}
260
+ query_params[:'query'] = query
261
+
262
+ # header parameters
263
+ header_params = opts[:header_params] || {}
264
+ # HTTP header 'Accept' (if needed)
265
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
266
+
267
+ # form parameters
268
+ form_params = opts[:form_params] || {}
269
+
270
+ # http body (model)
271
+ post_body = opts[:debug_body]
272
+
273
+ # return_type
274
+ return_type = opts[:debug_return_type] || 'Object'
275
+
276
+ # auth_names
277
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
278
+
279
+ new_options = opts.merge(
280
+ :operation => :"DuckDuckGoApi.duckduckgo_instant_answer",
281
+ :header_params => header_params,
282
+ :query_params => query_params,
283
+ :form_params => form_params,
284
+ :body => post_body,
285
+ :auth_names => auth_names,
286
+ :return_type => return_type
287
+ )
288
+
289
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
290
+ if @api_client.config.debugging
291
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_instant_answer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
292
+ end
293
+ return data, status_code, headers
294
+ end
295
+
296
+ # List supported regions
297
+ # The full DuckDuckGo region (kl) code list.
298
+ # @param [Hash] opts the optional parameters
299
+ # @return [Object]
300
+ def duckduckgo_list_supported_regions(opts = {})
301
+ data, _status_code, _headers = duckduckgo_list_supported_regions_with_http_info(opts)
302
+ data
303
+ end
304
+
305
+ # List supported regions
306
+ # The full DuckDuckGo region (kl) code list.
307
+ # @param [Hash] opts the optional parameters
308
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
309
+ def duckduckgo_list_supported_regions_with_http_info(opts = {})
310
+ if @api_client.config.debugging
311
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_list_supported_regions ...'
312
+ end
313
+ # resource path
314
+ local_var_path = '/v1/duckduckgo/regions'
315
+
316
+ # query parameters
317
+ query_params = opts[:query_params] || {}
318
+
319
+ # header parameters
320
+ header_params = opts[:header_params] || {}
321
+ # HTTP header 'Accept' (if needed)
322
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
323
+
324
+ # form parameters
325
+ form_params = opts[:form_params] || {}
326
+
327
+ # http body (model)
328
+ post_body = opts[:debug_body]
329
+
330
+ # return_type
331
+ return_type = opts[:debug_return_type] || 'Object'
332
+
333
+ # auth_names
334
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
335
+
336
+ new_options = opts.merge(
337
+ :operation => :"DuckDuckGoApi.duckduckgo_list_supported_regions",
338
+ :header_params => header_params,
339
+ :query_params => query_params,
340
+ :form_params => form_params,
341
+ :body => post_body,
342
+ :auth_names => auth_names,
343
+ :return_type => return_type
344
+ )
345
+
346
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
347
+ if @api_client.config.debugging
348
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_list_supported_regions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
349
+ end
350
+ return data, status_code, headers
351
+ end
352
+
353
+ # News search
354
+ # DuckDuckGo news search — headline, source, excerpt, unix + ISO date, image.
355
+ # @param query [String] Search query
356
+ # @param [Hash] opts the optional parameters
357
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
358
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
359
+ # @option opts [String] :timelimit day | week | month | year (default to '')
360
+ # @option opts [Integer] :page 30 results per page (default to 1)
361
+ # @return [Object]
362
+ def duckduckgo_news_search(query, opts = {})
363
+ data, _status_code, _headers = duckduckgo_news_search_with_http_info(query, opts)
364
+ data
365
+ end
366
+
367
+ # News search
368
+ # DuckDuckGo news search — headline, source, excerpt, unix + ISO date, image.
369
+ # @param query [String] Search query
370
+ # @param [Hash] opts the optional parameters
371
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
372
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
373
+ # @option opts [String] :timelimit day | week | month | year (default to '')
374
+ # @option opts [Integer] :page 30 results per page (default to 1)
375
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
376
+ def duckduckgo_news_search_with_http_info(query, opts = {})
377
+ if @api_client.config.debugging
378
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_news_search ...'
379
+ end
380
+ # verify the required parameter 'query' is set
381
+ if @api_client.config.client_side_validation && query.nil?
382
+ fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_news_search"
383
+ end
384
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10
385
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_news_search, must be smaller than or equal to 10.'
386
+ end
387
+
388
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
389
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_news_search, must be greater than or equal to 1.'
390
+ end
391
+
392
+ # resource path
393
+ local_var_path = '/v1/duckduckgo/news'
394
+
395
+ # query parameters
396
+ query_params = opts[:query_params] || {}
397
+ query_params[:'query'] = query
398
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
399
+ query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil?
400
+ query_params[:'timelimit'] = opts[:'timelimit'] if !opts[:'timelimit'].nil?
401
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
402
+
403
+ # header parameters
404
+ header_params = opts[:header_params] || {}
405
+ # HTTP header 'Accept' (if needed)
406
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
407
+
408
+ # form parameters
409
+ form_params = opts[:form_params] || {}
410
+
411
+ # http body (model)
412
+ post_body = opts[:debug_body]
413
+
414
+ # return_type
415
+ return_type = opts[:debug_return_type] || 'Object'
416
+
417
+ # auth_names
418
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
419
+
420
+ new_options = opts.merge(
421
+ :operation => :"DuckDuckGoApi.duckduckgo_news_search",
422
+ :header_params => header_params,
423
+ :query_params => query_params,
424
+ :form_params => form_params,
425
+ :body => post_body,
426
+ :auth_names => auth_names,
427
+ :return_type => return_type
428
+ )
429
+
430
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
431
+ if @api_client.config.debugging
432
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_news_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
433
+ end
434
+ return data, status_code, headers
435
+ end
436
+
437
+ # Search suggestions
438
+ # DuckDuckGo search-box suggestions.
439
+ # @param query [String] Partial query to complete
440
+ # @param [Hash] opts the optional parameters
441
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
442
+ # @return [Object]
443
+ def duckduckgo_search_suggestions(query, opts = {})
444
+ data, _status_code, _headers = duckduckgo_search_suggestions_with_http_info(query, opts)
445
+ data
446
+ end
447
+
448
+ # Search suggestions
449
+ # DuckDuckGo search-box suggestions.
450
+ # @param query [String] Partial query to complete
451
+ # @param [Hash] opts the optional parameters
452
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
453
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
454
+ def duckduckgo_search_suggestions_with_http_info(query, opts = {})
455
+ if @api_client.config.debugging
456
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_search_suggestions ...'
457
+ end
458
+ # verify the required parameter 'query' is set
459
+ if @api_client.config.client_side_validation && query.nil?
460
+ fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_search_suggestions"
461
+ end
462
+ # resource path
463
+ local_var_path = '/v1/duckduckgo/autocomplete'
464
+
465
+ # query parameters
466
+ query_params = opts[:query_params] || {}
467
+ query_params[:'query'] = query
468
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
469
+
470
+ # header parameters
471
+ header_params = opts[:header_params] || {}
472
+ # HTTP header 'Accept' (if needed)
473
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
474
+
475
+ # form parameters
476
+ form_params = opts[:form_params] || {}
477
+
478
+ # http body (model)
479
+ post_body = opts[:debug_body]
480
+
481
+ # return_type
482
+ return_type = opts[:debug_return_type] || 'Object'
483
+
484
+ # auth_names
485
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
486
+
487
+ new_options = opts.merge(
488
+ :operation => :"DuckDuckGoApi.duckduckgo_search_suggestions",
489
+ :header_params => header_params,
490
+ :query_params => query_params,
491
+ :form_params => form_params,
492
+ :body => post_body,
493
+ :auth_names => auth_names,
494
+ :return_type => return_type
495
+ )
496
+
497
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
498
+ if @api_client.config.debugging
499
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_search_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
500
+ end
501
+ return data, status_code, headers
502
+ end
503
+
504
+ # Video search
505
+ # DuckDuckGo video search — title, publisher, uploader, duration, views, thumbnails.
506
+ # @param query [String] Search query
507
+ # @param [Hash] opts the optional parameters
508
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
509
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
510
+ # @option opts [Integer] :page 60 results per page (default to 1)
511
+ # @option opts [String] :duration short | medium | long (default to '')
512
+ # @option opts [String] :resolution high | standard (default to '')
513
+ # @return [Object]
514
+ def duckduckgo_video_search(query, opts = {})
515
+ data, _status_code, _headers = duckduckgo_video_search_with_http_info(query, opts)
516
+ data
517
+ end
518
+
519
+ # Video search
520
+ # DuckDuckGo video search — title, publisher, uploader, duration, views, thumbnails.
521
+ # @param query [String] Search query
522
+ # @param [Hash] opts the optional parameters
523
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
524
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
525
+ # @option opts [Integer] :page 60 results per page (default to 1)
526
+ # @option opts [String] :duration short | medium | long (default to '')
527
+ # @option opts [String] :resolution high | standard (default to '')
528
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
529
+ def duckduckgo_video_search_with_http_info(query, opts = {})
530
+ if @api_client.config.debugging
531
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_video_search ...'
532
+ end
533
+ # verify the required parameter 'query' is set
534
+ if @api_client.config.client_side_validation && query.nil?
535
+ fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_video_search"
536
+ end
537
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 10
538
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_video_search, must be smaller than or equal to 10.'
539
+ end
540
+
541
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
542
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_video_search, must be greater than or equal to 1.'
543
+ end
544
+
545
+ # resource path
546
+ local_var_path = '/v1/duckduckgo/videos'
547
+
548
+ # query parameters
549
+ query_params = opts[:query_params] || {}
550
+ query_params[:'query'] = query
551
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
552
+ query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil?
553
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
554
+ query_params[:'duration'] = opts[:'duration'] if !opts[:'duration'].nil?
555
+ query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil?
556
+
557
+ # header parameters
558
+ header_params = opts[:header_params] || {}
559
+ # HTTP header 'Accept' (if needed)
560
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
561
+
562
+ # form parameters
563
+ form_params = opts[:form_params] || {}
564
+
565
+ # http body (model)
566
+ post_body = opts[:debug_body]
567
+
568
+ # return_type
569
+ return_type = opts[:debug_return_type] || 'Object'
570
+
571
+ # auth_names
572
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
573
+
574
+ new_options = opts.merge(
575
+ :operation => :"DuckDuckGoApi.duckduckgo_video_search",
576
+ :header_params => header_params,
577
+ :query_params => query_params,
578
+ :form_params => form_params,
579
+ :body => post_body,
580
+ :auth_names => auth_names,
581
+ :return_type => return_type
582
+ )
583
+
584
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
585
+ if @api_client.config.debugging
586
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_video_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
587
+ end
588
+ return data, status_code, headers
589
+ end
590
+
591
+ # Web search
592
+ # DuckDuckGo web SERP — organic results, the zero-click abstract box, ads flagged.
593
+ # @param query [String] Search query
594
+ # @param [Hash] opts the optional parameters
595
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
596
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
597
+ # @option opts [String] :timelimit day | week | month | year (default to '')
598
+ # @option opts [Integer] :page (default to 1)
599
+ # @return [Object]
600
+ def duckduckgo_web_search(query, opts = {})
601
+ data, _status_code, _headers = duckduckgo_web_search_with_http_info(query, opts)
602
+ data
603
+ end
604
+
605
+ # Web search
606
+ # DuckDuckGo web SERP — organic results, the zero-click abstract box, ads flagged.
607
+ # @param query [String] Search query
608
+ # @param [Hash] opts the optional parameters
609
+ # @option opts [String] :region DuckDuckGo region code (kl), e.g. us-en, uk-en, de-de. wt-wt &#x3D; all regions. (default to 'wt-wt')
610
+ # @option opts [String] :safesearch on | moderate | off (default to 'moderate')
611
+ # @option opts [String] :timelimit day | week | month | year (default to '')
612
+ # @option opts [Integer] :page (default to 1)
613
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
614
+ def duckduckgo_web_search_with_http_info(query, opts = {})
615
+ if @api_client.config.debugging
616
+ @api_client.config.logger.debug 'Calling API: DuckDuckGoApi.duckduckgo_web_search ...'
617
+ end
618
+ # verify the required parameter 'query' is set
619
+ if @api_client.config.client_side_validation && query.nil?
620
+ fail ArgumentError, "Missing the required parameter 'query' when calling DuckDuckGoApi.duckduckgo_web_search"
621
+ end
622
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 25
623
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_web_search, must be smaller than or equal to 25.'
624
+ end
625
+
626
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
627
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling DuckDuckGoApi.duckduckgo_web_search, must be greater than or equal to 1.'
628
+ end
629
+
630
+ # resource path
631
+ local_var_path = '/v1/duckduckgo/search'
632
+
633
+ # query parameters
634
+ query_params = opts[:query_params] || {}
635
+ query_params[:'query'] = query
636
+ query_params[:'region'] = opts[:'region'] if !opts[:'region'].nil?
637
+ query_params[:'safesearch'] = opts[:'safesearch'] if !opts[:'safesearch'].nil?
638
+ query_params[:'timelimit'] = opts[:'timelimit'] if !opts[:'timelimit'].nil?
639
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
640
+
641
+ # header parameters
642
+ header_params = opts[:header_params] || {}
643
+ # HTTP header 'Accept' (if needed)
644
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
645
+
646
+ # form parameters
647
+ form_params = opts[:form_params] || {}
648
+
649
+ # http body (model)
650
+ post_body = opts[:debug_body]
651
+
652
+ # return_type
653
+ return_type = opts[:debug_return_type] || 'Object'
654
+
655
+ # auth_names
656
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
657
+
658
+ new_options = opts.merge(
659
+ :operation => :"DuckDuckGoApi.duckduckgo_web_search",
660
+ :header_params => header_params,
661
+ :query_params => query_params,
662
+ :form_params => form_params,
663
+ :body => post_body,
664
+ :auth_names => auth_names,
665
+ :return_type => return_type
666
+ )
667
+
668
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
669
+ if @api_client.config.debugging
670
+ @api_client.config.logger.debug "API called: DuckDuckGoApi#duckduckgo_web_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
671
+ end
672
+ return data, status_code, headers
673
+ end
674
+ end
675
+ end