Python module to fetch product data from Amazon
Project description
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
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. |
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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyamazon-1.0.2.tar.gz.
File metadata
- Download URL: pyamazon-1.0.2.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
338324052c22911f9a1a7fb14ae0bb82255d3a351288799d6eba624b4c0ea49a
|
|
| MD5 |
67003114fbee0401407923e30af99b13
|
|
| BLAKE2b-256 |
0b12b42b27a5b2a4453b7949137cac6de241524b275bb5c0d43191844b037963
|
File details
Details for the file pyamazon-1.0.2-py3-none-any.whl.
File metadata
- Download URL: pyamazon-1.0.2-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
054048ad7d5b17192bd1bb0fc3f230ed5abff21881727ff95d4f2b0be103eb70
|
|
| MD5 |
085e42cbaf53c29c66afca90fb12fd04
|
|
| BLAKE2b-256 |
c2c5c9a70d5aac51651f159f0e3f7f9176b7416df6bdc86839fd60065b0546f9
|