Search code examples
pythonalpha-vantage

alpha_vantage API (python) not giving adjusted data


I`m trying to access the TSLA stock data but the data doesn't seem to have accounted for the split earlier this year. The Alpha_Vantage website claims that it will be set to adjust=true as default but this doesn't seem to be the case, I tried to specify adjust=true but this returned an unexpected keyword error.

from alpha_vantage.timeseries import TimeSeries
import pandas as pd
ts = TimeSeries(key= api_key, output_format='pandas'
data, meta_data = ts.get_daily(self.symbol, outputsize='full')
#tried ts.get_daily(self.symbol, outputsize='full') but still no luck. The image ive added shows the data in a graph. the crash, i believe is a split 

enter image description here


Solution

  • from alpha_vantage.timeseries import TimeSeries
    import pandas as pd
    ts = TimeSeries(key= api_key, output_format='pandas')
    data, meta_data = ts.get_daily_adjusted(self.symbol, outputsize='full')

    Here's the method to get split adjusted closings.

    Graph Close vs Adjusted Close