yahoo finance api python 1

yahoo finance api python

# Python 2 only
# Install package with 'pip install yahoo-finance'

from yahoo_finance import Share
yahoo = Share('YHOO')
print yahoo.get_open()
print yahoo.get_price()
print yahoo.get_trade_datetime()

Here is what the above code is Doing:
1. Importing the Share class from the yahoo_finance module.
2. Creating a Share object named yahoo.
3. Calling the get_open() method on the yahoo object.
4. Calling the get_price() method on the yahoo object.
5. Calling the get_trade_datetime() method on the yahoo object.

Similar Posts