Answers for "getting financial data python"

2

getting financial data python

#In your command prompt first run: pip install yfinance

import yfinance as yf

msft = yf.Ticker("MSFT")

# get stock info
msft.info

# get historical market data
hist = msft.history(period="max")

# show actions (dividends, splits)
msft.actions

# show dividends
msft.dividends

# show splits
msft.splits

# show financials
msft.financials
msft.quarterly_financials

# show major holders
msft.major_holders

# show institutional holders
msft.institutional_holders

# show balance sheet
msft.balance_sheet
msft.quarterly_balance_sheet

# show cashflow
msft.cashflow
msft.quarterly_cashflow

# show earnings
msft.earnings
msft.quarterly_earnings

# show sustainability
msft.sustainability

# show analysts recommendations
msft.recommendations

# show next event (earnings, etc)
msft.calendar

# show ISIN code - *experimental*
# ISIN = International Securities Identification Number
msft.isin

# show options expirations
msft.options

# get option chain for specific expiration
opt = msft.option_chain('YYYY-MM-DD')
# data available via: opt.calls, opt.puts
Posted by: Guest on September-09-2021
3

python get financial data

#In your command prompt you first need to install yfinance by running:
#pip install yfinance
import yfinance as yf
AAPL = yf.Ticker('AAPL').history('5y')
Posted by: Guest on September-08-2021

Code answers related to "getting financial data python"

Python Answers by Framework

Browse Popular Code Answers by Language