Class: Peddler::API::CatalogItems20201201

Inherits:
Peddler::API show all
Defined in:
lib/peddler/api/catalog_items_2020_12_01.rb

Overview

Selling Partner API for Catalog Items

The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog. For more information, see the href="https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2020-12-01-use-case-guide">https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v2020-12-01-use-case-guide Catalog Items API Use Case Guide.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#get_catalog_item(asin, marketplace_ids, included_data: "summaries", locale: nil, rate_limit: 2.0) ⇒ Hash

Note:

This operation can make a static sandbox call.

Retrieves details for an item in the Amazon catalog.

Parameters:

  • asin (String)

    The Amazon Standard Identification Number (ASIN) of the item.

  • marketplace_ids (Array<String>)

    A comma-delimited list of Amazon marketplace identifiers. Data sets in the response contain data only for the specified marketplaces.

  • included_data (Array<String>) (defaults to: "summaries")

    A comma-delimited list of data sets to include in the response. Default: summaries.

  • locale (String) (defaults to: nil)

    Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:

  • (Hash)

    The API response



70
71
72
73
74
75
76
77
78
79
# File 'lib/peddler/api/catalog_items_2020_12_01.rb', line 70

def get_catalog_item(asin, marketplace_ids, included_data: "summaries", locale: nil, rate_limit: 2.0)
  path = "/catalog/2020-12-01/items/#{asin}"
  params = {
    "marketplaceIds" => marketplace_ids,
    "includedData" => included_data,
    "locale" => locale,
  }.compact

  meter(rate_limit).get(path, params:)
end

#search_catalog_items(keywords, marketplace_ids, included_data: "summaries", brand_names: nil, classification_ids: nil, page_size: 10, page_token: nil, keywords_locale: nil, locale: nil, rate_limit: 2.0) ⇒ Hash

Note:

This operation can make a static sandbox call.

Search for and return a list of Amazon catalog items and associated information.

Parameters:

  • keywords (Array<String>)

    A comma-delimited list of words or item identifiers to search the Amazon catalog for.

  • marketplace_ids (Array<String>)

    A comma-delimited list of Amazon marketplace identifiers for the request.

  • included_data (Array<String>) (defaults to: "summaries")

    A comma-delimited list of data sets to include in the response. Default: summaries.

  • brand_names (Array<String>) (defaults to: nil)

    A comma-delimited list of brand names to limit the search to.

  • classification_ids (Array<String>) (defaults to: nil)

    A comma-delimited list of classification identifiers to limit the search to.

  • page_size (Integer) (defaults to: 10)

    Number of results to be returned per page.

  • page_token (String) (defaults to: nil)

    A token to fetch a certain page when there are multiple pages worth of results.

  • keywords_locale (String) (defaults to: nil)

    The language the keywords are provided in. Defaults to the primary locale of the marketplace.

  • locale (String) (defaults to: nil)

    Locale for retrieving localized summaries. Defaults to the primary locale of the marketplace.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:

  • (Hash)

    The API response



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/peddler/api/catalog_items_2020_12_01.rb', line 40

def search_catalog_items(keywords, marketplace_ids, included_data: "summaries", brand_names: nil,
  classification_ids: nil, page_size: 10, page_token: nil, keywords_locale: nil, locale: nil, rate_limit: 2.0)
  path = "/catalog/2020-12-01/items"
  params = {
    "keywords" => keywords,
    "marketplaceIds" => marketplace_ids,
    "includedData" => included_data,
    "brandNames" => brand_names,
    "classificationIds" => classification_ids,
    "pageSize" => page_size,
    "pageToken" => page_token,
    "keywordsLocale" => keywords_locale,
    "locale" => locale,
  }.compact

  meter(rate_limit).get(path, params:)
end