Playground Sign in Start free

Scraping Amazon Product Data

1

Overview

Amazon product pages contain valuable structured data that can be extracted for price monitoring, competitor analysis, product research, and market intelligence.

What You'll Extract

Product title & description
Current price & pricing
Product images
Star rating & reviews
Availability status
Product features
2

Analyze the HTML Structure

Before creating extract rules, inspect the Amazon product page HTML to identify CSS selectors for each data point:

Data PointCSS SelectorType
Product Title#productTitle, #title spantext
Price.a-price .a-offscreen, #priceblock_ourprice, #priceblock_dealpricetext
Main Image#landingImage, #imgBlkFrontimage
Ratingspan[data-hook="rating-out-of-text"], #acrPopover span.a-icon-alttext
Review Count#acrCustomerReviewText, span[data-hook="total-review-count"]text
Availability#availability span, #outOfStock spantext
Features#feature-bullets ul li span.a-list-itemtext (array)
Brand#bylineInfo, a#bylineInfotext
Pro Tip

Amazon's HTML structure can vary by product category and region. Always test your selectors with multiple product pages.

3

Build Extract Rules

Extract rules define how to extract data from the page using CSS selectors:

JSON - Extract Rules
{
  "title": { "selector": "#productTitle, #title span", "type": "text" },
  "price": { "selector": ".a-price .a-offscreen, #priceblock_ourprice", "type": "text" },
  "original_price": { "selector": ".a-text-price .a-offscreen", "type": "text" },
  "main_image": { "selector": "#landingImage, #imgBlkFront", "type": "image" },
  "all_images": { "selector": "#altImages img", "type": "image", "multiple": true },
  "rating": { "selector": "span[data-hook='rating-out-of-text'], #acrPopover span.a-icon-alt", "type": "text" },
  "review_count": { "selector": "#acrCustomerReviewText", "type": "text" },
  "availability": { "selector": "#availability span", "type": "text" },
  "brand": { "selector": "#bylineInfo", "type": "text" },
  "features": { "selector": "#feature-bullets ul li span.a-list-item", "type": "text", "multiple": true },
  "description": { "selector": "#productDescription p, #productDescription span", "type": "text" }
}

Understanding Extract Rule Types

text
Extracts the text content of an element
image
Extracts the src attribute of img elements
attr
Extracts a specific attribute (requires "attribute" field)
multiple: true
Returns multiple matches as an array
4

Make the API Request

Use the Scrape API with your extract rules. Enable js for JavaScript rendering:

curl -X POST "https://api.ujeebu.com/scrape" \
  -H "ApiKey: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com"
}'
5

Handle the Response

The API returns extracted data in JSON format:

JSON - API Response
{
  "success": true,
  "result": {
    "title": "Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones",
    "price": "$18.88",
    "rating": "4.8 out of 5",
    "review_count": "(146,898)",
    "availability": "In Stock",
    "main_image": "https://m.media-amazon.com/images/I/81kg51XRc1L._SY466_.jpg",
    "brand": "James Clear (Author)",
    "features": [
      "An longest-running bestselling book on the science of habit formation",
      "Practical strategies for forming good habits and breaking bad ones",
      "An easy and proven framework for improving every day"
    ]
  }
}
Success!

The response includes all structured data from your extract rules, ready for processing.

6

Best Practices

01

Use JavaScript Rendering

Amazon heavily uses JavaScript. Always set js=true and use wait_for to ensure content loads.

Essential
02

Implement Rate Limiting

Respect Amazon's servers with 2-3 second delays between requests to avoid being blocked and maintain good scraping etiquette.

Recommended
03

Use Rotating Proxies

Enable proxy rotation for production use to distribute requests across multiple IP addresses and avoid blocks.

Production
04

Handle Variations

Amazon's HTML varies by product category, region, and session state. Always test selectors across different products.

Testing

Ready to Start Scraping?

Try the API in our interactive playground or explore the documentation.