How to scrape Amazon
Extract Amazon product titles, prices, ratings and reviews as clean JSON with a schema instead of selectors. Handles dynamic pricing and layout changes.
- Site:
- amazon.com
- Difficulty:
- Hard
- Rendering:
- JavaScript-rendered
- Anti-bot:
- Rate limiting, CAPTCHA, Bot detection
What you can extract from Amazon
These are the fields teams most often pull from amazon.com, and why a hand-written selector for each one tends to break over time.
| Field | Type | Why selectors break |
|---|---|---|
| title | string | The product title element ID changes between the standard, mobile and A/B-test layouts, so a single CSS selector silently returns null on a meaningful share of pages. |
| price | string | Price is split across several spans (whole, fraction, symbol) and is often injected by JavaScript after load, so naive selectors grab an empty node or the wrong currency. |
| rating | number | The star rating lives in an aria-label string like "4.3 out of 5 stars", forcing brittle regex parsing that breaks the moment Amazon localizes the copy. |
| review_count | number | Review counts are formatted with locale-specific thousands separators and sometimes abbreviated, so the same selector returns "1,234", "1.234" or "1.2K" depending on the visitor. |
| availability | string | Availability text moves between several containers depending on whether the item ships from Amazon, a third party, or is out of stock, defeating a fixed selector. |
The schema-first approach
Instead of maintaining selectors, you hand Extracto a JSON schema describing the shape you want. Here is a schema that works for Amazon:
{
"title": "string",
"price": "string",
"currency": "string",
"rating": "number",
"review_count": "number",
"availability": "string"
} - 1
Describe the Amazon fields you want
Write a small JSON schema listing the fields to pull from amazon.com (for example title, price, rating). No CSS selectors or XPath needed.
- 2
Send the URL and schema to Extracto
POST the Amazon page URL and your schema to the Extracto API. Extracto renders the page in a real browser, handling JavaScript and dynamic content automatically.
- 3
Get schema-validated JSON back
Extracto returns JSON that matches your schema exactly, validated before it leaves the API, so your pipeline never receives broken or partial data.
Common pitfalls when scraping Amazon
- Amazon serves different HTML to different visitors based on region, cookies and ongoing layout experiments, so a scraper that works in one session can return nulls in the next without any code change.
- Prices are frequently rendered client-side, so fetching raw HTML without a real browser often yields a page with no visible price at all.
- Aggressive scraping triggers CAPTCHAs and temporary IP blocks quickly; you need polite rate limiting and rotating egress, not a tight loop hammering the same product.
- The same product can appear under multiple ASINs and variation parents, so a naive scraper double-counts or mismatches price and review data unless it keys on the canonical ASIN shown on the page.
Is it legal to scrape Amazon?
Amazon's Conditions of Use restrict automated access, and product pages are served differently by region, account state and A/B test bucket. Scraping publicly visible product data (price, title, rating) is generally lower risk than collecting personal data from reviews, but Amazon actively rate-limits and challenges automated traffic. Stay on public, non-authenticated pages, respect robots.txt, keep request volume modest, and never resell raw review text that contains personal information. When in doubt, the official Amazon Product Advertising API is the sanctioned path for catalog data.
Extracto follows robots.txt by default and rate-limits politely. You are responsible for compliance with Amazon's terms and applicable law (GDPR, CCPA) in your use case.