Amazon scraper API: get Amazon product data as JSON, with a Python example
Scrape Amazon product data without maintaining a scraper: search and product pages as JSON with price, rating, ASIN and seller, plus a tested Python script.
An Amazon scraper is any program that reads Amazon's public pages and turns them into data: the title, price, rating, review count, ASIN and seller of each product. You can write one yourself with an HTTP client and an HTML parser, or you can call an Amazon scraper API that returns the same fields as JSON and keeps up with page changes for you.
This guide covers the second route. It shows what an Amazon search and an Amazon product page return as data, using two real requests made on 30 October 2026 against amazon.com, then gives a tested Python script of about 80 lines that searches Amazon, reads each product page and saves the results to a CSV file. It ends with the things to check in Amazon data before you rely on it, and a checklist for choosing an Amazon scraper API.
What does "Amazon scraper API" mean?
The phrase covers three things that are often mixed up:
| Route | What you build | What you maintain |
|---|---|---|
| Your own scraper | An HTTP client, an HTML parser and selectors for each field | Selectors, request handling, retries and every layout change on Amazon |
| An Amazon scraper API | Calls to one endpoint that take a keyword or a product URL | Only your own code; the provider keeps the extraction working |
| An agent tool (MCP) | Nothing; your AI agent calls the tool when you ask in plain language | Nothing; you check the answers the agent gives |
A homemade scraper is a good exercise and fine for a one-off. It gets expensive when you need it every day: Amazon serves different layouts by country, by category and by product type, moves fields between versions of the page, mixes sponsored listings into search results and puts variant prices behind selections. Each of those breaks a selector somewhere.
An Amazon scraper API takes that work away. You send a keyword or a product page, and you get back named fields. The rest of this guide uses datawebot, which answers through a REST API and through an MCP server for AI agents, with the same data in both.
What can you get from an Amazon search?
A search takes a keyword, the Amazon site and the country, and returns the organic results with their price, rating and link. Sponsored results come back in a separate list, marked as sponsored, so they never mix into the organic ranking.
This is a real search for "Ninja AF101 air fryer" on amazon.com, country US, made on 30 October 2026 at 11:40 UTC. It cost 5 credits and took about 10 seconds.
| # | Title (shortened) | ASIN | Price | Rating (reviews) |
|---|---|---|---|---|
| 1 | Ninja AF101 Air Fryer, 4 Qt Capacity, 4-in-1 | B07FDJMC9Q | $119.99 | 4.7 (59,500) |
| 2 | Ninja Air Fryer Pro, 5 Qt, 4-in-1, Grey, AF141 | B0CSZ7WBYW | $79.99 | 4.7 (8,000) |
| 3 | Ninja Air Fryer XL with MaxCrisp, 6.5 Qt, AF181 | B0CS3V8M9H | $99.99 | 4.7 (3,100) |
| 4 | Chefman Air Fryer, 4 QT Compact | B0CNY1F31S | $57.91 | 4.6 (4,000) |
| 5 | Ninja Air Fryer Pro, 5 Qt, 5-in-1, Grey, AF142 | B0DW4KG8VM | $139.99 | 4.7 (3,100) |
Five sponsored results came back in their own list: two accessories made for the AF101 (a rack pair at $16.99 and a replacement tray at $11.59), parchment liners at $12.98, and two other air fryers (NutriChef at $79.99 and BLACK+DECKER at $64.99). If those had been mixed into the organic list, a price comparison would have treated an $11.59 tray as the cheapest air fryer.
Each organic result is one JSON object:
{
"product_id": "p_aHR0cHM6Ly93d3cuYW1hem9uLmNvbS9kcC9CMDdGREpNQzlR",
"title": "Ninja AF101 Air Fryer, 4 Qt Capacity, 4-in-1 Crisp, Roast, Reheat, Dehydrate, ...",
"url": "https://www.amazon.com/dp/B07FDJMC9Q",
"shop": "amazon.com",
"price": { "amount": 119.99, "currency": "USD", "text": "$119.99" },
"original_price": null,
"rating": 4.7,
"review_count": 59500,
"image_url": "https://m.media-amazon.com/images/I/719b2ik3wOL.jpg",
"sponsored": false
}
The product_id is what you pass to the next call to read the full product page.
What can you get from an Amazon product page?
A product read takes a product page URL, such as https://www.amazon.com/dp/B07FDJMC9Q, or a product_id from a search, and returns the whole listing. This is the first result above, read on 30 October 2026 at 11:40 UTC. It cost 1 credit and took about 10 seconds.
| Field | What came back |
|---|---|
title |
Ninja AF101 Air Fryer, 4 Qt Capacity, 4-in-1 Crisp, Roast, Reheat, Dehydrate, ... |
price |
$119.99 (USD) |
availability |
in_stock |
rating, review_count |
4.7 from 59,529 reviews |
details.seller |
Amazon.com |
details.identifiers |
ASIN B07FDJMC9Q, MPN AF101, GTIN 622356554572 |
details.category_path |
Home & Kitchen › Kitchen & Dining › Small Appliances › Fryers › Air Fryers |
details.specs_raw |
33 rows from the product table: brand name, wattage, capacity, dimensions, weight, UPC, best sellers rank and more |
details.feature_bullets |
The 8 feature bullets from the listing |
details.description |
The product description text |
details.images |
7 product images |
details.variants |
3 size variants: 4QT, 5.5 QT XL and 5.5 QT MAX |
The answer also carries meta.as_of, the time the page was read, and meta.credits_used. Fields the page does not show come back empty rather than guessed.
How do you scrape Amazon product data with Python?
The script below does the full job in one run: it searches Amazon for a keyword, reads each organic result's product page and writes one CSV row per product. It uses the standard library only and needs Python 3.9 or later.
Get access
Every account starts with 200 free credits, and sign-in is by email. The quickest way is to give your coding agent (Claude Code, Cursor or similar) this line:
set up https://mcp.datawebot.com/setup.md
The agent asks for your email and you approve the sign-in from the email datawebot sends. The key is saved to ~/.datawebot/credentials, readable only by you, and the script reads it from there. On a server or in CI, put the key in an environment variable named DATAWEBOT_API_KEY from your secret store instead, and never commit it.
The script
"""Search Amazon for a keyword, read each organic result's product page and
save the fields to a CSV file. Standard library only."""
import csv, json, os, sys, time, urllib.request
API = "https://api.datawebot.com/v1/requests"
def api_key():
key = os.environ.get("DATAWEBOT_API_KEY")
if key:
return key
# Written by the agent setup (https://mcp.datawebot.com/setup.md).
with open(os.path.expanduser("~/.datawebot/credentials")) as f:
return json.load(f)["profiles"]["https://mcp.datawebot.com"]["api_key"]
def call(method, url, body=None):
req = urllib.request.Request(url, method=method,
data=json.dumps(body).encode() if body else None,
headers={"Authorization": "Bearer " + api_key(),
"Content-Type": "application/json",
"User-Agent": "amazon-products-example/1.0"})
with urllib.request.urlopen(req, timeout=120) as r:
return json.loads(r.read())
def ask(body):
"""Send a request; when the answer is "working", poll until it is done."""
res = call("POST", API, body)
for _ in range(20):
if res.get("status") != "working":
return res
time.sleep(res.get("check_after_seconds") or 4)
res = call("GET", f"{API}/{res['request_id']}")
raise RuntimeError("still working after a minute and a half; try again later")
def identifier(details, kind):
return next((i["value"] for i in details.get("identifiers") or [] if i["type"] == kind), "")
def main(query, site="amazon.com", country="US", limit=5):
found = ask({"capability": "search", "query": query,
"site": site, "country": country, "limit": limit})
rows = []
for hit in found["products"]: # organic results; ads are in found["sponsored"]
p = ask({"capability": "product", "product_id": hit["product_id"]})["product"]
d = p.get("details") or {}
rows.append({
"asin": identifier(d, "asin"),
"title": p["title"],
"price": (p.get("price") or {}).get("amount"),
"currency": (p.get("price") or {}).get("currency"),
"rating": p.get("rating"),
"review_count": p.get("review_count"),
"availability": p.get("availability"),
"seller": (d.get("seller") or {}).get("name"),
"gtin": identifier(d, "gtin"),
"category": " > ".join(d.get("category_path") or []),
"images": len(d.get("images") or []),
"url": p["url"],
"as_of": found["meta"]["as_of"],
})
with open("amazon_products.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=list(rows[0]))
w.writeheader()
w.writerows(rows)
print(f"{len(rows)} products saved to amazon_products.csv")
for r in rows:
print(f"{r['asin']} {r['currency']} {r['price']} {r['rating']} ({r['review_count']}) {r['title'][:50]}")
if __name__ == "__main__":
main(" ".join(sys.argv[1:]) or "Ninja AF101 air fryer")
Run it with a keyword:
python3 amazon_products.py Ninja AF101 air fryer
What it printed
This is the real output of the run on 30 October 2026 at 11:41 UTC. One search and five product reads cost 10 credits and took 53 seconds in all.
5 products saved to amazon_products.csv
B07FDJMC9Q USD 119.99 4.7 (59529) Ninja AF101 Air Fryer, 4 Qt Capacity, 4-in-1 Crisp
B0CSZ7WBYW USD 79.99 4.7 (8038) Ninja Air Fryer Pro, 5 Qt, 4-in-1, Grey, AF141
B0CS3V8M9H USD 99.99 4.7 (3154) Ninja Air Fryer XL with MaxCrisp, 6.5 Qt, 6-in-1,
B0CNY1F31S USD 57.91 4.6 (4076) Chefman Air Fryer – 4 QT Compact Airfryer for Quic
B0DW4KG8VM USD 139.99 4.7 (3154) Ninja Air Fryer Pro, 5 Qt, 5-in-1, Grey, AF142
The CSV has the ASIN, title, price, currency, rating, review count, availability, seller, GTIN, category path, image count, product URL and the time of the search for every row. Four of the five products had a GTIN on the page; the AF181 did not, so that cell is empty.
Other Amazon countries
Change site and country to read another Amazon store, for example site="amazon.co.uk", country="GB" or site="amazon.de", country="DE". Prices come back in that store's currency and titles in its language. The full list of Amazon countries is on the Amazon product data API page.
How do you get Amazon data from an AI agent?
If you work in Claude, ChatGPT, Cursor or another agent that supports MCP, you do not need the script. After the setup line above, ask in plain language:
Use datawebot to search amazon.com for the Ninja AF101 air fryer and list the
organic results with ASIN, price, rating and link.
The agent calls search_products with site set to amazon.com, then get_product for any listing you want in full. The answers are the same JSON as the REST API, so you can move from trying things in an agent to a scheduled script without changing what you get. The MCP server page lists every tool.
What should you check in Amazon data?
The runs above show five things to watch for, whichever Amazon scraper you use:
- Search review counts are rounded. The search showed 59,500 reviews for the AF101 because the search page shows "59.5K"; the product page gave the exact 59,529. Use the product read when the exact number matters.
- Related listings can share one review count. The AF181 and the AF142 are different models with different ASINs, yet both product reads returned 3,154 reviews. Amazon can show one pool of reviews across related listings, so do not treat review counts as per-model sales signals without checking.
- Brand can be empty while the product table has it. The AF101 read returned
brandas null, whilespecs_rawhad "Brand Name: Ninja" and "Model Number: AF101". Read both before deciding a field is missing. - Variant prices are not all on one page. The read listed three size variants but only the selected one (4QT, $119.99) had a price, and the answer carried the warning
variant_prices_missing. Read each variant's own page when you need its price. - Every price is a snapshot. Amazon prices change during the day, and each answer is what the page showed at
meta.as_of. If you track prices, store that time with every row and read again on a schedule.
How do you choose an Amazon scraper API?
Use this checklist when you compare providers:
| Question | Why it matters |
|---|---|
| Are sponsored results separated from organic ones? | Mixed lists put accessories and ads at the top of a price comparison |
| Does a product read return identifiers (ASIN, GTIN, MPN)? | You need them to match the same product across Amazon countries and other shops |
| Which Amazon countries does it cover, with local currency? | Prices and titles differ by store |
| Is every answer labelled with the time it was read? | Without it you cannot tell a stale price from a current one |
| Are failed requests free? | Amazon pages fail now and then; you should not pay for nothing |
| Can an AI agent call it, not only your code? | MCP support lets you test questions in an agent before writing code |
| Does it say what it does not return? | Private seller data, order counts and stored price history are often implied but not provided |
On the last point: datawebot reads what a public Amazon page shows. It does not return a seller's private sales or inventory, and it does not keep price history for you. Your script and its CSV or database are the history.
What does it cost?
A search costs 5 credits and a product read 1 credit. Failed requests are free. Every account starts with 200 free credits, enough for the script above about 20 times with five products each. Current prices for more credits are on the pricing page.
Frequently asked questions
What is an Amazon scraper API?
An Amazon scraper API is a service you call with a keyword or an Amazon product URL that returns the page's data as JSON: title, price, rating, review count, ASIN, seller, images and more. It replaces writing and maintaining your own scraper for Amazon's pages.
How do I scrape Amazon product data with Python?
Call a search with your keyword, take the product_id of each organic result, call a product read for each one and write the fields you need to a CSV file or a database. The script in this guide does exactly that in about 80 lines of standard-library Python.
Can I get Amazon data by ASIN?
Yes. Pass the product page URL that contains the ASIN, such as https://www.amazon.com/dp/B07FDJMC9Q, as the url of a product read. The answer includes the ASIN again under details.identifiers, along with the GTIN and MPN when the page shows them.
Does the API return sponsored products?
Yes, in a separate sponsored list, each marked sponsored: true. The products list holds only the organic results, so ads never change the ranking you see.
Which Amazon countries are supported?
The US store and Amazon's other country stores, such as the UK, Germany, France, Italy, Spain, Canada, Japan and Australia. Pass the domain as site and the country code as country. The current full list is on the Amazon product data API page.
Is there a free Amazon scraper API?
datawebot gives every account 200 free credits on email sign-in. That covers 40 searches or 200 product reads, or a mix of both.
Sources
- https://www.datawebot.com/llms.txt
- https://mcp.datawebot.com/setup.md
- https://www.datawebot.com/solutions/amazon-product-data-api
- https://www.datawebot.com/scraper/amazon
- https://docs.python.org/3/library/csv.html
- https://docs.python.org/3/library/urllib.request.html
- https://modelcontextprotocol.io/specification/2025-06-18/server/tools
Put product data in your agent's hands.
Connect a coding agent, or check how page-based credits work before you run anything.