Yahoo Finance API Ticker: Difference between revisions
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
<syntaxhighlight lang='py'> | <syntaxhighlight lang='py'> | ||
yf.Ticker('AAPL').history(period='1d')['Close'] | yf.Ticker('AAPL').history(period='1d')['Close'].iloc[0] | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=Keys= | =Keys= |
Revision as of 05:54, 14 October 2023
Internal
Overview
Seems to be returning the pervious day data, not the current data. Current data can be obtained with:
yf.Ticker('AAPL').history(period='1d')['Close'].iloc[0]