Amazon product details by ASIN in 20 marketplaces: buybox price, stock, gallery, details table (Python)

python dev.to

Turning an ASIN into amazon product data — price, stock, gallery, bullets, details — means reading the product page, since the Product Advertising API needs an approved associate account. This is an amazon asin lookup as one row per product in 20 marketplaces, the buybox rule, and why the currency depends on where the request leaves from.

1. One request, one row per ASIN

The Amazon Product Scraper on Apify is an amazon product scraper that takes ASINs or product URLs and returns one product row each.

curl -X POST "https://api.apify.com/v2/acts/kestrel~amazon-product-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"asins": ["B0CHWRXH8B", "B09B8V1LZ3", "B0BSHF7WHW"], "domain": "com"}'
Enter fullscreen mode Exit fullscreen mode

A product row (gallery shortened):

{"type":"product","asin":"B09B8V1LZ3","domain":"com","marketplace":"US","url":"https://www.amazon.com/dp/B09B8V1LZ3?th=1&psc=1","title":"Amazon Echo Dot (newest model), Vibrant sounding Alexa speaker, Great for bedrooms, dining rooms and offices, Charcoal","brand":"Amazon","price":54.99,"price_display":"$54.99","currency":"USD","list_price":79.99,"list_price_display":"$79.99","availability":"In Stock","in_stock":true,"prime":false,"rating":4.7,"ratings_count":198808,"image":"https://m.media-amazon.com/images/I/61J2sQtBYDL._AC_SL1000_.jpg","images":["https://m.media-amazon.com/images/I/61J2sQtBYDL._AC_SL1000_.jpg","https://m.media-amazon.com/images/I/71xoR4A6q-L._AC_SL1500_.jpg"],"features":["Our most popular smart speaker with a fabric design. It is our most compact smart speaker that fits perfectly into small spaces."],"description":null,"breadcrumbs":null,"category":null,"details":null,"bsr":null,"bsr_top":null,"date_first_available":null,"sold_by":null,"variations_count":3,"5_star_pct":82,"4_star_pct":11,"3_star_pct":4,"2_star_pct":1,"1_star_pct":2,"fetched_at":"2026-08-29T10:31:04+00:00"}
Enter fullscreen mode Exit fullscreen mode

images is the gallery, highest resolution first; details the Product information, Technical details and Product overview tables merged into one object; breadcrumbs null on most amazon.com pages. bsr is best-effort: Amazon renders Best Sellers Rank for some sessions only, never invented.

2. The buybox price, and only the buybox price

A product page prints many prices: other sellers, bundles, carousels. Take the first one and you are wrong on the pages that matter: an earlier page-wide approach labelled a discontinued iPad at 149 GBP, a carousel neighbour's price on a page with no buying option. This actor reads the buybox block only: price is what Buy now would charge, list_price the struck-through figure when shown, and an unavailable product has a null price with the rest filled in. in_stock comes from the availability wording, then from whether a buybox price exists; otherwise null, and null is not "in stock".

3. Twenty marketplaces, and where the currency comes from

domain sets the marketplace for bare ASINs (com, co.uk, de, co.jp and sixteen more); a URL's marketplace wins. The same ASIN on two marketplaces is two products.

{"asins":["B09B8V1LZ3","https://www.amazon.co.uk/dp/B09B8V1LZ3"],"proxyConfiguration":{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"]}}
Enter fullscreen mode Exit fullscreen mode

Amazon localises the buybox to the caller's location, not the marketplace: a co.uk page fetched through a US egress is priced in USD, or shows no offer, so currency is read from the printed price. Datacenter proxies do for amazon.com; with RESIDENTIAL the run routes through the marketplace's own country unless you set one, and the co.uk buybox appears in GBP.

4. Filters before billing, unknown ASINs free

inStockOnly keeps products whose availability line says in stock; maxPrice keeps products at or under a figure in the marketplace's currency. Both run before billing: a verified run over the three ASINs above with inStockOnly: true and maxPrice: 100 delivered one row, the $54.99 speaker, and dropped the $263.86 earbuds and the discontinued laptop with free status rows saying filtered. An unknown ASIN is not_found after one attempt, free; a captcha that survives five IP rotations is blocked, free.

5. Python: from a chart to product rows to reviews

import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
def rows(actor, inp, kind="product"): return [r for r in client.dataset(client.actor(actor).call(run_input=inp)["defaultDatasetId"]).iterate_items() if r["type"] == kind]

chart = rows("kestrel/amazon-best-sellers-scraper", {"categories": ["electronics/headphones"], "chart": "bestsellers", "domain": "com"})
products = rows("kestrel/amazon-product-scraper", {"asins": [r["asin"] for r in chart if r["rank"] <= 20], "domain": "com"})
for r in products:
    cut = round(100 * (1 - r["price"] / r["list_price"])) if r["price"] and r["list_price"] else 0
    print(r["asin"], r["price_display"], f"-{cut}%", r["in_stock"], r["sold_by"], len(r["images"] or []), len(r["features"] or []))
reviews = rows("kestrel/amazon-reviews-scraper", {"asins": [r["asin"] for r in products if len(r["images"] or []) < 5], "domain": "com", "requireText": True}, kind="review")
Enter fullscreen mode Exit fullscreen mode

The ASINs come from the Best Sellers chart; the Amazon Search Scraper's asin column feeds the same input from a keyword. The loop is the amazon price scraper question — which top-20 discounts are cuts against a list price nobody paid — and a content audit; thin listings go to the Amazon Reviews Scraper for the text behind rating, 8–13 public reviews per product.

6. A daily price and stock check (n8n)

Every row is stamped fetched_at, so a scheduled run over a fixed list is a price history by asin, with a changed sold_by showing a lost buybox. In n8n: a Schedule trigger, an HTTP Request to the run-sync endpoint with the section 1 body, a Filter on type = product, a Code node comparing price with yesterday's in static data, an IF, Slack. The Amazon Best Sellers rank tracker in the n8n/ folder of kestrel-actors-examples has that comparison written.

7. Cost and limits

  • $0.004 per product row: 500 ASINs daily is $2 a day, $1 with inStockOnly on a catalogue where half the listings are dead. status rows, filtered products, duplicates, not_found and blocked are free.
  • availability and details labels arrive in the marketplace's language.
  • The actor reads publicly available product pages — the same data a shopper sees without logging in — and stores nothing personal. Price, availability, rating and product descriptions are facts about products, not people. Scraping public data is legal in most jurisdictions for legitimate purposes such as price comparison, market research and catalogue management, but you are responsible for how you use it: respect the site's terms, keep request rates modest (the defaults are), and do not republish copyrighted images or descriptions as your own.

That is the amazon product api most people want: one row per ASIN, the buybox price or null, filters before billing. Full reference on the actor page: apify.com/kestrel/amazon-product-scraper.

Every actor's inputs, output fields, a sample row and its honest limits are documented at mtedj.github.io/kestrel-actors-examples, including a side-by-side comparison of every review scraper — what each source really carries and where its ceiling is.

Source: dev.to

arrow_back Back to Tutorials