Skip to the content.

Find product opportunities in Amazon Best Sellers with Python

In this tutorial you will build a product research script. It reads an Amazon Best Sellers list for a category and prints the median price and ratings count. Then it lists the ranked products with the fewest ratings: products that sell without a wall of reviews, so a new seller can compete with them. It uses the Amazon Data API and about 40 lines of Python.

What you need: Python 3.8+, pip install requests, and a free RapidAPI key.

1. Subscribe to the free plan

  1. Open the Amazon Data API on RapidAPI and subscribe to the free Basic plan (20 requests a month).
  2. Copy your X-RapidAPI-Key and export it:
export RAPIDAPI_KEY=your_key

2. A small helper to call the API

The helper sends your key, retries rate limits (HTTP 429) and server errors (5xx) with a growing wait, and stops with the API’s error message on anything else.

"""Find product opportunities in an Amazon Best Sellers or New Releases list.

Uses the Amazon Data API on RapidAPI:
https://rapidapi.com/apiwren-apiwren-default/api/amazon-data-api-search-product-reviews-best-sellers
"""
import os, sys, time
from statistics import median
import requests

HOST = "amazon-data-api-search-product-reviews-best-sellers.p.rapidapi.com"
HEADERS = {"X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"], "X-RapidAPI-Host": HOST}


def get(path, **params):
    """GET one endpoint. Retries rate limits (429) and server errors (5xx)."""
    for attempt in range(4):
        r = requests.get(f"https://{HOST}{path}", headers=HEADERS, params=params, timeout=90)
        retry = r.status_code == 429 or r.status_code in range(500, 600)
        if retry and attempt != 3:
            time.sleep(float(r.headers.get("Retry-After") or 2 ** (attempt + 1)))
            continue
        if not r.ok:
            sys.exit(f"HTTP {r.status_code}: {r.text[:300]}")
        body = r.json()
        if isinstance(body, dict) and body.get("success") is False:
            sys.exit(f"API error: {body.get('error')}")
        return body

3. Read a best-seller list

/best-sellers takes a category, a type and a country. The category is the slug from Amazon’s best-seller URLs, for example kitchen or electronics, optionally with a node ID such as electronics/172541. The type is one of bestsellers, new-releases, movers-and-shakers, most-wished-for and gift-ideas. It returns ranked items with price, rating and total_ratings, plus subcategories.

def best_sellers(category, list_type="bestsellers", country="US"):
    return get("/best-sellers", category=category, type=list_type, country=country)["data"]

4. Find the opportunities

Sort by ratings count and keep the top five. Then print the subcategories so you can drill into a narrower list.

def main(category, list_type="bestsellers"):
    data = best_sellers(category, list_type)
    items = data["items"]
    prices = [i["price"] for i in items if i["price"]]
    ratings = [i["total_ratings"] for i in items if i["total_ratings"]]
    print(f"{data['title']}: {len(items)} products")
    print(f"median price {median(prices):.2f}  median ratings count {median(ratings):,.0f}")
    # Few ratings and a high rank: the product sells well without many reviews yet.
    newcomers = sorted((i for i in items if i["total_ratings"] is not None),
                       key=lambda i: i["total_ratings"])[:5]
    print("\nwell ranked with the fewest ratings (easier to compete with):")
    for i in newcomers:
        print(f"  #{i['rank']:3}  {i['total_ratings']:7,} ratings  {i['rating']}*  "
              f"{i['price'] or 0:.2f} {i['currency']}  {(i['title'] or '')[:55]}")
    print("\nsubcategories to drill into: " + ", ".join(s["name"] for s in data["subcategories"][:8]))


if __name__ == "__main__":
    main(*(sys.argv[1:] or ["kitchen"]))

5. Run it

python amazon_best_sellers_report.py kitchen

Real output from a run on 2026-11-28:

Best Sellers in Kitchen & Dining: 50 products
median price 24.36  median ratings count 20,308

well ranked with the fewest ratings (easier to compete with):
  # 36      158 ratings  4.4*  99.99 USD  Cuisinart Air Fryer Toaster Oven Combo, Countertop, 7-i
  # 42    1,860 ratings  4.2*  19.99 USD  HydroJug Everyday Tumbler 14 oz, Ceramic-Lined Straw Cu
  # 41    2,236 ratings  4.2*  79.99 USD  CHEF iQ Sense | Smart Wireless Meat Thermometer | 2 Ult
  # 34    2,617 ratings  4.5*  22.50 USD  STANLEY Everyday Camp Mug, 24 oz, Hammertone Green | In
  # 16    3,157 ratings  4.6*  22.20 USD  YETI Rambler 16 oz Travel Bottle - Stainless Steel, Riv

subcategories to drill into: Bakeware, Bar Tools & Drinkware, Coffee, Tea & Espresso Appliances, Cookware, Dining & Entertaining, Glassware & Drinkware, Home Brewing & Wine Making, Kitchen & Table Linens

The complete script is in examples/amazon_best_sellers_report.py.

Tips

Next steps