Class: ScrapeBadger::AmazonApi

Inherits:
Object
  • Object
show all
Defined in:
lib/scrapebadger/api/amazon_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AmazonApi

Returns a new instance of AmazonApi.



19
20
21
# File 'lib/scrapebadger/api/amazon_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/scrapebadger/api/amazon_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#amazon_amazon_scraper_health_check(opts = {}) ⇒ Object

Amazon scraper health check Check health of the Amazon scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


26
27
28
29
# File 'lib/scrapebadger/api/amazon_api.rb', line 26

def amazon_amazon_scraper_health_check(opts = {})
  data, _status_code, _headers = amazon_amazon_scraper_health_check_with_http_info(opts)
  data
end

#amazon_amazon_scraper_health_check_head(opts = {}) ⇒ Object

Amazon scraper health check Check health of the Amazon scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


83
84
85
86
# File 'lib/scrapebadger/api/amazon_api.rb', line 83

def amazon_amazon_scraper_health_check_head(opts = {})
  data, _status_code, _headers = amazon_amazon_scraper_health_check_head_with_http_info(opts)
  data
end

#amazon_amazon_scraper_health_check_head_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Amazon scraper health check Check health of the Amazon scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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/amazon_api.rb', line 92

def amazon_amazon_scraper_health_check_head_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_amazon_scraper_health_check_head ...'
  end
  # resource path
  local_var_path = '/v1/amazon/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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_amazon_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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_amazon_scraper_health_check_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_amazon_scraper_health_check_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Amazon scraper health check Check health of the Amazon scraper service (accepts HEAD for UptimeRobot).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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/amazon_api.rb', line 35

def amazon_amazon_scraper_health_check_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_amazon_scraper_health_check ...'
  end
  # resource path
  local_var_path = '/v1/amazon/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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_amazon_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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_amazon_scraper_health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_bestsellers_by_category(opts = {}) ⇒ Object

Bestsellers by category Top-selling products for a category (browse node).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :category (String)

    Bestsellers node id or slug

  • :page (Integer) — default: default to 1

Returns:

  • (Object)


143
144
145
146
# File 'lib/scrapebadger/api/amazon_api.rb', line 143

def amazon_bestsellers_by_category(opts = {})
  data, _status_code, _headers = amazon_bestsellers_by_category_with_http_info(opts)
  data
end

#amazon_bestsellers_by_category_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Bestsellers by category Top-selling products for a category (browse node).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :category (String)

    Bestsellers node id or slug

  • :page (Integer) — default: default to 1

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



155
156
157
158
159
160
161
162
163
164
165
166
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
# File 'lib/scrapebadger/api/amazon_api.rb', line 155

def amazon_bestsellers_by_category_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_bestsellers_by_category ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 2
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_bestsellers_by_category, must be smaller than or equal to 2.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_bestsellers_by_category, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/amazon/bestsellers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_bestsellers_by_category",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_bestsellers_by_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_browse_node_category_listing(node, opts = {}) ⇒ Object

Browse-node category listing List products within an Amazon browse-node category.

Parameters:

  • node (String)

    Amazon browse-node id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer) — default: default to 1
  • :sort_by (String)

Returns:

  • (Object)


218
219
220
221
# File 'lib/scrapebadger/api/amazon_api.rb', line 218

def amazon_browse_node_category_listing(node, opts = {})
  data, _status_code, _headers = amazon_browse_node_category_listing_with_http_info(node, opts)
  data
end

#amazon_browse_node_category_listing_with_http_info(node, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Browse-node category listing List products within an Amazon browse-node category.

Parameters:

  • node (String)

    Amazon browse-node id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer) — default: default to 1
  • :sort_by (String)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
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
# File 'lib/scrapebadger/api/amazon_api.rb', line 231

