Metadata-Version: 2.1
Name: amazondata
Version: 0.1.0
Summary: A python package to get amazon product and search data in json form. The package does not require any API keys as it works by scraping the amazon page.
Home-page: https://github.com/AnupKumarPanwar/amazondata
Download-URL: https://pypi.org/project/amazondata/
Author: Anup Kumar Panwar
Author-email: 1anuppanwar@gmail.com
License: MIT
Keywords: Amazon,Scraper
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: selectorlib
Requires-Dist: requests

# amazondata

[![PyPI version](https://badge.fury.io/py/amazondata.svg)](https://badge.fury.io/py/amazondata)

A python package to get amazon product and search data in json form. The package does not require any API keys as it works by scraping the amazon page.

Reference: [How To Scrape Amazon Product Details and Pricing using Python](https://medium.com/scrapehero/tutorial-how-to-scrape-amazon-product-details-using-python-56d40e7503b7)

## Install

```
pip install amazondata
```

## Usage

To get Amazon product details from the url, use the following function.

### get_product_from_url(url)

```python
from amazondata.product_details_extractor import ProductDetailsExtractor

product_details_extractor = ProductDetailsExtractor()

data = product_details_extractor.get_product_from_url('https://www.amazon.in/dp/B09JSYVNZ2')

print(data)
```

To get Amazon product details from the ASIN (Amazon Standard Identification Number) code, use the following function.

### get_product_from_asin_code(asin_code)

```python
from amazondata.product_details_extractor import ProductDetailsExtractor

product_details_extractor = ProductDetailsExtractor()

data = product_details_extractor.get_product_from_asin_code('B09JSYVNZ2')

print(data)
```

To get the list of products from search query use the following function

### search(query, page)

```python
from amazondata.search_result_extractor import SearchResultExtractor

search_result_extractor = SearchResultExtractor()

data = search_result_extractor.search('perfume for men', 3)

print(data)

```


