Skip to content

Repository files navigation

Amazon Scraper

CI Python License

Scrape Amazon search results and product data as clean JSON - no blocks, no CAPTCHAs, no proxy juggling. Powered by the ScrapeUnblocker anti-bot API, which renders the page behind Amazon's protection and returns structured fields for you.

Works across 20 Amazon marketplaces (.com, .co.uk, .de, .fr, .co.jp, ...).

Features

  • Search any keyword -> title, price, currency, ASIN, URL, image, position.
  • Product by ASIN -> full details (price, list price, savings, rating, availability, brand).
  • Sort, price filters, pagination, and per-country proxy targeting.
  • Automatic retry through a fresh exit when Amazon throws a bot wall.
  • Export to JSON or CSV, use it as a CLI or import it as a library.

Install

pip install -e .
# or, for development (tests + linting):
pip install -e ".[dev]"

Set your key (get a free one at app.scrapeunblocker.com):

export SCRAPEUNBLOCKER_KEY=your_key_here

CLI

# Search
amazon-scraper search "wireless headphones" --marketplace amazon.com --sort price_asc --out results.json

# One product by ASIN
amazon-scraper product B08N5WRWNW --marketplace amazon.com

Library

from amazon_scraper import AmazonScraper

scraper = AmazonScraper()  # reads SCRAPEUNBLOCKER_KEY from the environment

results = scraper.search("wireless headphones", marketplace="amazon.com", sort="price_asc")
for item in results["results"]:
    print(item["title"], item["priceRaw"])

product = scraper.product("B08N5WRWNW", marketplace="amazon.com")
print(product["title"], product["priceRaw"], product["rating"])

More in examples/: JSON output, CSV export, product lookup.

Example output

{
  "keyword": "wireless headphones",
  "marketplace": "amazon.com",
  "results": [
    {
      "position": 1,
      "asin": "B08N5WRWNW",
      "title": "Hybrid Active Noise Cancelling Bluetooth Headphones",
      "url": "https://www.amazon.com/dp/B08N5WRWNW",
      "image": "https://m.media-amazon.com/images/I/....jpg",
      "price": 49.99,
      "currency": "USD",
      "priceRaw": "$49.99"
    }
  ]
}

Project layout

src/amazon_scraper/   # the package (scraper core + CLI)
examples/             # runnable usage examples
tests/                # offline unit tests (mocked API, no credit spent)

Development

make install   # editable install with dev deps
make lint      # ruff
make test      # pytest (offline, mocked)
make run       # sample search

Why an API instead of raw requests?

Amazon actively blocks scrapers (rate limits, CAPTCHAs, bot detection). ScrapeUnblocker handles the anti-bot layer, browser rendering, and proxies, so you get clean data instead of a "Robot Check" page. See the docs.

License

MIT - see LICENSE.

About

Scrape Amazon search results and product data (price, rating, reviews) across 20 marketplaces - no blocks, powered by ScrapeUnblocker.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages