Socket
Socket
Sign inDemoInstall

aws-product-api

Package Overview
Dependencies
3
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aws-product-api

Simple service to send REST calls to Amazon Web Services Product Advertising API and return a Javascript Object


Version published
Maintainers
1
Install size
4.70 MB
Created

Readme

Source

Node.js client for Amazon Product Advertising API Version 2013-08-01

Installation

Install using npm:

npm install aws-product-api

Usage

Require library

amazon = require('aws-product-api');

Create REST Object

var RESTobj = new amazon("Secret_Key", "AWS_ID", "Associate_Tag");

Now you can search for items on amazon:

This is a complete implementation of the Product Advertising API, you must specify an Operation and any required entries.

ItemLookup:

RESTobj.Query({
  Operation: "ItemLookup",
  ItemID: "ID1,ID2",
  ResponseGroup: "Large"
}, function(err, results) {
  if (err) {
	  // err.Error: [ { Code: [ String ], Message: [ String ] } ]
  } else {
	  // items: [ { Request: [ [ Object ] ], Item: [ [ Object ], [ Object ] ] } ]
  }
});

RESTob.Query can return an es-6 Promise:

RESTobj.Query({
  Operation: "ItemLookup",
  ItemID: "ID1,ID2",
  ResponseGroup: "Large"
}).then(function(items){
	// items: [ { Request: [ [ Object ] ], Item: [ [ Object ], [ Object ] ] } ]
}).catch(function(err){
	// err.Error: [ { Code: [ String ], Message: [ String ] } ]
});

###Query object options:

ASIN:
Default: None
Valid Values: Valid ASIN.
Constraint: Required if an OfferListingId is not specified.

Action:
Default: None
Valid Values:

  • MoveToCart
  • SaveForLater

CartId:
Default: None
Valid Values: Value returned by CartCreate.

CartItemId:
Default: None
Valid Values: Value returned by CartCreate or CartAdd.

Condition:
Default: New
Valid Values:

  • Used
  • Collectible
  • Refurbished, All

HMAC:
Default: None
Valid Values: Value is calculated using request parameters, their values, a cryptographic function, and the Secret Key, which acts as the "key" for the function.

IdType:
Default: ASIN
Valid Values:

  • SKU
  • UPC
  • EAN
  • ISBN (US only, when search index is Books). UPC is not valid in the CA locale.

IncludeReviewsSummary:
Default: True
Valid Values:

  • True
  • False

Item:
For REST, a prefix for ASIN and quantity, both of which are used to specify the item to add to the cart, for example, item.1.ASIN=1234abcd, item.1.quantity=2. Valid Values: Use an array of objects e.g.

Item: [
  {
    ASIN: "ID1", 
    Quantity: 2
  }, 
  {
    ASIN: "ID2", 
    Quantity: 1
  }
];

ItemId:
Default: None
Constraints: Must be a valid item ID.
For more than one ID, use a comma-separated list of up to ten IDs.

MarketplaceDomain:
Valid values: Amazon

MerchantId:
Valid values: Amazon

OfferListingId:
Default: None
Valid Values: Valid offer listing ID.
Constraint: Required if ASIN is not offered

Operation:
Valid values:

  • BrowseNodeLookup
  • CartAdd
  • CartClear
  • CartCreate
  • CartGet
  • CartModify
  • ItemLookup
  • ItemSearch
  • SimilarityLookup

Quantity:
Default: None
Valid Values: Positive integer between 1 and 999, inclusive

RelatedItemPage:
Valid values: Page Number

RelationshipType:
Goto RelationshipTypes to view valid values

ResponseGroup:
Default: Small
Valid Values:

  • Accessories
  • BrowseNodes
  • EditorialReview
  • Images
  • ItemAttributes
  • ItemIds
  • Large
  • Medium
  • OfferFull
  • Offers
  • PromotionSummary
  • OfferSummary| RelatedItems
  • Reviews
  • SalesRank
  • Similarities
  • Small
  • Tracks
  • VariationImages
  • Variations (US only)
  • VariationSummary You may use a comma separated list to return multiple Response Groups

SearchIndex:
Default: None
Valid Values: A search index, for example, Apparel, Beauty, Blended, Books, and so forth. For a complete of search indices, see Locale Reference.
Constraint:If ItemIdis an ASIN, a search index cannot be specified in the request.
Required for non-ASIN ItemIds.

SimilarityType:
Default: Intersection
Valid Value: Random

TruncateReviewsAt:
Valid values: Amazon

Validate:
True tests your request without returning results.
Default: False
Valid values: True, False

VariationPage:
Default: All
Valid Values: Integer between 1 and 150, inclusive

Version:
Default: 2013-08-01

Keywords

FAQs

Last updated on 09 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc