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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +548 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +76 -0
- data/docs/AccountInfo.md +28 -0
- data/docs/AmazonApi.md +1244 -0
- data/docs/ApartmentsApi.md +373 -0
- data/docs/BaiduApi.md +447 -0
- data/docs/BillingLogListResponse.md +24 -0
- data/docs/BillingLogResponse.md +32 -0
- data/docs/BingApi.md +610 -0
- data/docs/ChatGPTApi.md +521 -0
- data/docs/DepopApi.md +542 -0
- data/docs/DuckDuckGoApi.md +700 -0
- data/docs/EBayApi.md +1019 -0
- data/docs/FacebookApi.md +1671 -0
- data/docs/FilterRuleCreate.md +28 -0
- data/docs/FilterRuleDeliveryLogListResponse.md +24 -0
- data/docs/FilterRuleDeliveryLogResponse.md +44 -0
- data/docs/FilterRuleListResponse.md +24 -0
- data/docs/FilterRuleResponse.md +40 -0
- data/docs/FilterRuleUpdate.md +30 -0
- data/docs/FilterRuleValidateRequest.md +18 -0
- data/docs/FilterRuleValidateResponse.md +22 -0
- data/docs/GoogleApi.md +3175 -0
- data/docs/HTTPValidationError.md +18 -0
- data/docs/IdealistaApi.md +822 -0
- data/docs/ImmobiliareApi.md +773 -0
- data/docs/InstagramApi.md +1673 -0
- data/docs/LeboncoinApi.md +884 -0
- data/docs/LinkedInApi.md +925 -0
- data/docs/LoopNetApi.md +529 -0
- data/docs/PortalApiRoutersV1TwitterFilterRulesFilterRulePricingResponse.md +20 -0
- data/docs/RealtorApi.md +474 -0
- data/docs/RedditApi.md +1677 -0
- data/docs/RedfinApi.md +616 -0
- data/docs/StreamMonitorCreate.md +26 -0
- data/docs/StreamMonitorListResponse.md +24 -0
- data/docs/StreamMonitorResponse.md +42 -0
- data/docs/StreamMonitorUpdate.md +28 -0
- data/docs/SubscriptionInfo.md +40 -0
- data/docs/TikTokApi.md +2104 -0
- data/docs/TweetDeliveryLogListResponse.md +24 -0
- data/docs/TweetDeliveryLogResponse.md +44 -0
- data/docs/TwitterApi.md +4091 -0
- data/docs/ValidationError.md +22 -0
- data/docs/ValidationErrorLocInner.md +15 -0
- data/docs/VintedApi.md +766 -0
- data/docs/WalmartApi.md +904 -0
- data/docs/WebApi.md +634 -0
- data/docs/WebhookCreate.md +22 -0
- data/docs/WebhookListItem.md +28 -0
- data/docs/WebhookListResponse.md +20 -0
- data/docs/WebhookResponse.md +26 -0
- data/docs/WebhookTestRequest.md +18 -0
- data/docs/WebhookTestResponse.md +24 -0
- data/docs/YahooApi.md +602 -0
- data/docs/YandexApi.md +450 -0
- data/docs/YouTubeApi.md +2872 -0
- data/docs/ZillowApi.md +622 -0
- data/git_push.sh +57 -0
- data/lib/scrapebadger/api/account_api.rb +79 -0
- data/lib/scrapebadger/api/amazon_api.rb +1165 -0
- data/lib/scrapebadger/api/apartments_api.rb +377 -0
- data/lib/scrapebadger/api/baidu_api.rb +436 -0
- data/lib/scrapebadger/api/bing_api.rb +580 -0
- data/lib/scrapebadger/api/chat_gpt_api.rb +466 -0
- data/lib/scrapebadger/api/depop_api.rb +518 -0
- data/lib/scrapebadger/api/duck_duck_go_api.rb +675 -0
- data/lib/scrapebadger/api/e_bay_api.rb +1029 -0
- data/lib/scrapebadger/api/facebook_api.rb +1492 -0
- data/lib/scrapebadger/api/google_api.rb +3191 -0
- data/lib/scrapebadger/api/idealista_api.rb +864 -0
- data/lib/scrapebadger/api/immobiliare_api.rb +734 -0
- data/lib/scrapebadger/api/instagram_api.rb +1555 -0
- data/lib/scrapebadger/api/leboncoin_api.rb +818 -0
- data/lib/scrapebadger/api/linked_in_api.rb +832 -0
- data/lib/scrapebadger/api/loop_net_api.rb +503 -0
- data/lib/scrapebadger/api/realtor_api.rb +481 -0
- data/lib/scrapebadger/api/reddit_api.rb +1601 -0
- data/lib/scrapebadger/api/redfin_api.rb +625 -0
- data/lib/scrapebadger/api/tik_tok_api.rb +2029 -0
- data/lib/scrapebadger/api/twitter_api.rb +3696 -0
- data/lib/scrapebadger/api/vinted_api.rb +705 -0
- data/lib/scrapebadger/api/walmart_api.rb +876 -0
- data/lib/scrapebadger/api/web_api.rb +547 -0
- data/lib/scrapebadger/api/yahoo_api.rb +560 -0
- data/lib/scrapebadger/api/yandex_api.rb +422 -0
- data/lib/scrapebadger/api/you_tube_api.rb +2520 -0
- data/lib/scrapebadger/api/zillow_api.rb +634 -0
- data/lib/scrapebadger/api_client.rb +394 -0
- data/lib/scrapebadger/api_error.rb +58 -0
- data/lib/scrapebadger/configuration.rb +308 -0
- data/lib/scrapebadger/models/account_info.rb +288 -0
- data/lib/scrapebadger/models/billing_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/billing_log_response.rb +334 -0
- data/lib/scrapebadger/models/filter_rule_create.rb +427 -0
- data/lib/scrapebadger/models/filter_rule_delivery_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/filter_rule_delivery_log_response.rb +422 -0
- data/lib/scrapebadger/models/filter_rule_list_response.rb +272 -0
- data/lib/scrapebadger/models/filter_rule_response.rb +390 -0
- data/lib/scrapebadger/models/filter_rule_update.rb +389 -0
- data/lib/scrapebadger/models/filter_rule_validate_request.rb +250 -0
- data/lib/scrapebadger/models/filter_rule_validate_response.rb +248 -0
- data/lib/scrapebadger/models/http_validation_error.rb +216 -0
- data/lib/scrapebadger/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response.rb +238 -0
- data/lib/scrapebadger/models/stream_monitor_create.rb +373 -0
- data/lib/scrapebadger/models/stream_monitor_list_response.rb +272 -0
- data/lib/scrapebadger/models/stream_monitor_response.rb +406 -0
- data/lib/scrapebadger/models/stream_monitor_update.rb +335 -0
- data/lib/scrapebadger/models/subscription_info.rb +352 -0
- data/lib/scrapebadger/models/tweet_delivery_log_list_response.rb +272 -0
- data/lib/scrapebadger/models/tweet_delivery_log_response.rb +422 -0
- data/lib/scrapebadger/models/validation_error.rb +255 -0
- data/lib/scrapebadger/models/validation_error_loc_inner.rb +104 -0
- data/lib/scrapebadger/models/webhook_create.rb +282 -0
- data/lib/scrapebadger/models/webhook_list_item.rb +302 -0
- data/lib/scrapebadger/models/webhook_list_response.rb +240 -0
- data/lib/scrapebadger/models/webhook_response.rb +286 -0
- data/lib/scrapebadger/models/webhook_test_request.rb +223 -0
- data/lib/scrapebadger/models/webhook_test_response.rb +259 -0
- data/lib/scrapebadger/version.rb +15 -0
- data/lib/scrapebadger.rb +96 -0
- data/scrapebadger.gemspec +39 -0
- data/spec/api/account_api_spec.rb +46 -0
- data/spec/api/amazon_api_spec.rb +258 -0
- data/spec/api/apartments_api_spec.rb +98 -0
- data/spec/api/baidu_api_spec.rb +109 -0
- data/spec/api/bing_api_spec.rb +141 -0
- data/spec/api/chat_gpt_api_spec.rb +123 -0
- data/spec/api/depop_api_spec.rb +132 -0
- data/spec/api/duck_duck_go_api_spec.rb +162 -0
- data/spec/api/e_bay_api_spec.rb +222 -0
- data/spec/api/facebook_api_spec.rb +326 -0
- data/spec/api/google_api_spec.rb +649 -0
- data/spec/api/idealista_api_spec.rb +197 -0
- data/spec/api/immobiliare_api_spec.rb +174 -0
- data/spec/api/instagram_api_spec.rb +309 -0
- data/spec/api/leboncoin_api_spec.rb +184 -0
- data/spec/api/linked_in_api_spec.rb +197 -0
- data/spec/api/loop_net_api_spec.rb +127 -0
- data/spec/api/realtor_api_spec.rb +123 -0
- data/spec/api/reddit_api_spec.rb +331 -0
- data/spec/api/redfin_api_spec.rb +147 -0
- data/spec/api/tik_tok_api_spec.rb +413 -0
- data/spec/api/twitter_api_spec.rb +735 -0
- data/spec/api/vinted_api_spec.rb +169 -0
- data/spec/api/walmart_api_spec.rb +192 -0
- data/spec/api/web_api_spec.rb +136 -0
- data/spec/api/yahoo_api_spec.rb +137 -0
- data/spec/api/yandex_api_spec.rb +111 -0
- data/spec/api/you_tube_api_spec.rb +500 -0
- data/spec/api/zillow_api_spec.rb +150 -0
- data/spec/models/account_info_spec.rb +66 -0
- data/spec/models/billing_log_list_response_spec.rb +54 -0
- data/spec/models/billing_log_response_spec.rb +78 -0
- data/spec/models/filter_rule_create_spec.rb +66 -0
- data/spec/models/filter_rule_delivery_log_list_response_spec.rb +54 -0
- data/spec/models/filter_rule_delivery_log_response_spec.rb +114 -0
- data/spec/models/filter_rule_list_response_spec.rb +54 -0
- data/spec/models/filter_rule_response_spec.rb +102 -0
- data/spec/models/filter_rule_update_spec.rb +72 -0
- data/spec/models/filter_rule_validate_request_spec.rb +36 -0
- data/spec/models/filter_rule_validate_response_spec.rb +48 -0
- data/spec/models/http_validation_error_spec.rb +36 -0
- data/spec/models/portal_api_routers_v1_twitter_filter_rules_filter_rule_pricing_response_spec.rb +42 -0
- data/spec/models/stream_monitor_create_spec.rb +60 -0
- data/spec/models/stream_monitor_list_response_spec.rb +54 -0
- data/spec/models/stream_monitor_response_spec.rb +108 -0
- data/spec/models/stream_monitor_update_spec.rb +66 -0
- data/spec/models/subscription_info_spec.rb +102 -0
- data/spec/models/tweet_delivery_log_list_response_spec.rb +54 -0
- data/spec/models/tweet_delivery_log_response_spec.rb +114 -0
- data/spec/models/validation_error_loc_inner_spec.rb +21 -0
- data/spec/models/validation_error_spec.rb +48 -0
- data/spec/models/webhook_create_spec.rb +48 -0
- data/spec/models/webhook_list_item_spec.rb +66 -0
- data/spec/models/webhook_list_response_spec.rb +42 -0
- data/spec/models/webhook_response_spec.rb +60 -0
- data/spec/models/webhook_test_request_spec.rb +36 -0
- data/spec/models/webhook_test_response_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- metadata +324 -0
|
@@ -0,0 +1,580 @@
|
|
|
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 BingApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Bing scraper health check
|
|
23
|
+
# Check health of the Bing scraper service (accepts HEAD for UptimeRobot).
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [Object]
|
|
26
|
+
def bing_bing_scraper_health_check(opts = {})
|
|
27
|
+
data, _status_code, _headers = bing_bing_scraper_health_check_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Bing scraper health check
|
|
32
|
+
# Check health of the Bing 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 bing_bing_scraper_health_check_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_bing_scraper_health_check ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/v1/bing/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 => :"BingApi.bing_bing_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: BingApi#bing_bing_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
|
+
end
|
|
76
|
+
return data, status_code, headers
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Bing scraper health check
|
|
80
|
+
# Check health of the Bing scraper service (accepts HEAD for UptimeRobot).
|
|
81
|
+
# @param [Hash] opts the optional parameters
|
|
82
|
+
# @return [Object]
|
|
83
|
+
def bing_bing_scraper_health_check_head(opts = {})
|
|
84
|
+
data, _status_code, _headers = bing_bing_scraper_health_check_head_with_http_info(opts)
|
|
85
|
+
data
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Bing scraper health check
|
|
89
|
+
# Check health of the Bing 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 bing_bing_scraper_health_check_head_with_http_info(opts = {})
|
|
93
|
+
if @api_client.config.debugging
|
|
94
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_bing_scraper_health_check_head ...'
|
|
95
|
+
end
|
|
96
|
+
# resource path
|
|
97
|
+
local_var_path = '/v1/bing/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 => :"BingApi.bing_bing_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: BingApi#bing_bing_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
|
+
# Bing Images — thumbnail, full-size and source URL per result.
|
|
138
|
+
# @param query [String] Search keywords, e.g. 'golden retriever'
|
|
139
|
+
# @param [Hash] opts the optional parameters
|
|
140
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
141
|
+
# @option opts [Integer] :count Results to return (default to 35)
|
|
142
|
+
# @option opts [String] :safe_search off | moderate | strict
|
|
143
|
+
# @return [Object]
|
|
144
|
+
def bing_image_search(query, opts = {})
|
|
145
|
+
data, _status_code, _headers = bing_image_search_with_http_info(query, opts)
|
|
146
|
+
data
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Image search
|
|
150
|
+
# Bing Images — thumbnail, full-size and source URL per result.
|
|
151
|
+
# @param query [String] Search keywords, e.g. 'golden retriever'
|
|
152
|
+
# @param [Hash] opts the optional parameters
|
|
153
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
154
|
+
# @option opts [Integer] :count Results to return (default to 35)
|
|
155
|
+
# @option opts [String] :safe_search off | moderate | strict
|
|
156
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
157
|
+
def bing_image_search_with_http_info(query, opts = {})
|
|
158
|
+
if @api_client.config.debugging
|
|
159
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_image_search ...'
|
|
160
|
+
end
|
|
161
|
+
# verify the required parameter 'query' is set
|
|
162
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
163
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BingApi.bing_image_search"
|
|
164
|
+
end
|
|
165
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 150
|
|
166
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling BingApi.bing_image_search, must be smaller than or equal to 150.'
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
|
170
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling BingApi.bing_image_search, must be greater than or equal to 1.'
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# resource path
|
|
174
|
+
local_var_path = '/v1/bing/images'
|
|
175
|
+
|
|
176
|
+
# query parameters
|
|
177
|
+
query_params = opts[:query_params] || {}
|
|
178
|
+
query_params[:'query'] = query
|
|
179
|
+
query_params[:'market'] = opts[:'market'] if !opts[:'market'].nil?
|
|
180
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
|
181
|
+
query_params[:'safe_search'] = opts[:'safe_search'] if !opts[:'safe_search'].nil?
|
|
182
|
+
|
|
183
|
+
# header parameters
|
|
184
|
+
header_params = opts[:header_params] || {}
|
|
185
|
+
# HTTP header 'Accept' (if needed)
|
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
187
|
+
|
|
188
|
+
# form parameters
|
|
189
|
+
form_params = opts[:form_params] || {}
|
|
190
|
+
|
|
191
|
+
# http body (model)
|
|
192
|
+
post_body = opts[:debug_body]
|
|
193
|
+
|
|
194
|
+
# return_type
|
|
195
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
196
|
+
|
|
197
|
+
# auth_names
|
|
198
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
199
|
+
|
|
200
|
+
new_options = opts.merge(
|
|
201
|
+
:operation => :"BingApi.bing_image_search",
|
|
202
|
+
:header_params => header_params,
|
|
203
|
+
:query_params => query_params,
|
|
204
|
+
:form_params => form_params,
|
|
205
|
+
:body => post_body,
|
|
206
|
+
:auth_names => auth_names,
|
|
207
|
+
:return_type => return_type
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
211
|
+
if @api_client.config.debugging
|
|
212
|
+
@api_client.config.logger.debug "API called: BingApi#bing_image_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
213
|
+
end
|
|
214
|
+
return data, status_code, headers
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# List supported markets
|
|
218
|
+
# Supported Bing market codes. Free — costs no credits.
|
|
219
|
+
# @param [Hash] opts the optional parameters
|
|
220
|
+
# @return [Object]
|
|
221
|
+
def bing_list_supported_markets(opts = {})
|
|
222
|
+
data, _status_code, _headers = bing_list_supported_markets_with_http_info(opts)
|
|
223
|
+
data
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# List supported markets
|
|
227
|
+
# Supported Bing market codes. Free — costs no credits.
|
|
228
|
+
# @param [Hash] opts the optional parameters
|
|
229
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
230
|
+
def bing_list_supported_markets_with_http_info(opts = {})
|
|
231
|
+
if @api_client.config.debugging
|
|
232
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_list_supported_markets ...'
|
|
233
|
+
end
|
|
234
|
+
# resource path
|
|
235
|
+
local_var_path = '/v1/bing/markets'
|
|
236
|
+
|
|
237
|
+
# query parameters
|
|
238
|
+
query_params = opts[:query_params] || {}
|
|
239
|
+
|
|
240
|
+
# header parameters
|
|
241
|
+
header_params = opts[:header_params] || {}
|
|
242
|
+
# HTTP header 'Accept' (if needed)
|
|
243
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
244
|
+
|
|
245
|
+
# form parameters
|
|
246
|
+
form_params = opts[:form_params] || {}
|
|
247
|
+
|
|
248
|
+
# http body (model)
|
|
249
|
+
post_body = opts[:debug_body]
|
|
250
|
+
|
|
251
|
+
# return_type
|
|
252
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
253
|
+
|
|
254
|
+
# auth_names
|
|
255
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
256
|
+
|
|
257
|
+
new_options = opts.merge(
|
|
258
|
+
:operation => :"BingApi.bing_list_supported_markets",
|
|
259
|
+
:header_params => header_params,
|
|
260
|
+
:query_params => query_params,
|
|
261
|
+
:form_params => form_params,
|
|
262
|
+
:body => post_body,
|
|
263
|
+
:auth_names => auth_names,
|
|
264
|
+
:return_type => return_type
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
268
|
+
if @api_client.config.debugging
|
|
269
|
+
@api_client.config.logger.debug "API called: BingApi#bing_list_supported_markets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
270
|
+
end
|
|
271
|
+
return data, status_code, headers
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# News search
|
|
275
|
+
# Bing News — headline, source, published time and snippet per article.
|
|
276
|
+
# @param query [String] Search keywords, e.g. 'interest rates'
|
|
277
|
+
# @param [Hash] opts the optional parameters
|
|
278
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
279
|
+
# @option opts [String] :freshness day | week | month — restrict to recent articles
|
|
280
|
+
# @return [Object]
|
|
281
|
+
def bing_news_search(query, opts = {})
|
|
282
|
+
data, _status_code, _headers = bing_news_search_with_http_info(query, opts)
|
|
283
|
+
data
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# News search
|
|
287
|
+
# Bing News — headline, source, published time and snippet per article.
|
|
288
|
+
# @param query [String] Search keywords, e.g. 'interest rates'
|
|
289
|
+
# @param [Hash] opts the optional parameters
|
|
290
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
291
|
+
# @option opts [String] :freshness day | week | month — restrict to recent articles
|
|
292
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
293
|
+
def bing_news_search_with_http_info(query, opts = {})
|
|
294
|
+
if @api_client.config.debugging
|
|
295
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_news_search ...'
|
|
296
|
+
end
|
|
297
|
+
# verify the required parameter 'query' is set
|
|
298
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
299
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BingApi.bing_news_search"
|
|
300
|
+
end
|
|
301
|
+
# resource path
|
|
302
|
+
local_var_path = '/v1/bing/news'
|
|
303
|
+
|
|
304
|
+
# query parameters
|
|
305
|
+
query_params = opts[:query_params] || {}
|
|
306
|
+
query_params[:'query'] = query
|
|
307
|
+
query_params[:'market'] = opts[:'market'] if !opts[:'market'].nil?
|
|
308
|
+
query_params[:'freshness'] = opts[:'freshness'] if !opts[:'freshness'].nil?
|
|
309
|
+
|
|
310
|
+
# header parameters
|
|
311
|
+
header_params = opts[:header_params] || {}
|
|
312
|
+
# HTTP header 'Accept' (if needed)
|
|
313
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
314
|
+
|
|
315
|
+
# form parameters
|
|
316
|
+
form_params = opts[:form_params] || {}
|
|
317
|
+
|
|
318
|
+
# http body (model)
|
|
319
|
+
post_body = opts[:debug_body]
|
|
320
|
+
|
|
321
|
+
# return_type
|
|
322
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
323
|
+
|
|
324
|
+
# auth_names
|
|
325
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
326
|
+
|
|
327
|
+
new_options = opts.merge(
|
|
328
|
+
:operation => :"BingApi.bing_news_search",
|
|
329
|
+
:header_params => header_params,
|
|
330
|
+
:query_params => query_params,
|
|
331
|
+
:form_params => form_params,
|
|
332
|
+
:body => post_body,
|
|
333
|
+
:auth_names => auth_names,
|
|
334
|
+
:return_type => return_type
|
|
335
|
+
)
|
|
336
|
+
|
|
337
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
338
|
+
if @api_client.config.debugging
|
|
339
|
+
@api_client.config.logger.debug "API called: BingApi#bing_news_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
340
|
+
end
|
|
341
|
+
return data, status_code, headers
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
# Search suggestions
|
|
345
|
+
# Bing search-box query suggestions.
|
|
346
|
+
# @param query [String] Partial search term, e.g. 'coff'
|
|
347
|
+
# @param [Hash] opts the optional parameters
|
|
348
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
349
|
+
# @return [Object]
|
|
350
|
+
def bing_search_suggestions(query, opts = {})
|
|
351
|
+
data, _status_code, _headers = bing_search_suggestions_with_http_info(query, opts)
|
|
352
|
+
data
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# Search suggestions
|
|
356
|
+
# Bing search-box query suggestions.
|
|
357
|
+
# @param query [String] Partial search term, e.g. 'coff'
|
|
358
|
+
# @param [Hash] opts the optional parameters
|
|
359
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
360
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
361
|
+
def bing_search_suggestions_with_http_info(query, opts = {})
|
|
362
|
+
if @api_client.config.debugging
|
|
363
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_search_suggestions ...'
|
|
364
|
+
end
|
|
365
|
+
# verify the required parameter 'query' is set
|
|
366
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
367
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BingApi.bing_search_suggestions"
|
|
368
|
+
end
|
|
369
|
+
# resource path
|
|
370
|
+
local_var_path = '/v1/bing/autocomplete'
|
|
371
|
+
|
|
372
|
+
# query parameters
|
|
373
|
+
query_params = opts[:query_params] || {}
|
|
374
|
+
query_params[:'query'] = query
|
|
375
|
+
query_params[:'market'] = opts[:'market'] if !opts[:'market'].nil?
|
|
376
|
+
|
|
377
|
+
# header parameters
|
|
378
|
+
header_params = opts[:header_params] || {}
|
|
379
|
+
# HTTP header 'Accept' (if needed)
|
|
380
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
381
|
+
|
|
382
|
+
# form parameters
|
|
383
|
+
form_params = opts[:form_params] || {}
|
|
384
|
+
|
|
385
|
+
# http body (model)
|
|
386
|
+
post_body = opts[:debug_body]
|
|
387
|
+
|
|
388
|
+
# return_type
|
|
389
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
390
|
+
|
|
391
|
+
# auth_names
|
|
392
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
393
|
+
|
|
394
|
+
new_options = opts.merge(
|
|
395
|
+
:operation => :"BingApi.bing_search_suggestions",
|
|
396
|
+
:header_params => header_params,
|
|
397
|
+
:query_params => query_params,
|
|
398
|
+
:form_params => form_params,
|
|
399
|
+
:body => post_body,
|
|
400
|
+
:auth_names => auth_names,
|
|
401
|
+
:return_type => return_type
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
405
|
+
if @api_client.config.debugging
|
|
406
|
+
@api_client.config.logger.debug "API called: BingApi#bing_search_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
407
|
+
end
|
|
408
|
+
return data, status_code, headers
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# Video search
|
|
412
|
+
# Bing Videos — title, thumbnail, duration, publisher and source per result.
|
|
413
|
+
# @param query [String] Search keywords, e.g. 'espresso tutorial'
|
|
414
|
+
# @param [Hash] opts the optional parameters
|
|
415
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
416
|
+
# @option opts [Integer] :count Results to return (default to 35)
|
|
417
|
+
# @option opts [String] :safe_search off | moderate | strict
|
|
418
|
+
# @return [Object]
|
|
419
|
+
def bing_video_search(query, opts = {})
|
|
420
|
+
data, _status_code, _headers = bing_video_search_with_http_info(query, opts)
|
|
421
|
+
data
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
# Video search
|
|
425
|
+
# Bing Videos — title, thumbnail, duration, publisher and source per result.
|
|
426
|
+
# @param query [String] Search keywords, e.g. 'espresso tutorial'
|
|
427
|
+
# @param [Hash] opts the optional parameters
|
|
428
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
429
|
+
# @option opts [Integer] :count Results to return (default to 35)
|
|
430
|
+
# @option opts [String] :safe_search off | moderate | strict
|
|
431
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
432
|
+
def bing_video_search_with_http_info(query, opts = {})
|
|
433
|
+
if @api_client.config.debugging
|
|
434
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_video_search ...'
|
|
435
|
+
end
|
|
436
|
+
# verify the required parameter 'query' is set
|
|
437
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
438
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BingApi.bing_video_search"
|
|
439
|
+
end
|
|
440
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 150
|
|
441
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling BingApi.bing_video_search, must be smaller than or equal to 150.'
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
|
445
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling BingApi.bing_video_search, must be greater than or equal to 1.'
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# resource path
|
|
449
|
+
local_var_path = '/v1/bing/videos'
|
|
450
|
+
|
|
451
|
+
# query parameters
|
|
452
|
+
query_params = opts[:query_params] || {}
|
|
453
|
+
query_params[:'query'] = query
|
|
454
|
+
query_params[:'market'] = opts[:'market'] if !opts[:'market'].nil?
|
|
455
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
|
456
|
+
query_params[:'safe_search'] = opts[:'safe_search'] if !opts[:'safe_search'].nil?
|
|
457
|
+
|
|
458
|
+
# header parameters
|
|
459
|
+
header_params = opts[:header_params] || {}
|
|
460
|
+
# HTTP header 'Accept' (if needed)
|
|
461
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
462
|
+
|
|
463
|
+
# form parameters
|
|
464
|
+
form_params = opts[:form_params] || {}
|
|
465
|
+
|
|
466
|
+
# http body (model)
|
|
467
|
+
post_body = opts[:debug_body]
|
|
468
|
+
|
|
469
|
+
# return_type
|
|
470
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
471
|
+
|
|
472
|
+
# auth_names
|
|
473
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
474
|
+
|
|
475
|
+
new_options = opts.merge(
|
|
476
|
+
:operation => :"BingApi.bing_video_search",
|
|
477
|
+
:header_params => header_params,
|
|
478
|
+
:query_params => query_params,
|
|
479
|
+
:form_params => form_params,
|
|
480
|
+
:body => post_body,
|
|
481
|
+
:auth_names => auth_names,
|
|
482
|
+
:return_type => return_type
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
486
|
+
if @api_client.config.debugging
|
|
487
|
+
@api_client.config.logger.debug "API called: BingApi#bing_video_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
488
|
+
end
|
|
489
|
+
return data, status_code, headers
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
# Web search
|
|
493
|
+
# Bing web SERP — organic results, ads, related searches and total count.
|
|
494
|
+
# @param query [String] Search keywords, e.g. 'coffee machine'
|
|
495
|
+
# @param [Hash] opts the optional parameters
|
|
496
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
497
|
+
# @option opts [Integer] :count Results per page (1-50) (default to 10)
|
|
498
|
+
# @option opts [Integer] :offset Zero-based result offset for pagination (default to 0)
|
|
499
|
+
# @option opts [String] :safe_search off | moderate | strict (default moderate)
|
|
500
|
+
# @return [Object]
|
|
501
|
+
def bing_web_search(query, opts = {})
|
|
502
|
+
data, _status_code, _headers = bing_web_search_with_http_info(query, opts)
|
|
503
|
+
data
|
|
504
|
+
end
|
|
505
|
+
|
|
506
|
+
# Web search
|
|
507
|
+
# Bing web SERP — organic results, ads, related searches and total count.
|
|
508
|
+
# @param query [String] Search keywords, e.g. 'coffee machine'
|
|
509
|
+
# @param [Hash] opts the optional parameters
|
|
510
|
+
# @option opts [String] :market Bing market code, e.g. 'en-US', 'en-GB', 'de-DE'. See /markets. (default to 'en-US')
|
|
511
|
+
# @option opts [Integer] :count Results per page (1-50) (default to 10)
|
|
512
|
+
# @option opts [Integer] :offset Zero-based result offset for pagination (default to 0)
|
|
513
|
+
# @option opts [String] :safe_search off | moderate | strict (default moderate)
|
|
514
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
515
|
+
def bing_web_search_with_http_info(query, opts = {})
|
|
516
|
+
if @api_client.config.debugging
|
|
517
|
+
@api_client.config.logger.debug 'Calling API: BingApi.bing_web_search ...'
|
|
518
|
+
end
|
|
519
|
+
# verify the required parameter 'query' is set
|
|
520
|
+
if @api_client.config.client_side_validation && query.nil?
|
|
521
|
+
fail ArgumentError, "Missing the required parameter 'query' when calling BingApi.bing_web_search"
|
|
522
|
+
end
|
|
523
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 50
|
|
524
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling BingApi.bing_web_search, must be smaller than or equal to 50.'
|
|
525
|
+
end
|
|
526
|
+
|
|
527
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
|
528
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling BingApi.bing_web_search, must be greater than or equal to 1.'
|
|
529
|
+
end
|
|
530
|
+
|
|
531
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
532
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BingApi.bing_web_search, must be greater than or equal to 0.'
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
# resource path
|
|
536
|
+
local_var_path = '/v1/bing/search'
|
|
537
|
+
|
|
538
|
+
# query parameters
|
|
539
|
+
query_params = opts[:query_params] || {}
|
|
540
|
+
query_params[:'query'] = query
|
|
541
|
+
query_params[:'market'] = opts[:'market'] if !opts[:'market'].nil?
|
|
542
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
|
543
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
544
|
+
query_params[:'safe_search'] = opts[:'safe_search'] if !opts[:'safe_search'].nil?
|
|
545
|
+
|
|
546
|
+
# header parameters
|
|
547
|
+
header_params = opts[:header_params] || {}
|
|
548
|
+
# HTTP header 'Accept' (if needed)
|
|
549
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
550
|
+
|
|
551
|
+
# form parameters
|
|
552
|
+
form_params = opts[:form_params] || {}
|
|
553
|
+
|
|
554
|
+
# http body (model)
|
|
555
|
+
post_body = opts[:debug_body]
|
|
556
|
+
|
|
557
|
+
# return_type
|
|
558
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
559
|
+
|
|
560
|
+
# auth_names
|
|
561
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
562
|
+
|
|
563
|
+
new_options = opts.merge(
|
|
564
|
+
:operation => :"BingApi.bing_web_search",
|
|
565
|
+
:header_params => header_params,
|
|
566
|
+
:query_params => query_params,
|
|
567
|
+
:form_params => form_params,
|
|
568
|
+
:body => post_body,
|
|
569
|
+
:auth_names => auth_names,
|
|
570
|
+
:return_type => return_type
|
|
571
|
+
)
|
|
572
|
+
|
|
573
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
574
|
+
if @api_client.config.debugging
|
|
575
|
+
@api_client.config.logger.debug "API called: BingApi#bing_web_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
576
|
+
end
|
|
577
|
+
return data, status_code, headers
|
|
578
|
+
end
|
|
579
|
+
end
|
|
580
|
+
end
|