April 2019
Intermediate to advanced
426 pages
11h 13m
English
The following code connects to Alpha Vantage and downloads the Dow dataset, with the ticker code ^DJI. Replace the value of the constant variable, ALPHA_VANTAGE_API_KEY, with your own API key:
In [ ]: """ Download the all-time DJIA dataset """ from alpha_vantage.timeseries import TimeSeries # Update your Alpha Vantage API key here... ALPHA_VANTAGE_API_KEY = 'PZ2ISG9CYY379KLI' ts = TimeSeries(key=ALPHA_VANTAGE_API_KEY, output_format='pandas') df, meta_data = ts.get_daily_adjusted(symbol='^DJI', outputsize='full')
The TimeSeries class of the alpha_vantage.timeseries module is instantiated with the API key and specifies that datasets are automatically downloaded as pandas DataFrame objects. ...
Read now
Unlock full access