Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Amazon item images and description from ASIN

I'm doing a sort of shopping list web app in which you can link items to their Amazon's equivalent.

But I'm wondering how to do so. Is there any API? If so, is there a javascript API?

I'd like to:

a) Fetch an item image and description using their ASIN

b) Fetch search's results for a certain term.

Any suggestions/help is welcome!

Thanks!

like image 458
Tommy B. Avatar asked Jul 29 '12 03:07

Tommy B.


People also ask

How do I find a product through ASIN?

A quick way to find the ASIN is to search for the item on Amazon and go to its product detail page. The ASIN will be printed on the page, as shown in Figure 1-3. If the ASIN can't be found anywhere on the page, you can always find it in the URL.

How do I use Amazon ASIN?

When creating a listing using Amazon's 'Add a Product' tool within your Seller Central account, you can search for existing ASINs by typing a product's name, model number, UPC, EAN or – if you already know it – the ASIN. This will show you the existing listings on Amazon.

What is ASINs in Amazon?

ASIN (Amazon Standard Identification Number) is one of the unique product identifiers used for managing the Amazon product catalog. In a technical sense, it's a 10-digit code made up of numbers and letters.


1 Answers

You can do that by using node-apac, a node.js client for Amazon's Product Advertising API. However, to use the Amazon API you have to open a Amazon Web Services (AWS) account. Follow these steps.

  1. Open a AWS account. Note: Amazon will ask you for a credit card on sign-up, but the Product Advertising API is free, so you won't be charged.

  2. Login into your AWS account and go to Security Credentials page to find out your Access Key ID and Secret Access Key

  3. Enroll into Amazon Associates Program and get your Associate Tag. This will allow you to receive commission from Amazon for the referrals you send to them.

  4. Install node-apac

    npm install apac@latest
    
  5. Here is a code snippet that accomplishes your task b) for Amazon search query. It comes from the node-apac page, credit goes to dmcquay

    var util = require('util'),
    OperationHelper = require('apac').OperationHelper;
    
    var opHelper = new OperationHelper({
        awsId:     '[YOUR ACCESS KEY ID HERE]',
        awsSecret: '[YOUR SECRET ACCESS KEY HERE]',
        assocId:   '[YOUR ASSOCIATE TAG HERE]', 
    });
    
    opHelper.execute('ItemSearch', {
        'SearchIndex': 'Books',
        'Keywords': 'harry potter',
        'ResponseGroup': 'ItemAttributes,Offers'
    }, function(error, results) {
        if (error) { console.log('Error: ' + error + "\n"); }
        console.log("Results:\n" + util.inspect(results) + "\n");
    });
    

For the task a) of fetching an item image and description you do this:

opHelper.execute('ItemLookup', {
    'ItemId': '[ASIN GOES HERE]',
    'MechantId': 'All',
    'Condition': 'All',
    'ResponseGroup': 'Medium'
}, function(error, results) {
    if (error) { console.log('Error: ' + error + "\n"); }
    console.log("Results:\n" + util.inspect(results) + "\n");
});

That's it. Check the "results" object for the fields you need. It should include product images, description, and a lot more.

like image 67
Arik G Avatar answered Oct 19 '22 22:10

Arik G