How to Scrape ASINs from Amazon

If you are looking for the right product to sell on Amazon, you might have found that there are not many options for exporting a large amount of product information, especially ASINs, from a product search. Even those who provide analytics apps for Amazon can't export more than 100 items at a time, and, even worse, they are limited only to the top 100 items. This means if you are looking for products that aren't very popular yet or have low competition, you can't programmatically get a large amount of identifying product info in bulk.

So what are you left with? Typically, sellers resort to copy-pasting to get their information off of Amazon to base their decisions on. While this may work, it is tedious and time-consuming. To get around the initial phase of getting ASINs, I've developed a quick and easy browser script to scrape 

Scraping ASINs from Amazon

The first thing you'll want to do is perform a product search on Amazon and narrow down your search using all of the filtering options you need. Once complete you should land on a results page that should look like this.

While on this page, open up your browser console by right-clicking anywhere on the page and selecting "Inspect". A window will then open up in your browser. At the top of the new window, there will be a series of tabs, click on the one called "Console". This tab lets you enter custom commands to perform operations on the page you have loaded.

Now, you'll want to want to paste the following code in the console and press enter:

for (var i=0;i<2000;i++) try{console.log (document.getElementById("result_"+i).getAttribute("data-asin"));}catch(e){}

This will instantly copy all of the ASINs found on this search results page so you can easily copy and paste them in your favorite spreadsheet editor. With the console still open, you can select the next page of the Amazon search results. Select the "Preserve log" checkbox if you want to use this script continuously and copy and paste only once.

So let's say you copied 10 pages of Amazon search results from the console to your favorite spreadsheet editor, you might have noticed that they have a little junk text from the console still attached to them. We can remove that easily. In this example, I'll use a Google Sheet (but you can use any editor for this) formula to remove it. With your ASINs copied in column A, paste the following formula in column b

=RIGHT(A1,10)

This will leave you with some clean looking ASINs. So what to do next? With your target ASINs scraped from Amazon you can now plug them into 3rd party tools to track their prices and mass export their vital information. There's a tool I developed here that can help you do exactly that.