def amazon_browse_node_category_listing_with_http_info(node, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_browse_node_category_listing ...'
  end
  # verify the required parameter 'node' is set
  if @api_client.config.client_side_validation && node.nil?
    fail ArgumentError, "Missing the required parameter 'node' when calling AmazonApi.amazon_browse_node_category_listing"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 20
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_browse_node_category_listing, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_browse_node_category_listing, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/amazon/category'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'node'] = node
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_browse_node_category_listing",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_browse_node_category_listing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_get_all_seller_offers_buybox(asin, opts = {}) ⇒ Object

Get all seller offers (buybox) All third-party offers for an ASIN, including the Buy Box winner.

Parameters:

  • asin (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :zip (String)

Returns:

  • (Object)


298
299
300
301
# File 'lib/scrapebadger/api/amazon_api.rb', line 298

def amazon_get_all_seller_offers_buybox(asin, opts = {})
  data, _status_code, _headers = amazon_get_all_seller_offers_buybox_with_http_info(asin, opts)
  data
end

#amazon_get_all_seller_offers_buybox_with_http_info(asin, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get all seller offers (buybox) All third-party offers for an ASIN, including the Buy Box winner.

Parameters:

  • asin (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :zip (String)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
352
353
354
355
356
357
358
# File 'lib/scrapebadger/api/amazon_api.rb', line 310

def amazon_get_all_seller_offers_buybox_with_http_info(asin, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_get_all_seller_offers_buybox ...'
  end
  # verify the required parameter 'asin' is set
  if @api_client.config.client_side_validation && asin.nil?
    fail ArgumentError, "Missing the required parameter 'asin' when calling AmazonApi.amazon_get_all_seller_offers_buybox"
  end
  # resource path
  local_var_path = '/v1/amazon/products/{asin}/offers'.sub('{' + 'asin' + '}', CGI.escape(asin.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'zip'] = opts[:'zip'] if !opts[:'zip'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_get_all_seller_offers_buybox",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_get_all_seller_offers_buybox\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_get_product_detail(asin, opts = {}) ⇒ Object

Get product detail Full product detail by ASIN (price, variants, badges, buybox, ranks…).

Parameters:

  • asin (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :zip (String)

    Delivery postal/zip for localized buybox

  • :language (String)

Returns:

  • (Object)


368
369
370
371
# File 'lib/scrapebadger/api/amazon_api.rb', line 368

def amazon_get_product_detail(asin, opts = {})
  data, _status_code, _headers = amazon_get_product_detail_with_http_info(asin, opts)
  data
end

#amazon_get_product_detail_with_http_info(asin, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get product detail Full product detail by ASIN (price, variants, badges, buybox, ranks…).

Parameters:

  • asin (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :zip (String)

    Delivery postal/zip for localized buybox

  • :language (String)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
# File 'lib/scrapebadger/api/amazon_api.rb', line 381

def amazon_get_product_detail_with_http_info(asin, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_get_product_detail ...'
  end
  # verify the required parameter 'asin' is set
  if @api_client.config.client_side_validation && asin.nil?
    fail ArgumentError, "Missing the required parameter 'asin' when calling AmazonApi.amazon_get_product_detail"
  end
  # resource path
  local_var_path = '/v1/amazon/products/{asin}'.sub('{' + 'asin' + '}', CGI.escape(asin.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'zip'] = opts[:'zip'] if !opts[:'zip'].nil?
  query_params[:'language'] = opts[:'language'] if !opts[:'language'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_get_product_detail",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_get_product_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_get_product_reviews(asin, opts = {}) ⇒ Object

Get product reviews Customer reviews for an ASIN (featured + paginated, with filters).

Parameters:

  • asin (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer)

    Review page (1-100, ~10 reviews/page) (default to 1)

  • :sort_by (String)

    helpful | recent (default to 'helpful')

  • :star (String)

    one_star..five_star | positive | critical

  • :verified_only (Boolean) — default: default to false
  • :media_only (Boolean) — default: default to false

Returns:

  • (Object)


443
444
445
446
# File 'lib/scrapebadger/api/amazon_api.rb', line 443

def amazon_get_product_reviews(asin, opts = {})
  data, _status_code, _headers = amazon_get_product_reviews_with_http_info(asin, opts)
  data
end

#amazon_get_product_reviews_with_http_info(asin, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get product reviews Customer reviews for an ASIN (featured + paginated, with filters).

Parameters:

  • asin (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer)

    Review page (1-100, ~10 reviews/page) (default to 1)

  • :sort_by (String)

    helpful | recent (default to 'helpful')

  • :star (String)

    one_star..five_star | positive | critical

  • :verified_only (Boolean) — default: default to false
  • :media_only (Boolean) — default: default to false

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/scrapebadger/api/amazon_api.rb', line 459

def amazon_get_product_reviews_with_http_info(asin, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_get_product_reviews ...'
  end
  # verify the required parameter 'asin' is set
  if @api_client.config.client_side_validation && asin.nil?
    fail ArgumentError, "Missing the required parameter 'asin' when calling AmazonApi.amazon_get_product_reviews"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_get_product_reviews, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_get_product_reviews, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/amazon/products/{asin}/reviews'.sub('{' + 'asin' + '}', CGI.escape(asin.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'star'] = opts[:'star'] if !opts[:'star'].nil?
  query_params[:'verified_only'] = opts[:'verified_only'] if !opts[:'verified_only'].nil?
  query_params[:'media_only'] = opts[:'media_only'] if !opts[:'media_only'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_get_product_reviews",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_get_product_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_get_seller_feedback(seller_id, opts = {}) ⇒ Object

Get seller feedback Buyer feedback entries for a seller.

Parameters:

  • seller_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer) — default: default to 1

Returns:

  • (Object)


528
529
530
531
# File 'lib/scrapebadger/api/amazon_api.rb', line 528

def amazon_get_seller_feedback(seller_id, opts = {})
  data, _status_code, _headers = amazon_get_seller_feedback_with_http_info(seller_id, opts)
  data
end

#amazon_get_seller_feedback_with_http_info(seller_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get seller feedback Buyer feedback entries for a seller.

Parameters:

  • seller_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer) — default: default to 1

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



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
590
591
592
# File 'lib/scrapebadger/api/amazon_api.rb', line 540

def amazon_get_seller_feedback_with_http_info(seller_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_get_seller_feedback ...'
  end
  # verify the required parameter 'seller_id' is set
  if @api_client.config.client_side_validation && seller_id.nil?
    fail ArgumentError, "Missing the required parameter 'seller_id' when calling AmazonApi.amazon_get_seller_feedback"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_get_seller_feedback, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/amazon/sellers/{seller_id}/feedback'.sub('{' + 'seller_id' + '}', CGI.escape(seller_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_get_seller_feedback",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_get_seller_feedback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_get_seller_profile(seller_id, opts = {}) ⇒ Object

Get seller profile Seller profile, ratings and feedback summary.

Parameters:

  • seller_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'

Returns:

  • (Object)


600
601
602
603
# File 'lib/scrapebadger/api/amazon_api.rb', line 600

def amazon_get_seller_profile(seller_id, opts = {})
  data, _status_code, _headers = amazon_get_seller_profile_with_http_info(seller_id, opts)
  data
end

#amazon_get_seller_profile_with_http_info(seller_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get seller profile Seller profile, ratings and feedback summary.

Parameters:

  • seller_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



611
612
613
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
# File 'lib/scrapebadger/api/amazon_api.rb', line 611

def amazon_get_seller_profile_with_http_info(seller_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_get_seller_profile ...'
  end
  # verify the required parameter 'seller_id' is set
  if @api_client.config.client_side_validation && seller_id.nil?
    fail ArgumentError, "Missing the required parameter 'seller_id' when calling AmazonApi.amazon_get_seller_profile"
  end
  # resource path
  local_var_path = '/v1/amazon/sellers/{seller_id}'.sub('{' + 'seller_id' + '}', CGI.escape(seller_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_get_seller_profile",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_get_seller_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_get_seller_storefront_products(seller_id, opts = {}) ⇒ Object

Get seller storefront products Products listed in a seller's storefront.

Parameters:

  • seller_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer) — default: default to 1

Returns:

  • (Object)


667
668
669
670
# File 'lib/scrapebadger/api/amazon_api.rb', line 667

def amazon_get_seller_storefront_products(seller_id, opts = {})
  data, _status_code, _headers = amazon_get_seller_storefront_products_with_http_info(seller_id, opts)
  data
end

#amazon_get_seller_storefront_products_with_http_info(seller_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get seller storefront products Products listed in a seller's storefront.

Parameters:

  • seller_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :page (Integer) — default: default to 1

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
# File 'lib/scrapebadger/api/amazon_api.rb', line 679

def amazon_get_seller_storefront_products_with_http_info(seller_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_get_seller_storefront_products ...'
  end
  # verify the required parameter 'seller_id' is set
  if @api_client.config.client_side_validation && seller_id.nil?
    fail ArgumentError, "Missing the required parameter 'seller_id' when calling AmazonApi.amazon_get_seller_storefront_products"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_get_seller_storefront_products, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/amazon/sellers/{seller_id}/products'.sub('{' + 'seller_id' + '}', CGI.escape(seller_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_get_seller_storefront_products",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_get_seller_storefront_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_keyword_suggestions(query, opts = {}) ⇒ Object

Keyword suggestions Get Amazon search autocomplete suggestions for keyword research.

Parameters:

  • query (String)

    Partial search term

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'

Returns:

  • (Object)


739
740
741
742
# File 'lib/scrapebadger/api/amazon_api.rb', line 739

def amazon_keyword_suggestions(query, opts = {})
  data, _status_code, _headers = amazon_keyword_suggestions_with_http_info(query, opts)
  data
end

#amazon_keyword_suggestions_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Keyword suggestions Get Amazon search autocomplete suggestions for keyword research.

Parameters:

  • query (String)

    Partial search term

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
# File 'lib/scrapebadger/api/amazon_api.rb', line 750

def amazon_keyword_suggestions_with_http_info(query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_keyword_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 AmazonApi.amazon_keyword_suggestions"
  end
  # resource path
  local_var_path = '/v1/amazon/autocomplete'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'query'] = query
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_keyword_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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_keyword_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_list_category_aliases(opts = {}) ⇒ Object

List category aliases List common Amazon department/category aliases and bestseller nodes.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'

Returns:

  • (Object)


805
806
807
808
# File 'lib/scrapebadger/api/amazon_api.rb', line 805

def amazon_list_category_aliases(opts = {})
  data, _status_code, _headers = amazon_list_category_aliases_with_http_info(opts)
  data
end

#amazon_list_category_aliases_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

List category aliases List common Amazon department/category aliases and bestseller nodes.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
# File 'lib/scrapebadger/api/amazon_api.rb', line 815

def amazon_list_category_aliases_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_list_category_aliases ...'
  end
  # resource path
  local_var_path = '/v1/amazon/categories'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_list_category_aliases",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_list_category_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_list_marketplaces(opts = {}) ⇒ Object

List marketplaces List all supported Amazon marketplaces.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


864
865
866
867
# File 'lib/scrapebadger/api/amazon_api.rb', line 864

def amazon_list_marketplaces(opts = {})
  data, _status_code, _headers = amazon_list_marketplaces_with_http_info(opts)
  data
end

#amazon_list_marketplaces_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

List marketplaces List all supported Amazon marketplaces.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
# File 'lib/scrapebadger/api/amazon_api.rb', line 873

def amazon_list_marketplaces_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_list_marketplaces ...'
  end
  # resource path
  local_var_path = '/v1/amazon/markets'

  # 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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_list_marketplaces",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_list_marketplaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_new_releases_by_category(opts = {}) ⇒ Object

New releases by category Newly released products for a category (browse node).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :category (String)
  • :page (Integer) — default: default to 1

Returns:

  • (Object)


924
925
926
927
# File 'lib/scrapebadger/api/amazon_api.rb', line 924

def amazon_new_releases_by_category(opts = {})
  data, _status_code, _headers = amazon_new_releases_by_category_with_http_info(opts)
  data
end

#amazon_new_releases_by_category_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

New releases by category Newly released products for a category (browse node).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :category (String)
  • :page (Integer) — default: default to 1

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
# File 'lib/scrapebadger/api/amazon_api.rb', line 936

def amazon_new_releases_by_category_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_new_releases_by_category ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 2
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_new_releases_by_category, must be smaller than or equal to 2.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_new_releases_by_category, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/amazon/new-releases'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_new_releases_by_category",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_new_releases_by_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_search_amazon_products(query, opts = {}) ⇒ Object

Search Amazon products Search the Amazon catalog with filters and sorting.

Parameters:

  • query (String)

    Search keywords

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String)

    Amazon marketplace TLD or code (com, co.uk, de…) (default to 'com')

  • :page (Integer) — default: default to 1
  • :sort_by (String)

    relevance | price_low_to_high | price_high_to_low | avg_review | newest

  • :category (String)

    Department/category alias (i= param)

  • :min_price (Float)
  • :max_price (Float)
  • :zip (String)

    Delivery postal/zip code for localized pricing

  • :language (String)

    Locale for results, e.g. en_US, fr_FR

Returns:

  • (Object)


1004
1005
1006
1007
# File 'lib/scrapebadger/api/amazon_api.rb', line 1004

def amazon_search_amazon_products(query, opts = {})
  data, _status_code, _headers = amazon_search_amazon_products_with_http_info(query, opts)
  data
end

#amazon_search_amazon_products_with_http_info(query, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Search Amazon products Search the Amazon catalog with filters and sorting.

Parameters:

  • query (String)

    Search keywords

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String)

    Amazon marketplace TLD or code (com, co.uk, de…) (default to 'com')

  • :page (Integer) — default: default to 1
  • :sort_by (String)

    relevance | price_low_to_high | price_high_to_low | avg_review | newest

  • :category (String)

    Department/category alias (i= param)

  • :min_price (Float)
  • :max_price (Float)
  • :zip (String)

    Delivery postal/zip code for localized pricing

  • :language (String)

    Locale for results, e.g. en_US, fr_FR

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'lib/scrapebadger/api/amazon_api.rb', line 1022

def amazon_search_amazon_products_with_http_info(query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_search_amazon_products ...'
  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 AmazonApi.amazon_search_amazon_products"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] > 20
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_search_amazon_products, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_search_amazon_products, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'min_price'].nil? && opts[:'min_price'] < 0
    fail ArgumentError, 'invalid value for "opts[:"min_price"]" when calling AmazonApi.amazon_search_amazon_products, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_price'].nil? && opts[:'max_price'] < 0
    fail ArgumentError, 'invalid value for "opts[:"max_price"]" when calling AmazonApi.amazon_search_amazon_products, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/v1/amazon/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'query'] = query
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].nil?
  query_params[:'min_price'] = opts[:'min_price'] if !opts[:'min_price'].nil?
  query_params[:'max_price'] = opts[:'max_price'] if !opts[:'max_price'].nil?
  query_params[:'zip'] = opts[:'zip'] if !opts[:'zip'].nil?
  query_params[:'language'] = opts[:'language'] if !opts[:'language'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_search_amazon_products",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_search_amazon_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#amazon_today_s_deals(opts = {}) ⇒ Object

Today's deals Current Amazon deals (lightning deals, best deals).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :category (String)
  • :page (Integer) — default: default to 1

Returns:

  • (Object)


1102
1103
1104
1105
# File 'lib/scrapebadger/api/amazon_api.rb', line 1102

def amazon_today_s_deals(opts = {})
  data, _status_code, _headers = amazon_today_s_deals_with_http_info(opts)
  data
end

#amazon_today_s_deals_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Today's deals Current Amazon deals (lightning deals, best deals).

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :domain (String) — default: default to 'com'
  • :category (String)
  • :page (Integer) — default: default to 1

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
# File 'lib/scrapebadger/api/amazon_api.rb', line 1114

def amazon_today_s_deals_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AmazonApi.amazon_today_s_deals ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AmazonApi.amazon_today_s_deals, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/amazon/deals'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].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']

  new_options = opts.merge(
    :operation => :"AmazonApi.amazon_today_s_deals",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AmazonApi#amazon_today_s_deals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end