Amazon-Auto-Buy-Bot is a Node Js package to buy product on amazon automatically using browser automation. 
It currently runs only on windows.

### Installation

```sh
npm install amazon-auto-buy-bot
```

### Example 1
In this example we first import package, then we login with cookies, then we buy product using credit/debit cards.
```sh
var amazon=require("amazon-auto-buy-bot");

function place_order(){
	amazon.place_order(function(){console.log("Done")})
}

function fill_the_cvv(){
	amazon.fill_cvv("123",place_order)
}
function select_the_payment_method(){
	amazon.select_payment_method("State Bank of India",fill_the_cvv)
}
function buy_product(){
amazon.buy("https://www.amazon.in/Sony-WI-C200-Wireless-Neck-Band-Headphones/dp/B07S13PJ3W/ref=sr_1_20?dchild=1&keywords=earbuds&qid=1613626538&sr=8-20",select_the_payment_method)
}
var cookie_list=[
{
    "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
}]
amazon.login_cookie(cookie_list,buy_product)
```

### Example 2
In this example we first import package, then we login with cookies, then we buy product using net banking.
```sh
var amazon=require("amazon-auto-buy-bot");
function place_order(){
	amazon.place_order(function(){console.log("Done")})
}

function select_the_bank(){
	amazon.select_bank("Axis Bank",place_order)
}
function select_the_payment_method(){
	amazon.select_payment_method("Net Banking",select_the_bank)
}
function buy_product(){
amazon.buy("https://www.amazon.in/Sony-WI-C200-Wireless-Neck-Band-Headphones/dp/B07S13PJ3W/ref=sr_1_20?dchild=1&keywords=earbuds&qid=1613626538&sr=8-20",select_the_payment_method)
}
var cookie_list=[
{
    "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
}]
amazon.login_cookie(cookie_list,buy_product)
```

### Youtube Video
[![](http://img.youtube.com/vi/iu965jeytpQ/0.jpg)](http://www.youtube.com/watch?v=iu965jeytpQ "")


#### DataKund
[datakund](https://www.npmjs.com/package/datakund) is needed for browser automation. As soon as this package 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



### Import
```sh
var amazon=require("amazon-auto-buy-bot");
```

### Login with credentials
```sh
amazon.login(login_url,username,password)
```

### Login with cookies
```sh
amazon.login_cookie(cookie_list)
```

### Click on Buy buttom
```sh
amazon.buy(product_url)
```

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

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

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

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

### Cookies
To login with cookies [Edit this Cookie Extension](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg?hl=en) can be added to browser
### Contact Us
* [Telegram](https://t.me/datakund)
* [Website](https://datakund.com)

