A JavaScript-based scraper built with Express.js that extracts product details, reviews, and other information from Amazon using product ASINs. This tool is open-source and designed for educational and research purposes.
- Scrape product details such as title, price, ratings, and descriptions.
- Extract customer reviews and ratings.
- Fetch product specifications and additional metadata.
- Support for scraping multiple products simultaneously using their ASINs.
- Save scraped data in structured formats (e.g., JSON).
Before using this scraper, ensure you have the following installed:
- Node.js 14 or higher
- npm (Node package manager)
-
Clone this repository to your local machine:
git clone https://github.com/Yashh56/amazon-scraper.git
-
Navigate to the project directory:
cd amazon-scraper
-
Install the required dependencies:
npm install
-
Setup
Ensure you have the ASIN(s) of the Amazon products you wish to scrape. ASINs are unique identifiers for products on Amazon.
-
Run the scraper
Start the Express.js server:
npm start
-
Send a request
Use a tool like Postman or
curl
to send a POST request to the server with the ASINs you want to scrape. The request body should be in JSON format:{ "asins": ["B0DKXTNZ4G", "B0DGHYDZR9", "B0C1P1YTJ4", "B08DF1Y7T7"] }
Example
curl
command:curl -X POST http://localhost:3000/scrape -H "Content-Type: application/json" -d '{"asins": ["B0DKXTNZ4G", "B0DGHYDZR9"]}'
-
Output
The server will return a JSON response containing the scraped data for the provided ASINs.
{
"products": [
{
"asin": "B0DKXTNZ4G",
"title": "Sample Product",
"price": "$19.99",
"ratings": "4.5",
"reviews": [
{
"author": "John Doe",
"rating": 5,
"review": "Excellent product!"
}
]
}
]
}
- This scraper is for personal and educational use only. Scraping Amazon pages may violate their Terms of Service.
- The scraper may stop working if Amazon updates its page structure.
Contributions are welcome! Feel free to submit issues or pull requests.
-
Fork the repository.
-
Create a new branch for your feature or bug fix:
git checkout -b feature-name
-
Commit your changes:
git commit -m "Add new feature"
-
Push to your branch:
git push origin feature-name
-
Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
This project is intended for educational and research purposes only. Use it responsibly and ensure compliance with applicable laws and regulations.