Tutorial
10 min read
How to Get Real-Time Amazon Product Data with Python
Fetch product details, reviews, search results, pricing, and best sellers from any Amazon marketplace in seconds - no scraper maintenance required.
Python · Amazon · Web Scraping
Why not just scrape Amazon directly?
Amazon is one of the hardest sites to scrape reliably. It uses heavy JavaScript rendering, aggressive bot detection (CAPTCHA, fingerprinting, browser challenges), frequent HTML structure changes, and geo-based IP blocking. A scraper that works today can break without warning.
Building and maintaining your own Amazon scraper takes weeks of engineering time - and requires ongoing maintenance every time Amazon updates its layout or detection logic. Most teams give up and look for an API.
The Real-Time Amazon Data API handles all of this for you: bot bypass, HTML parsing, geo-routing, and structured JSON output - consistently, across 16 Amazon marketplaces. You make a single HTTP request and get back clean data in under two seconds.
Prerequisites
Python 3.7+ and the requests library (pip install requests)
A free OpenWeb Ninja account - sign up at app.openwebninja.com (no credit card required)
Subscribe to the Real-Time Amazon Data API on OpenWeb Ninja (free plan: 100 req/month)
# Install the requests library if needed
pip install requests
1. Get product details by ASIN
An ASIN is Amazon's unique product identifier - the 10-character code in any product URL (e.g. B09G9FPHY6). This endpoint returns the full product record: title, price, rating, review count, main image, all variant images, dimensions, weight, availability, and more.
# get_product.py
import requests
url = "https://api.openwebninja.com/realtime-amazon-data/product-details"
querystring = {"asin": "B09G9FPHY6", "country": "US"}
headers = {
"x-api-key": "YOUR_API_KEY",
}
response = requests.get(url, headers=headers, params=querystring)
product = response.json()["data"]
print(product["product_title"])
print(product["product_price"])
print(product["product_star_rating"], "stars -", product["product_num_ratings"], "reviews")
Response (truncated)
{
"asin": "B09G9FPHY6",
"product_title": "Apple AirPods Pro (2nd Generation)",
"product_price": "$189.00",
"product_original_price": "$249.00",
"currency": "USD",
"product_star_rating": "4.7",
"product_num_ratings": 87432,
"product_availability": "In Stock",
"product_photo": "https://m.media-amazon.com/images/I/...",
"product_url": "https://www.amazon.com/dp/B09G9FPHY6",
"is_best_seller": true,
"is_amazon_choice": false,
"climate_pledge_friendly": true
}
2. Search Amazon products by keyword
Run a keyword search and get back a paginated list of products: title, ASIN, price, rating, thumbnail, and sponsored flag. Supports sort_by options including RELEVANCE, LOWEST_PRICE, HIGHEST_RATING, and MORE_BUYING_CHOICES.
# search_products.py
import requests
url = "https://api.openwebninja.com/realtime-amazon-data/search"
querystring = {
"query": "standing desk",
"page": "1",
"country": "US",
"sort_by": "RELEVANCE",
"product_condition": "ALL",
}
headers = {
"x-api-key": "YOUR_API_KEY",
}
response = requests.get(url, headers=headers, params=querystring)
data = response.json()["data"]
print(f"Total results: {data['total_products']}")
for p in data["products"][:3]:
print(p["product_title"][:60], "-", p["product_price"])
Response (truncated)
{
"total_products": 10000,
"country": "US",
"products": [{
"asin": "B08CXSGQZB",
"product_title": "FLEXISPOT Electric Standing Desk 48x30 Inches",
"product_price": "$299.99",
"product_star_rating": "4.6",
"product_num_ratings": 14823,
"is_best_seller": false,
"is_prime": true
}, ...]
}
3. Fetch product reviews
Pull customer reviews for any ASIN - rating, title, body text, verified purchase status, helpful votes, review date, and reviewer profile. Filter by star rating or sort by recency vs. helpfulness. Paginate to collect hundreds of reviews for NLP or sentiment analysis.
# get_reviews.py
import requests
url = "https://api.openwebninja.com/realtime-amazon-data/product-reviews"
querystring = {
"asin": "B09G9FPHY6",
"country": "US",
"sort_by": "TOP_REVIEWS",
"star_rating": "ALL",
"verified_purchases_only": "false",
"page": "1",
}
headers = {
"x-api-key": "YOUR_API_KEY",
}
response = requests.get(url, headers=headers, params=querystring)
reviews = response.json()["data"]["reviews"]
for r in reviews[:3]:
print(r["review_star_rating"], "★ -", r["review_title"])
print(r["review_comment"][:140])
print("Verified:", r["is_verified_purchase"], "| Helpful:", r["helpful_vote_statement"])
print()
Response (one review)
{
"review_id": "R2X9PLMQT7",
"review_title": "Best earbuds I've ever owned",
"review_comment": "The noise cancellation is phenomenal. I use these daily on my commute and...",
"review_star_rating": "5",
"review_date": "Reviewed in the United States on March 12, 2026",
"is_verified_purchase": true,
"helpful_vote_statement": "247 people found this helpful",
"review_author": "AudioEnthusiast99"
}
4. Get best sellers by category
Retrieve Amazon's live best seller rankings for any category. Returns rank, ASIN, title, price, rating, and ranking change direction. Supports any Amazon category string (e.g. electronics, books, kitchen).
# best_sellers.py
import requests
url = "https://api.openwebninja.com/realtime-amazon-data/best-sellers"
querystring = {
"category": "electronics",
"country": "US",
"page": "1",
}
headers = {
"x-api-key": "YOUR_API_KEY",
}
response = requests.get(url, headers=headers, params=querystring)
best_sellers = response.json()["data"]["best_sellers"]
for item in best_sellers[:5]:
rank = item['rank']
title = item['product_title'][:50]
price = item['product_price']
print(f"#{rank} {title} - {price}")
Sample output
#1 Apple AirPods Pro (2nd Generation) - $189.00
#2 Anker 65W 4-Port Charging Station - $29.99
#3 Fire TV Stick 4K Max - $39.99
#4 Echo Dot (5th Gen, 2022 release) - $49.99
#5 Apple Watch Series 9 [GPS 41mm] - $299.00
Putting it together: a simple price monitor
A common real-world use case is tracking price changes on a list of ASINs and alerting when prices drop. Here's a minimal working example that checks a watchlist and prints any price changes.
# price_monitor.py
import requests, json, os
API_KEY = os.environ["API_KEY"]
WATCHLIST = ["B09G9FPHY6", "B08N5WRWNW", "B0BDHX8Z63"]
PRICE_FILE = "last_prices.json"
def get_price(asin):
r = requests.get(
"https://api.openwebninja.com/realtime-amazon-data/product-details",
headers={"x-api-key": API_KEY},
params={"asin": asin, "country": "US"},
)
return r.json()["data"]["product_price"]
last = json.load(open(PRICE_FILE)) if os.path.exists(PRICE_FILE) else {}
current = {}
for asin in WATCHLIST:
price = get_price(asin)
current[asin] = price
if asin in last and last[asin] != price:
print(f"Price change: {asin} {last[asin]} → {price}")
json.dump(current, open(PRICE_FILE, "w"))
Run this on a cron schedule (e.g. 0 * * * * python price_monitor.py) to check prices hourly and log every change.
What can you build with this?
Price monitoring & alerts
Track competitor product pricing in real time. Alert your team when a competitor drops below your price or a product you sell goes on sale.
Sentiment analysis
Pull hundreds of reviews and run NLP/LLM models to surface recurring complaints, praised features, and quality trends - at scale.
Market research
Analyze best seller rankings by category over time. Spot trending products before they peak and identify saturation in specific niches.
E-commerce catalog enrichment
Enrich your product database with live Amazon pricing, rating, review count, and availability - useful for comparison shopping engines.
Competitor intelligence
Monitor how competitor ASINs rank for search terms, track review volume growth, and detect when they launch new variants or bundles.
AI / LLM applications
Feed real-time Amazon product data into RAG pipelines, shopping chatbots, or product recommendation engines that need current pricing and availability.
Supported Amazon marketplaces
Pass a country parameter to get results from any of these marketplaces. Each returns localised pricing, currency, and availability data.
US
amazon.com
UK
amazon.co.uk
DE
amazon.de
FR
amazon.fr
IT
amazon.it
ES
amazon.es
CA
amazon.ca
JP
amazon.co.jp
AU
amazon.com.au
IN
amazon.in
MX
amazon.com.mx
BR
amazon.com.br
NL
amazon.nl
SE
amazon.se
PL
amazon.pl
SG
amazon.sg
Start pulling Amazon data today
Free plan - 100 requests/month, no credit card required. Full API documentation, interactive playground, and code examples in Python, JavaScript, and cURL included.
API by Category
Search
Business & Location
E-commerce & Products
Contact & Social
Jobs & Finance
Didn't find the API you are looking for? Request an API
