amazon-scraper-python: pulling product ratings and reviews out of Amazon search pages
Non-official client to get some info about products sold on Amazon
At a glance
- What is it?
- amazonscraper is a small, non-official Python client that searches Amazon and returns a list of products with their title, rating, review count, URL, image URL and ASIN, plus an amazon2csv command that writes the same thing to a spreadsheet. It works by parsing the search results page with CSS selectors, which is both its strength and the reason the author left two items on the todo list.
- Who is it for?
- amazon-scraper-python suits a quick script that needs a handful of product ratings and review counts for a list of ASINs, and it suits a developer who wants to see the parsing rather than depend on a hosted API. It does not suit a production pipeline, because the selection is done with CSS selectors against a page layout the author expects to change, and the two open todo items are exactly that problem.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 7 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
A package and a command line tool from one install
The package is published on PyPI as amazonscraper and the install is one pip command:
pip3 install -U amazonscraperThe requirements are Python 3 and pip3, and the package brings in three libraries, requests at 2.6.0 or newer, click at 6.7 or newer and beautifulsoup4 at 4.6.0 or newer. The split between the library and the tool is simple. The amazonscraper package is the importable API, and the setup script registers a console script named amazon2csv.py, which is the same operation with the results written to standard output so a shell redirection captures them. The project calls itself a non-official client, and the author links to a French blog post about the tool, which is where the design decisions are explained in more depth than the readme gives. The licence is MIT, the primary language is Python, and the last push was on 2026-10-16 with no GitHub releases published.
The CSV output is the point for most users
The command line tool takes a search request and an optional maximum number of products and writes the results as comma separated values:
amazon2csv.py --keywords="Python programming" --maxproductnb=2The output has a header row and one row per product, with the columns being the product title, the rating, the number of customer reviews, the product URL, the image URL and the ASIN. The example output in the readme shows two books with their ratings and review counts, which is the sort of data the tool is aimed at: a product list with a score attached. You can also pass a full search URL, which is the way to use filters you built in the browser, and redirect the output to a file:
amazon2csv.py --url="https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=python+scraping" > output.csvThe URL parameter matters more than it looks, because the keyword parameter builds a simple search and the URL parameter lets you carry over the filters and the refinements you set by hand. The readme notes you can then open the file with a spreadsheet editor and play with the filters there, which is the sensible way to consume a small dataset. The full option list is behind the help flag, amazon2csv.py --help.
The library returns Product objects, and the fields are simple
Using the package directly is a search call and a loop over the results:
# -*- coding: utf-8 -*-
import amazonscraper
results = amazonscraper.search("Python programming", max_product_nb=2)
for result in results:
print("{}".format(result.title))
print(" - ASIN : {}".format(result.asin))
print(" - {} out of 5 stars, {} customer reviews".format(result.rating, result.review_nb))
print(" - {}".format(result.url))
print(" - Image : {}".format(result.img))
print()
print("Number of results : %d" % (len(results)))The search function takes the query string and a max_product_nb, and the result objects expose a fixed set of attributes. The title is the product title, the url is the product URL, the img is the image URL, and the asin is the Amazon Standard Identification Number. The rating is a number between zero and five, and the review_nb is the number of customer reviews, and both of those two are False rather than an exception when the data is missing, which is worth knowing because a missing rating will quietly appear as a False in a format string. The rest of the package is the same search with the results already parsed.
Docker, and a wrapper script that removes the command line noise
The tool is also published as a Docker image, thibdct/amazon2csv, and the image can be run directly with the same keyword and maximum product arguments as the command, in an interactive container that is removed on exit.
The image itself is a two stage build. The first stage uses a python alpine base to install the package into a target directory with pip and then strips the bytecode caches out of it, and the second stage is a distroless python image with the installed tree copied in and the entrypoint set to the amazon2csv command. The second stage has no shell and no package manager, which is the reason for the two stage arrangement. On top of that there is a bash wrapper, amazon2csv, which is installed by piping a curl into a file under /usr/local/bin and making it executable. The wrapper exists so you can run the container without typing the docker run line, and it also has an upgrade flag and an uninstall flag. The readme notes the first run downloads the image, so it is not instant.
The two open todo items are the reason to read the source
The end of the readme is a todo list with two unchecked boxes, and they describe the fragility of the whole approach. The first is that if no product was found with the CSS selectors, it may be a new Amazon page style, in which case you change the user agent and get the new page, looping over all the user agents and checking all the CSS selectors again. The second is to find a way to get the products without CSS selectors. Read together, they say that the extraction depends on matching the current layout of the search results page, and that when the layout changes the tool finds nothing rather than reporting an error. That is the honest limitation of this kind of client, and it is the thing to test before you rely on it. The rest of the project is a thin, readable wrapper around three libraries, and the setup script is plain setuptools with a version of 0.1.2 in the file, a console script entry and the requirements parsed out of requirements.txt at install time, so the dependency list has one source rather than two.
Editorial conclusion
amazon-scraper-python suits a quick script that needs a handful of product ratings and review counts for a list of ASINs, and it suits a developer who wants to see the parsing rather than depend on a hosted API. It does not suit a production pipeline, because the selection is done with CSS selectors against a page layout the author expects to change, and the two open todo items are exactly that problem. Before you build on it, run it against a live page and check the results are not empty, since a silent selector failure returns no products rather than an error.
Frequently asked questions
How do I install amazon-scraper-python?
Run pip3 install -U amazonscraper, which installs the amazonscraper package and the amazon2csv.py command. The requirements are Python 3 and pip3, and the package depends on requests, click and beautifulsoup4.
What data does amazonscraper return for each product?
A Product object with the title, the rating as a number between zero and five, the review_nb count of customer reviews, the product URL, the image URL and the ASIN. The rating and the review count come back as False rather than raising an error when the data is missing, so a missing value can appear quietly in formatted output.
How do I get filtered Amazon search results into a spreadsheet?
Use the amazon2csv.py command with the --url option, passing a search URL that carries the filters you set, and redirect the output to a file with a greater than sign. The --keywords option builds a simple search instead, and --maxproductnb limits how many products come back.
What happens when Amazon changes its page layout?
The extraction may find no products, because the selection is done with CSS selectors against the results page. The project's own todo list says that when no product is found it may be a new page style, in which case you change the user agent and check the selectors again, and a second item asks for a way to get the products without CSS selectors at all.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/tducret-amazon-scraper-python)Was this useful?