Want to grab Amazon product details—prices, reviews, and more—by scraping them into your project? You're in the right place!

You can scrape this data with a straightforward GET request using our new Amazon Search Engine Results API.

Amazon Search Engine Results API - SerpApi
Scrape Amazon search engine products and categories with SerpApi’s Amazon Search Engine Results API. Product links, prices, ratings, delivery information, sponsored products, and more.

Available data on the Amazon Search API

Here is the list of data you can retrieve from this Amazon Search API:

  • product ads (when available)
  • organic results
  • video results
  • related searches
  • sponsored brands
Amazon Search API data response visual

The organic_results will include information like:

  • position
  • ASIN (Amazon Standard Identification Number)
  • badges
  • title
  • link
  • thumbnail
  • rating
  • reviews
  • price
  • offers
  • and more!

This is perfect if you need to collect product data from Amazon. It's also useful if you're looking to monitor your competitor's products at an online store like Amazon.

How to scrape Amazon Product Data?

Now, let's see how to use this simple API from SerpApi to collect the data!

scraping Amazon product data thumbnail

Get your API Key
First, ensure to register at serpapi.com to get your API Key. You can get 100 free searches per month. You can use this API Key to access all of our APIs, including the Amazon Search API.

Available parameters
On top of running the basic search, you can see all of our available parameters here.

Video Tutorial
We also have a video tutorial on scraping Amazon on YouTube:

cURL Implementation

Here is the basic implementation in cURL:

curl --get https://serpapi.com/search \
 -d api_key="YOUR_API_KEY" \
 -d engine="amazon" \
 -d k="Coffee"

The k parameter is responsible for the search query.

Sample response on Terminal

Python Implementation

Next, let's see how to scrape the Amazon search results in Python.

Preparation for accessing the SerpApi API in Python

  • Create a new main.py file
  • Install requests with:
pip install requests

Here is what the basic setup looks like:

import requests
SERPAPI_API_KEY = "YOUR_REAL_SERPAPI_API_KEY"

params = {
    "api_key": SERPAPI_API_KEY, #replace with your real API Key
    # soon
}

search = requests.get("https://serpapi.com/search", params=params)
response = search.json()
print(response)

With these few lines of code, we can access all of the search engines available at SerpApi, including the Amazon Search API.

import requests
SERPAPI_API_KEY = "YOUR_SERPAPI_API_KEY"

params = {
    "api_key": SERPAPI_API_KEY, 
    "engine": "amazon",
    "k": "Coffee"
}

search = requests.get("https://serpapi.com/search", params=params)
response = search.json()
print(response)

To make it easier to see the response, let's add indentation.

import json

# ...
# ...
# all previous code

print(json.dumps(response, indent=2))

Print specific information
Let's say we only need the title, ASIN, thumbnail, price, rating, reviews, and link; This is how we can print specific columns from the organic results:

# ...
search = requests.get("https://serpapi.com/search", params=params)
response = search.json()

for result in response.get("organic_results", []):
    title = result.get("title")
    asin = result.get("asin")
    thumbnail = result.get("thumbnail")
    price = result.get("price")
    rating = result.get("rating")
    reviews = result.get("reviews")
    link = result.get("link")

    print(f"Title: {title}")
    print(f"ASIN: {asin}")
    print(f"Thumbnail: {thumbnail}")
    print(f"Price: {price}")
    print(f"Rating: {rating}")
    print(f"Reviews: {reviews}")
    print(f"Link: {link}")
    print("-" * 10)
sample response from Amazon organic results

Export data to a CSV file
Let's see how to export this Amazon product data into a CSV file in Python

import csv

with open("amazon_results.csv", "w", newline="", encoding="utf-8") as csvfile:
    fieldnames = ["title", "asin", "thumbnail", "price", "rating", "reviews", "link"]
    writer = csv.DictWriter(csvfile, fieldnames=fieldnames)

    writer.writeheader()
    for result in response.get("organic_results", []):
        writer.writerow({
            "title": result.get("title"),
            "asin": result.get("asin"),
            "thumbnail": result.get("thumbnail"),
            "price": result.get("price"),
            "rating": result.get("rating"),
            "reviews": result.get("reviews"),
            "link": result.get("link")
        })
print("Data exported to amazon_results.csv successfully.")
Export Amazon product data into a CSV file

JavaScript implementation

Finally, let's see how to scrape the Amazon search results in JavaScript.

Install the serpapi package:

npm install serpapi

Run a basic query:

const { getJson } = require("serpapi");
getJson({
  engine: "amazon",
  api_key: API_KEY, // Put your API Key
  k: "coffee"
}, (json) => {
  console.log(json["organic_results"]);
});

More information on our JavaScript library: GitHub - SerpApi-javascript

Other programming languages

While you can use our APIs using a simple GET request with any programming language, you can also see our ready-to-use libraries here: SerpApi Integrations.

We provide many filters to customize or filter your programmatic search.

Localize the results:
You can localize the results by adjusting the amazon_domain and language parameter.

  • amazon_domain: Parameter defines the Amazon domain to use. It defaults to amazon.com. Head to Amazon domains for a full list of supported Amazon domains.
  • language: Parameter defines the language to use for the Amazon search. It's a locale name represented as <language>_<REGION>. (e.g., on amazon.com en_US for English, es_US for Spanish, or on amazon.co.jp ja_JP for Japanese). Head to the following page for a complete list of supported Amazon languages.

Example using a different Amazon domain:

curl --get https://serpapi.com/search \
 -d api_key="YOUR_API_KEY" \
 -d engine="amazon" \
 -d k="Coffee" \
 -d amazon_domain="amazon.fr"

As you can see, the results are now returned from Amazon French:

Amazon search on different domain

Advanced Parameters:

  • delivery_zip: ZIP Postal code. To filter the shipping products by a selected area.
  • shipping_location: Shipping country. To filter the shipping products by a selected country.
  • s: Parameter is used to sort results. Available options:

relevanceblender - Featured (default)
price-asc-rank - Price: Low to High
price-desc-rank - Price: High to Low
review-rank - Avg. Customer Review
date-desc-rank - Newest Arrivals
exact-aware-popularity-rank - Best Sellers

You can see more of the available parameters on this documentation page.

How to paginate the results?

You can scrape beyond the first page using the page parameter. The default value is 1 for the page result. You can then increase it by one for the next pages.

2 for the 2nd page of results, 3 for the 3rd page of results, etc..

Frequently Asked Questions (FAQs)

Is it legal to scrape the Amazon website?
Scraping publicly available data from websites like Amazon is generally permitted under U.S. law.

How much does it cost?
Register at serpapi.com to start for free. If you want to scale, we offer tiered plans based on your usage.

Why do you need to scrape Amazon product data?
Scraping Amazon product data can provide valuable insights for businesses and individuals looking to enhance their competitive edge and inform decision-making. It allows for effective price monitoring, enabling companies to track price changes over time, adjust their pricing strategies, and implement dynamic pricing to stay competitive in the marketplace.

Additionally, it facilitates comprehensive market research by gathering data on competitor products, reviews, ratings, and sales ranks, which helps understand market trends and customer preferences. Scraping data can also improve inventory management by monitoring stock levels and availability. For consumers and businesses alike, it aids in product comparison, keyword research for visibility optimization, and review analysis to identify common issues and customer sentiment.

Moreover, it can assist in estimating sales volume and generating leads for potential products to promote.

Closing

That's it! Thank you very much for reading this blog post. You can play around for free on our playground here.

If you need other resources to collect more data on a product or monitor prices, please check our other awesome APIs: