RomelTorres / alpha_vantage

A python wrapper for Alpha Vantage API for financial data.
MIT License
4.3k stars 741 forks source link

Timeframe is now restricted? #293

Closed antoinecomp closed 3 years ago

antoinecomp commented 3 years ago

I want to get the DJIA values for 2020 in order to reproduce it with a Principal Component Analysis following this notebook using alpha_vantage. Yet it seems that if the notebook author was available to get the data for the whole year he was interested in, when I run the data it seems that I only have two months:

"""
Download the all-time DJIA dataset
"""
from alpha_vantage.timeseries import TimeSeries

# Update your Alpha Vantage API key here...
ALPHA_VANTAGE_API_KEY = 'MYKEY'

from pprint import pprint
ts = TimeSeries(key=ALPHA_VANTAGE_API_KEY, output_format='pandas')
df, meta_data = ts.get_intraday(symbol='DIA',interval='1min', outputsize='full')
pprint(df.info())

Returns:

<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 5351 entries, 2021-02-03 20:00:00 to 2021-01-21 04:02:00
Data columns (total 5 columns):
 #   Column     Non-Null Count  Dtype  
---  ------     --------------  -----  
 0   1. open    5351 non-null   float64
 1   2. high    5351 non-null   float64
 2   3. low     5351 non-null   float64
 3   4. close   5351 non-null   float64
 4   5. volume  5351 non-null   float64
dtypes: float64(5)
memory usage: 250.8 KB

Has alpha_vantage reduced the available data? Can I extend the timeframe? If it is not possible, how can I get the data for the DJIA otherwise?

AlphaVantageSupport commented 3 years ago

@antoinecomp, this seems to be server-side behavior that is beyond the scope of this Python library. Could you please relay you message/questions to support@alphavantage.co?