Skip to content

A python script that gets the prices of certain Cex products and uploads them to google sheets

License

Notifications You must be signed in to change notification settings

piotrpdev/WeBuy-Cex-Price-Tracker

Repository files navigation

WeBuy Cex Price Tracker Build Status License Python version

A python script that gets the prices of certain WeBuy CeX products and uploads them to google sheets. Based on CEX-API, uses the Irish version of webuy.com.

Getting Started

The script is currently able to get the information of multiple products using their id's. Put in the id's of the games you want and you will get their prices.

Prerequisites

You will need the latest version of Python, OAuth2Client, Requests, GSpread and GSpread-Formatting.

There is a requirements.txt file included that has everything you need in it. Just run this command before running the script and you should be good to go:

pip install -r requirements.txt

Installing

After downloading the files and prerequisites you can enter the id's of the products you want to check into id_list.py. Then make sure you put the credentials file into the folder, name it client_secret.json, and put the sheets' name into main.py.

sheet = client.open("name of sheet here").sheet1

Running

Running the script as is should return the information for some products. The dupeChecker() function will check for any duplicate id's in your list and then the update_list() function will check for new id's and ungenerated google sheet products.

PriceUpdate() will then lookup each id on the CeX website, get it's prices and print it onto the google sheet.

However, be aware that if you add a lot of id's you will need to deal with Google Sheets' API Usage Limits. I have added a basic cooldown function in main.py and addon.py however it isn't perfect, if you're looking into adding A LOT of id's you should try manipulating the wait time.

time.sleep(100)

Optionally you can use the nandi() function to scan the google sheet for any names and id's and print them to the console.

Getting the id The id's Final result

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgement

Big thanks to Sothclaws for his CeX Go Client and teamplz for his CEX-API. They really helped me out and saved me a lot of time!