npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-product-api

v1.2.5

Published

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

Downloads

23

Readme

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