NEWScrapingAnt MCP for Claude Code, Cursor & Windsurf — try it free →
Skip to main content

Amazon Product Scraping. Relatively Easy.

· 5 min read
Oleg Kulyk
Co-Founder @ ScrapingAnt

Amazon product scraping

Updated 2026-10-26

The ScrapingAnt examples now use the current /v2/general endpoint and Node's built-in fetch instead of the retired /v1 endpoint and got. Both were run once against the live API on 2026-10-26, and the product links below are that run's output.

In the current article, I’d like to share my experience with Amazon products scraping. The well-known Amazon marketplace offers the best deals for thousands of product types and from thousands of sellers. The potential amount of data to scrape is quite insane and can be used for:

  • Market price comparison
  • Price change tracking
  • Analyzing product reviews
  • Copyright check
  • Finding the best products for selling or dropshipping
  • A lot of data science and machine learning stuff

So Amazon looks like one of the biggest sources for receiving data for products. All the code will be provided in understandable chunks, but feel free to contact us if you have any questions. Let’s have a deeper dive!

Technology stack for product scraping​

For Amazon scraping I have selected the following stack:

  • NodeJS as a platform for running JS code
  • Cheerio library for DOM manipulation and data retrieving
  • The built-in fetch of Node.js 18 or newer for HTTP requests

That’s all you need to start. Cheerio library allows you to act with DOM in JQuery-like style, so you can test all your selectors in the browser and then copy-paste them to your code. For more info just refer to the official page: https://cheerio.js.org/

Exact Web Scraping​

Let’s scrape all the products with some particular keyword, for example, baking mat

The search URL will have the following look: https://amazon.com/s?k=baking+mat

So we can try to get the data from this page with the following code:

const keyword = 'baking mat';

const response = await fetch(`https://www.amazon.com/s?k=${encodeURIComponent(keyword)}`);
console.log(response.status, (await response.text()).length);
503 2671

But in your console you will not see any products. Amazon recognized our request as a bot request: on our 2026-10-26 run it answered 503 with a short "Sorry! Something went wrong!" page instead of results (when this guide was first written, it was a CAPTCHA). How to deal with it? We need to pretend to be a real browser (to store cookies, as Amazon proposes). So that problem is easily resolved with ScrapingAnt web scraping API, which under the hood runs a real Chrome browser that you can use from your code.

Let’s modify our code a bit for using ScrapingAnt API, but before it, we need to get an API token for using the API. Just visit https://app.scrapingant.com/signup and register for free to start scraping with headless Chrome. Each example is an ES module, so save it as an .mjs file and run it with node.

const apiToken = 'YOUR_API_KEY';
const keyword = 'baking mat';

const params = new URLSearchParams({
url: `https://www.amazon.com/s?k=${encodeURIComponent(keyword)}`,
'x-api-key': apiToken,
});
const response = await fetch(`https://api.scrapingant.com/v2/general?${params}`);
const html = await response.text();
console.log(response.status, response.headers.get('ant-page-status-code'), html.length, 'characters of HTML');
200 200 1971997 characters of HTML

The first number is the API status and the second, Ant-Page-Status-Code, is Amazon's own status. Instead of an error or CAPTCHA page you now get the full rendered search page. But how to get, for example, product URLs? Let Cheerio help us.

After checking the response we can conclude that every search result is a div with data-component-type="s-search-result", and its data-asin attribute is the Amazon product's unique ID. Let’s grab them all to collect the links:

import * as cheerio from 'cheerio';

const apiToken = 'YOUR_API_KEY';
const keyword = 'baking mat';

const params = new URLSearchParams({
url: `https://www.amazon.com/s?k=${encodeURIComponent(keyword)}`,
'x-api-key': apiToken,
});
const response = await fetch(`https://api.scrapingant.com/v2/general?${params}`);
const $ = cheerio.load(await response.text());

const asins = new Set();
$('div[data-component-type="s-search-result"]').each((_, el) => {
const asin = $(el).attr('data-asin');
if (asin) asins.add(asin);
});
for (const asin of asins) {
console.log(`https://www.amazon.com/dp/${asin}`);
}

That’s all. Our run printed 56 product links; the first ten:

https://www.amazon.com/dp/B08598F7JT
https://www.amazon.com/dp/B0CFTP6JR4
https://www.amazon.com/dp/B0GWC6GQT2
https://www.amazon.com/dp/B0CT2MYYJH
https://www.amazon.com/dp/B01ACUA8HC
https://www.amazon.com/dp/B0F1SLYH15
https://www.amazon.com/dp/B07MLGQZ65
https://www.amazon.com/dp/B0HFS7K4GP
https://www.amazon.com/dp/B0725GYNG6
https://www.amazon.com/dp/B0CMSR4C37
...

What’s next?​

There is a lot of possible data to scrape from the page: thumbnail, price, title, rating.

Also the pagination can be added, crawling through pages, etc., but all the described data can be retrieved from our open-source Amazon parser:

Skip the proxy and browser setup

Pass the URL to one ScrapingAnt endpoint and the request goes out through rotating proxies and a headless browser.