ShoeBot is an automated script that checks for availability and attempts to purchase shoes from a Shopify-based website. The bot continuously scans a specific product page for a given keyword and size. Once it detects the shoe is available, it adds the item to the cart and proceeds to checkout automatically.
- Checks availability of specific products on Shopify websites.
- Supports scanning for a keyword in product listings.
- Automatically selects the available shoe size.
- Adds the product to the cart.
- Automates the checkout process using shipping and payment details.
Before using the ShoeBot, ensure you have the following installed:
- .NET SDK 8.0
- A modern web browser (Google Chrome recommended)
- ChromeDriver installed for Selenium to interact with the browser
- Visual Studio Code or any other C# compatible editor
- Clone the repository or download the project files to your local machine.
git clone https://github.com/shubham170102/shoebot.git
cd shoebot
- Install the required NuGet packages. Open your terminal in the project directory and run:
dotnet add package Newtonsoft.Json
dotnet add package Nito.AsyncEx
dotnet add package Selenium.WebDriver
dotnet add package Selenium.WebDriver.ChromeDriver
dotnet add package RestSharp
- Ensure
ChromeDriver
is installed and added to your system'sPATH
so Selenium can launch Chrome.
Before running the bot, you need to configure the following parameters in the code:
- Website URL: In the
Main
method, update thewebsite
andcategory
variables to point to the correct Shopify store and category.
var website = "nrml.ca"; // Replace with your target website
var category = "/collections/footwear"; // Update with the correct product category
- Keyword: Update the
Keyword
variable with the specific product you want to search for.
string Keyword = "CDG"; // Replace with the product name or brand you are looking for
- Shoe Size: If you are looking for a specific size, update the size variable.
var size = "8"; // Replace with the shoe size you are searching for
- User Details for Checkout: Update the BuyAsync method with your own shipping and billing details.
new KeyValuePair<string, string>("checkout[shipping_address][first_name]", "Shoe"),
new KeyValuePair<string, string>("checkout[shipping_address][last_name]", "Bot"),
new KeyValuePair<string, string>("checkout[email]", "shoebot0@gmail.com"),
new KeyValuePair<string, string>("checkout[shipping_address][phone]", "450-443-0358"),
new KeyValuePair<string, string>("checkout[shipping_address][address1]", "6400 Boulevard Taschereau"),
new KeyValuePair<string, string>("checkout[shipping_address][city]", "Brossard"),
new KeyValuePair<string, string>("checkout[shipping_address][zip]", "J4W3J2")
Once you've updated the configuration, run the bot by executing the following command:
dotnet run
The bot will monitor the Shopify store for the specified product. When it finds a product matching your keyword, it will check if the specified size is available.
If the product is available, the bot will add it to the cart and proceed to checkout, automatically filling in the necessary details like shipping and payment information.
The bot will generate the payment token and attempt to process the payment. If successful, it will display a success message in the terminal.
The bot sends a GET request to the Shopify store’s product API endpoint (e.g., /products.json
). It retrieves the available products and checks for the specified keyword (e.g., a product name or brand like "CDG").
After finding the product, it checks the available variants (such as sizes) to see if your desired size is in stock.
Once the product and size are found, it sends a POST request to the Shopify cart endpoint to add the product.
The bot proceeds to the checkout page and fills in the required details for shipping, contact information, and payment, automating the process entirely.
The bot will either confirm the purchase or handle errors like declined payments, out-of-stock notices, or other processing issues.
-
Additional Products: To search for multiple keywords or products, you can expand the logic in the
Main
method to loop over an array of keywords. -
Multi-size Support: If you want to search for multiple sizes, modify the bot to loop through a list of sizes and attempt to purchase the first available size.
-
Bot Limitations: Some Shopify stores use CAPTCHA and other anti-bot technologies. This bot does not include CAPTCHA solving, so it may not work on all websites.
-
Legal Considerations: Ensure you have permission to use automation tools on e-commerce websites. Some stores have policies against bots and may block your IP or account.
-
Bot Not Finding Products: Ensure the website's category and product data are accessible via the API and that the
keyword
is spelled correctly. -
Errors During Checkout: Check if the shipping or billing details are filled correctly and ensure that the website hasn't changed its checkout process.