Irmu
Guides11 minIrmu Engineering

Scrape Amazon Product Data with Python

A practical walkthrough for pulling prices, buy box, stock and reviews from Amazon at scale.

What makes Amazon different

Amazon serves different markup to different visitors. Price, buy box winner and availability vary by delivery location, session history and device, so a request from a datacenter IP in the wrong country can return a price no customer would ever see.

It also mixes server-rendered and client-rendered sections, and rotates layout variants for A/B tests. Selector-based parsers break constantly for this reason alone.

Fetching the page correctly

Use a residential IP in the target marketplace's country, render the page, and let the request retry on soft blocks. In Python that is a single call.

python
import requests

API = "https://app.irmu.com/api"
HEADERS = {"Authorization": "Bearer irmu_sk_live_..."}

def product(asin: str, country: str = "us"):
    res = requests.post(
        f"{API}/extract",
        headers=HEADERS,
        json={
            "url": f"https://www.amazon.com/dp/{asin}",
            "country": country,
            "render": True,
            "schema": {
                "title": "string",
                "price": "number",
                "currency": "string",
                "rating": "number",
                "review_count": "number",
                "buybox_seller": "string",
                "in_stock": "boolean",
            },
        },
        timeout=90,
    )
    res.raise_for_status()
    return res.json()["data"]

print(product("B0CHX1W1XY"))

Scaling to a catalog

Once one ASIN works, submit the rest in batch. Batch extraction accepts thousands of URLs and posts results to your webhook as they complete, which avoids holding open connections and lets you process results as a stream.

Track credits per successful record rather than per request — failed fetches are retried and never billed, so your unit economics stay stable even on bad days.

python
res = requests.post(
    f"{API}/extract/batch",
    headers=HEADERS,
    json={
        "urls": [f"https://www.amazon.com/dp/{a}" for a in asins],
        "schema": {"title": "string", "price": "number", "in_stock": "boolean"},
        "webhook": "https://hooks.acme.com/irmu",
    },
)
print(res.json()["batch_id"])

Reviews and content audits

Ask for a reviews array with text, rating, date and verified flag, then run your own clustering to surface defect themes. For content audits, extract bullets and image URLs and diff them against your PIM export on a schedule.

Start building with Irmu today

1,000 free credits every month, no card required. Every API, every integration, one key.