amazon-buy-bot 1.0.2
A python library to buy a product automatically on amazon.
License: Apache License 2.0
Keywords: amazon python bot_studio automation login checkout place-order product

Amazon-Buy-Bot is a python library to buy product on amazon automatically using browser automation. 
It currently runs only on windows.

### Example 1:- Buy through Debit Card 
In this example we first import library, then we login with cookies, then we buy product using credit/debit cards.
```sh
from amazon_buy_bot import *
true=True;false=False
list_of_cookies=[
{
    "domain": ".amazon.in",
    "expirationDate": 1644925588.404523,
    "hostOnly": false,
    "httpOnly": false,
    "name": "i18n-prefs",
    "path": "/",
    "sameSite": "unspecified",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "INR",
    "id": 1
}]
#please replace the above sample cookies with your cookies, can see below link of how to fetch cookies
product_link="https://www.amazon.in/Boat-Airdopes-171-Functionality-Resistance/dp/B086WN6N4G/ref=sr_1_14_mod_primary_lightning_deal?crid=1YHOUOZCKZVNV&dchild=1&keywords=earbuds+wireless&qid=1613389628&sbo=Tc8eqSFhUl4VwMzbE4fw%2Fw%3D%3D&smid=A14CZOWI0VEHLG&sprefix=earb%2Caps%2C850&sr=8-14"
amazon.login_cookie(cookies=list_of_cookies)
amazon.buy(product_url=product_link)
amazon.select_payment_method(payment_method='Punjab National Bank Debit Card')
amazon.fill_cvv(cvv='123')
amazon.place_order()
```

### Example 2:- Buy through Net Banking
In this example we first import library, then we login with cookies, then we buy product using net banking.
```sh
from amazon_buy_bot import *
true=True;false=False
list_of_cookies=[
{
    "domain": ".amazon.in",
    "expirationDate": 1644925588.404523,
    "hostOnly": false,
    "httpOnly": false,
    "name": "i18n-prefs",
    "path": "/",
    "sameSite": "unspecified",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "INR",
    "id": 1
}]
#please replace the above sample cookies with your cookies, can see below link of how to fetch cookies
product_link="https://www.amazon.in/Boat-Airdopes-171-Functionality-Resistance/dp/B086WN6N4G/ref=sr_1_14_mod_primary_lightning_deal?crid=1YHOUOZCKZVNV&dchild=1&keywords=earbuds+wireless&qid=1613389628&sbo=Tc8eqSFhUl4VwMzbE4fw%2Fw%3D%3D&smid=A14CZOWI0VEHLG&sprefix=earb%2Caps%2C850&sr=8-14"
amazon.login_cookie(cookies=list_of_cookies)
amazon.buy(product_url=product_link)
amazon.select_payment_method(payment_method='Net Banking')
amazon.select_bank(bank='Axis Bank')
amazon.place_order()
```

### Example 3:- Buy through any Domain
In this example we first import library, then we login with cookies, then we buy product using net banking.
```sh
from amazon_buy_bot import *
true=True;false=False
list_of_cookies=[
{
    "domain": ".amazon.ae",
    "expirationDate": 1644925588.404523,
    "hostOnly": false,
    "httpOnly": false,
    "name": "i18n-prefs",
    "path": "/",
    "sameSite": "unspecified",
    "secure": false,
    "session": false,
    "storeId": "0",
    "value": "INR",
    "id": 1
}]
#please replace the above sample cookies with your cookies, can see below link of how to fetch cookies
product_link="https://www.amazon.ae/JBL-Wired-Universal-Ear-Headphone/dp/B06VWPCYFD/ref=sr_1_5?crid=122U0YTEMR74M&dchild=1&keywords=earphones&qid=1619752866&sprefix=ear%2Caps%2C413&sr=8-5"
#can replace with any product link of amazon
login_link="https://www.amazon.ae/gp/sign-in.html" #can replace this link with your own domain link, e.g https://www.amazon.com/gp/sign-in.html, https://www.amazon.de/gp/sign-in.html
amazon.login_cookie(cookies=list_of_cookies,login_url=login_link)
amazon.buy(product_url=product_link)
amazon.select_payment_method(payment_method='Net Banking')
amazon.select_bank(bank='Axis Bank')
amazon.place_order()
```

#### BotStudio
[bot_studio](https://pypi.org/project/bot_studio/) is needed for browser automation. As soon as this library is imported in code, automated browser will open up in which product will be bought. To buy first login will need to be done. Login can be done either with credentials or via cookies

Complete documentation for Amazon Automation available [here](https://amazon-api.datakund.com/en/latest/)


### Installation

```sh
pip install amazon-buy-bot
```

### Import
```sh
from amazon_buy_bot import *
```

### Login with credentials
```sh
amazon.login(password='place password here', email='place email here')
```

### Login with cookies
```sh
amazon.login_cookie(cookies=list_of_cookies)
```

### Click on Buy buttom
```sh
amazon.buy(product_url='product link')
```

### Select Payment Method
```sh
amazon.select_payment_method(payment_method='payment method')
```

### Fill Cvv
```sh
amazon.fill_cvv(cvv='')
```

### Select Bank
```sh
amazon.select_bank(bank='bank name')
```

### Place order
```sh
amazon.place_order()
```

### Send Feedback to Developers
```sh
bot_studio.send_feedback(feedback="Need help with this ......")
```

### Cookies
To login with cookies [Edit this Cookie Extension](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg?hl=en) can be added to browser. Please check [this](https://abhishek-chaudhary.medium.com/how-to-get-cookies-of-any-website-from-browser-22b3d6348ed2) link how to get cookies to login to your amazon.
### Contact Us
* [Telegram](https://t.me/datakund)
* [Website](https://datakund.com)