Skip to main content

Python module to fetch product data from Amazon

Project description

PyAmazon

PyAmazon

Effortlessly extract Amazon product data with Python.

About PyAmazon

PyAmazon is a lightweight yet powerful Python module designed to extract structured product information from Amazon product pages. Whether you're building price trackers, analytics tools, or e-commerce scrapers, PyAmazon offers a clean and reliable interface for accessing titles, pricing, ratings, reviews, availability, images, discounts, and more! all from a single Amazon URL.

Built using requests and BeautifulSoup, the module requires no API key or authentication and is tailored for simplicity, accuracy, and extensibility. It supports Indian and global Amazon domains, making it ideal for both personal and production use.

Installation

pip install pyamazon

Example Usage

from pyamazon import extractAmazon  # Import the extractor class

# Create an object with your Amazon product URL
x = extractAmazon("https://amzn.in/d/jbx0FnF")

# Extract and print various details
print("Title:", x.getTitle())                       # Product title
print("Availability:", x.getAvailability())         # Availability status (e.g., "In stock")
print("Brand:", x.getBrand())                       # Brand name
print("Category:", x.getCategory())                 # Product category / breadcrumb
print("Features:", x.getFeatures())                 # Bullet points / features
print("Original Price:", x.getOriginalPrice())     # MRP or strike-through price
print("Current Price:", x.getPrice())               # Final/current selling price
print("Discount Percent:", x.getDiscountPercent()) # Calculated discount percentage
print("Description:", x.getDescription())           # Product description
print("Rating:", x.getRating())                      # Star rating (e.g., "4.3 out of 5 stars")
print("Sold By:", x.getSoldBy())                    # Seller information
print("Review Count:", x.getReviewCount())          # Total number of reviews
print("Images:", x.getImages())                     # Product image URLs
print("Has Deal:", x.getHasDeal())                     # Whether a deal badge is shown
print("Has Bank Offer:", x.getHasBankOffer())       # Whether a bank offer is available

Methods

Method Description
getTitle() Returns the product title as a string.
getAvailability() Returns the availability status (e.g., "In stock", "Out of stock").
getBrand() Extracts the brand or seller name.
getCategory() Returns a list of product categories (breadcrumb path).
getFeatures() Returns a list of feature bullet points.
getOriginalPrice() Extracts the original MRP or strike-through price.
getPrice() Gets the current/final price.
getDiscountPercent() Calculates and returns the discount percentage.
getDescription() Returns a short description or summary of the product.
getRating() Returns the star rating (e.g., "4.2 out of 5 stars").
getReviewCount() Returns total number of customer reviews.
getImages() Returns a list of product image URLs.
getSoldBy() Returns the seller or fulfillment info (e.g., "Fulfilled by Amazon").
getHasDeal() Checks if a deal is active. Optionally returns regular price if True.
getHasBankOffer() Checks whether any bank or card offer is available for the product.

Features

  • URL-Based Scraping – Extract product data from any Amazon product URL effortlessly.
  • Title Extraction – Get the full product title in clean text.
  • Price & Discount – Fetch current price, original price (MRP), and auto-calculated discount percentage.
  • Availability Status – Know whether a product is in stock or unavailable.
  • Product Description – Retrieve the official product description or summary.
  • Feature Bullets – Get a list of key product features.
  • Ratings & Reviews – Extract average rating and total number of reviews.
  • Image URLs – Grab high-resolution product images.
  • Brand Name – Detect the brand or seller mentioned on the product page.
  • Category Path – Extract the product’s full category hierarchy (breadcrumb).
  • Deal Detection – Identify if a product is currently under a deal or promotion.
  • Sold By Info – Get the seller name (e.g., "Fulfilled by Amazon").
  • Structured Output – Access all product data in a clean Python dict format.
  • Multi-domain Friendly – Works on amazon.in, amazon.com, and other country-specific domains.
  • Lightweight & No API Key Needed – Pure scraping using requests and BeautifulSoup, no authentication required.

Disclaimer

This project is intended for educational and personal use only. PyAmazon is not affiliated with Amazon in any way. Product data is extracted by parsing publicly available HTML, which may change over time. If Amazon updates their website structure, some features of this module may stop working. Please do not use this tool for spamming, scraping at scale, or violating Amazon’s Terms of Service. Use responsibly, respectfully, and at your own risk.

Buy ME a Coffee:

Buy Me a Coffee

Made with ❤️ by Shivanand Mishra

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyamazon-1.0.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyamazon-1.0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file pyamazon-1.0.3.tar.gz.

File metadata

  • Download URL: pyamazon-1.0.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyamazon-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b642b3f676b5fb3c7c9cc48916ffd0393868c1e5aa9d074871b9149e1c0ef2eb
MD5 0396188a2911cdc2eee24bd9110a67fc
BLAKE2b-256 0cada63a6f335e076d08269f4b179e8fb129a39bb74d65fd6f4ad8735db87d0e

See more details on using hashes here.

File details

Details for the file pyamazon-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pyamazon-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for pyamazon-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cd93929105040b3fcd577576e8528f9226bdf5cc7ed721dcb0d4e4865ac9c116
MD5 2aeceee07c9e2fb36ae6c6a01ab9152e
BLAKE2b-256 7a7cab9277c15e2dca425f6691c6ba4c370e895e587ee3866329a8462789ee17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page