How do I use the yfinance API in Python to get today’s DJI open?

If you are using the yfinance package, then you can get the last day’s open this way.

import yfinance as yf
data = yf.download(tickers = "dji", interval = "1d", period = "1d")
print(data["Open"][0])

Leave a Comment