scrape-amazon-reviews
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://metaphysics0--3927354a3bed11f0af219e149126039e.web.val.run
A simple API that scrapes Amazon product reviews and returns them in CSV format.
- Extract reviews from Amazon product pages
- Return data in CSV format for easy analysis
- Support for pagination (multiple pages of reviews)
- Includes review title, rating, author, date, content, and verification status
- Respectful scraping with delays between requests
GET /?url=<amazon-product-url>&pages=<max-pages>
Parameters:
url(required): Amazon product URLpages(optional): Maximum number of pages to scrape (default: 5, max: 10)
Example:
/?url=https://www.amazon.com/dp/B08N5WRWNW&pages=3
GET /health- Health checkGET /usage- API usage information
The API supports various Amazon URL formats:
https://www.amazon.com/dp/PRODUCT_IDhttps://www.amazon.com/product/PRODUCT_IDhttps://www.amazon.com/gp/product/PRODUCT_ID
The CSV includes the following columns:
- Title: Review title
- Rating: Star rating (1-5)
- Author: Reviewer name
- Date: Review date
- Content: Full review text
- Verified Purchase: Yes/No
The API includes a 1-second delay between page requests to be respectful to Amazon's servers.
The API returns appropriate HTTP status codes:
400: Invalid or missing URL parameter404: No reviews found for the product500: Server error during scraping
- This tool is for educational and research purposes
- Be respectful of Amazon's terms of service
- Large products with many reviews may take time to process
- Amazon may block requests if too many are made too quickly
When successful, the API returns a CSV file with headers:
Title,Rating,Author,Date,Content,Verified Purchase "Great product!",5,"John Doe","January 15, 2024","This product exceeded my expectations...",Yes "Good value",4,"Jane Smith","January 10, 2024","Works as described, good quality.",Yes