Exploring the yahoofinancials Python library
The yahoofinancials Python library provides free access to the market data available from Yahoo Finance, whose provider is ICE Data Services. The library repository is available at https://github.com/JECSand/yahoofinancials.
It provides access to historical and, for most assets, also real-time pricing data for the following:
- Currencies
- Indexes
- Stocks
- Commodities
- ETFs
- Mutual funds
- US Treasuries
- Cryptocurrencies
To find the right ticker, use the lookup at https://finance.yahoo.com/.
There is a very strict limit on the number of calls per hour per IP address (about 1,000-2,000 requests per hour per IP address) and once you reach it, your IP address gets blocked for an extensive period of time. In addition, the functionality provided constantly changes.
Installation of the library is standard:
pip install yahoofinancials
Access to the data is very straightforward, as follows:
from...