This is a simple Python program designed to fetch real-time prices of Bitcoin and US stocks and compare their price movements.
- Clone or download this repository to your local environment.
- Ensure that you have the
requests
library installed in your Python environment (if not, you can install it usingpip install requests
). - Open the
bitcoin_stock.py
file and fill in your Alpha Vantage API key. - Run the
bitcoin_stock.py
file:python bitcoin_stock.py
- The program will output the real-time prices of Bitcoin and a US stock (defaulted to AAPL) and compare their price movements.
- You need to register for an Alpha Vantage account to obtain an API key and fill it into the code.
- If you want to fetch prices of different stocks, you can modify the
stock_symbol
variable to your desired stock code.
Contributions, suggestions, or improvements are welcome. If you encounter any bugs, feel free to submit an issue.
This project is licensed under the MIT License. Please see the LICENSE file for more details.