Have you ever wanted to track something like the price of stocks, or the weather, or anything else, and been annoyed at the fact that you need to install multiple apps to do it? It's surprisingly easy to build your own application to do that using Python, and you can even consolidate it all into one application if you want.
Through the course of this project, I built a program that does the following:
- Checks the weather in my area
- Checks the price of a stock (I used AAPL for testing)
- Checks the price of a game on Steam
- Checks top news topics for technology
- Emails me with everything
- Posts a Windows notification with the current weather
If you want to get started with this project and learn how you can make your own, then read on. This isn't an incredibly intense project or a particularly difficult one, but it's a great entry-way to the world of automation and building your own tools so that you don't need to rely on other ones out there.
Getting your API keys
Most of the good ones are free
First and foremost, to use this application, you'll need to sign up for a number of API keys. They're all free API keys, but not all services you want to track will allow this access for free. Some will but will require you to apply for a key, while others may require you to pay money. All of these require you to sign up for an account, but they will work instantly and do not require approval or anything else to use.
- OpenWeather API
- AlphaAdvantage API
- NewsAPI
To track the Steam market you do not need an API key. Once you have your API keys, you must place those in the appropriate location in your script.
How you can make your own notification tracker in Python
You just need some time to set it up
Querying APIs for information is pretty easy, and most APIs are free to use so long as making a normal amount of requests. For example, I built a script that checks for the price of a Steam game to drop. That program doesn't even need to run every five minutes, and you could run it a couple of times a day at most and keep on top of sales for some of your favorite games. Likewise, you can make a weather alert tracker that can send you a notification either via email or via Windows notification.
In my Python script, I have incorporated both methods, so that you can chop and change what you need. In it, I will get a Windows notification with weather alerts when the weather is between 0 degrees Celsius and 30 degrees Celsius, and that weather alert will also tell me what the weather conditions are outside of the temperature. It's a very basic implementation, but you can learn from it to see what else you can incorporate using it. It uses the win10toast library (which works on Windows 11), though keep in mind that if you use a Mac or Linux PC, you'll need to use a different library to post notifications to the user.
With that, I made it so that my application could also email me alerts, ensuring that I get them on my phone, too. If you wanted to containerize this script and deploy it on a NAS using Docker, you could do that, and it would mean that you could have your notification scripts always running and always emailing you with whatever information you need at any given time.
The reason why I made this application was so that I could track all of my own things I needed online, without dealing with advertisements or data tracking that conventional free applications out there will do. While there are plenty of free and open-source programs that I'm sure can do the same thing without tracking their users, this was also a fun project to get to grips with API usage and tracking things online through official means. You can definitely build a web scraper to do something similar (and I've done that too for price tracking on Best Buy and even finding rental properties) but this is the "proper" way to do it.
Expanding the script
I built a web dashboard to add to it
Now that you've configured and set up the Python script, you can work on expanding it. I turned it into a Flask application, where a web UI can show me live cards of the information that's pulled from those APIs. The news API can show you how to display a list of items, which you can then use to track more games and more stocks if you'd like. There are a lot of moving parts in a project like this, but it's relatively straightforward to get it up and running and work on expanding it.
If you want to get started with this project, you can check it out on GitHub to download the Python script and deploy it yourself. The modules you need to install with pip are in the imports at the top of the script, and you can just run it like you would any other Python script. You will need to make sure to insert the API keys that you've received from signing up to those other services, along with configuring email notifications, too. To configure email notifications, you'll need to generate an app password if you're using Gmail with 2FA enabled.
If you expand on this program yourself or have any ideas on how you would let us know in the comments! It's nowhere near a perfect program, but it's a proof of concept that can show you various ways to build around APIs so that you can chop and change to make it fit your own needs.
