← All posts

How to Scrape Amazon Product Data (API-First and Legal)

Quick answer: If you want to scrape Amazon product data, start with the Amazon Product Advertising API, not an HTML scraper. It returns titles, prices, images, and availability as structured data, and it keeps you inside Amazon's terms. Directly scraping Amazon's pages generally violates those terms and gets blocked fast, so treat it as a last resort for genuinely public data only, and never for bypassing logins or anti-bot systems.

Amazon is the most requested retail scraping target on the planet. People want price, title, rating, review count, and availability so they can track competitors, feed a research model, or build a comparison tool. That demand is real. The way most tutorials tell you to satisfy it is not compliant, so let me lay out the honest version.

Start with the Product Advertising API

Amazon runs an official API for exactly this data: the Product Advertising API (PA-API), tied to the Amazon Associates program. It is the sanctioned path, which makes it both the most stable and the only one that keeps you clearly inside the terms of service.

The high-level shape:

  • Join Amazon Associates and qualify for API access (Amazon requires that you drive some qualifying sales before keys stay active).
  • Get your credentials: an access key, a secret key, and a partner tag.
  • Call operations like GetItems, SearchItems, and GetVariations to pull product attributes.
  • Read structured responses with fields for title, price, images, features, and availability, so you never parse HTML.

The tradeoff is honest: PA-API is built for affiliates, it has usage requirements, and it does not expose every field you might want (full review text, for example, is not a first-class API resource). But for the core product attributes most projects need, it is the right answer.

API vs scraping the HTML

Product Advertising API Scraping HTML
Terms of service Sanctioned path Generally prohibited
Data format Structured JSON Markup to parse
Stability Versioned, documented Breaks on layout changes
Rate limits Documented, tied to sales Undocumented, aggressive blocking
Access requirement Associates account None (until you get blocked)
Legal risk Low, within terms ToS breach, IP and account bans

For most product-data projects there is no real contest. HTML scraping only tempts people because it skips the Associates onboarding, and that shortcut is not worth the fragility or the terms exposure.

What data people actually want, and where it lives

The four fields that drive almost every request:

  • Title and brand: stable, present in the API and in on-page structured data.
  • Price: the hardest to get reliably because it varies by seller, region, and buy-box logic. PA-API returns offer data cleanly.
  • Rating and review count: available as aggregate numbers; full review text is a separate, more restricted matter.
  • Availability: in-stock status and delivery estimates, again cleanest through the API.

If you only need a handful of your own listings (say you are a seller monitoring your own catalog), the Selling Partner API is the appropriate tool and gives you far richer, authorized access to your account's data.

Structured data on public pages

Here is the legitimate middle ground. Amazon product pages, like most modern ecommerce pages, embed machine-readable structured data. Many pages include JSON-LD (schema.org/Product) or Open Graph tags in the HTML head. When you are looking at a public page you are permitted to view, that structured data is a cleaner extraction target than scraping visual DOM elements.

A generic pattern for reading schema.org/Product JSON-LD from any public product page:

import json
from bs4 import BeautifulSoup

def extract_product_jsonld(html: str):
    soup = BeautifulSoup(html, "html.parser")
    for tag in soup.find_all("script", type="application/ld+json"):
        try:
            data = json.loads(tag.string or "")
        except json.JSONDecodeError:
            continue
        items = data if isinstance(data, list) else [data]
        for item in items:
            if item.get("@type") == "Product":
                offers = item.get("offers", {})
                return {
                    "name": item.get("name"),
                    "brand": (item.get("brand") or {}).get("name"),
                    "price": offers.get("price"),
                    "currency": offers.get("priceCurrency"),
                    "availability": offers.get("availability"),
                    "rating": (item.get("aggregateRating") or {}).get("ratingValue"),
                }
    return None

This approach works across most retailers, not just Amazon. For the general technique, see our guide on how to extract structured JSON from any webpage.

A compliant fetch with link.sc

If you need to pull the raw HTML or clean markdown of a public page you are entitled to access (for example, to read the JSON-LD above, or to fetch your own product listing), link.sc handles rendering and parsing and returns clean content in one call:

curl https://link.sc/v1/fetch \
  -H "Authorization: Bearer lsc_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.example-store.com/products/widget",
    "format": "markdown"
  }'

link.sc gives you clean markdown or JSON so you can parse the structured fields without wrestling with heavy markup. What it will not do, and what you should not ask any tool to do, is defeat authentication or anti-bot defenses on a site whose terms forbid automated access. Use it for the legitimate slice: official API responses, your own public pages, and public data you are allowed to read.

The legal and ethics note

Read this part carefully. Amazon's Conditions of Use explicitly prohibit scraping, data mining, and automated access to their site outside their APIs. Ignoring that is a terms-of-service breach, and depending on how you do it, it can raise exposure under laws like the US Computer Fraud and Abuse Act (CFAA), especially if you circumvent technical access controls. If you collect any personal data (reviewer names, for example), privacy regimes like the GDPR come into play too.

None of this is legal advice, and the case law keeps shifting. The practical guardrails that keep you safe:

  • Prefer the official API (PA-API for products, Selling Partner API for your own catalog).
  • Only touch genuinely public data you are permitted to view, and respect robots.txt and rate limits.
  • Never bypass logins, CAPTCHAs, or anti-bot systems. If a site is trying to keep automated traffic out, that is your answer.
  • Do not republish copyrighted content or personal data without a lawful basis.

For a fuller treatment, read is web scraping legal and our ethical web scraping and compliance best practices.

The bottom line

For Amazon product data, the compliant hierarchy is simple: Product Advertising API first, Selling Partner API for your own listings, structured data on public pages you are allowed to view second, and raw HTML scraping essentially never. Build on the sanctioned path and your pipeline stays stable, legal, and unblocked. Chase the shortcut and you inherit a fragile scraper and a terms-of-service problem.


Need clean, structured content from public pages and official API responses? link.sc fetches any URL to clean markdown or JSON in one call. Try it free.