Market Watch
A console-based application to watch stock prices and currency exchange rates.
Setup
pip install -r requirements.txt
API Endpoints
The application queries the following APIs. You need to register an account on Rapid API and subscribe to them. The application is written to try to stay under the request limit of the free tiers, although that will also depend on how many stocks and currencies you decide to query. For a small set, the free tier of the APIs should be sufficient. Otherwise, consider subscribing to the paid tiers.
- Stock: https://rapidapi.com/amansharma2910/api/realstonks
- Currency: https://rapidapi.com/juhestudio-juhestudio-default/api/exchange-rate-api1
Once you have created an account and subscribed, define the environment variable
RAPIDAPI_KEY
with your API key prior to running the application. The
application queries this variable to determine your API key.
Stocks and Currency
The application state is persisted in the file state.txt
. To define which
stocks to query, add/remove the necessary lines to this file.
The syntax of a stock line is:
sticker price change change%
The syntax of a currency exchange is:
from/to rate
For stocks, you can leave all fields but the sticker to 0. For exchange rates, you can leave the rate to 0.
See examples in the provided state file.