I want to download historical data for different indices. I am using Python for this. I used the following code.
import pandas_datareader.data as web
start = datetime.datetime(1960, 1, 1)
end = datetime.datetime(2020, 4, 30)
SP500 = web.DataReader(['sp500'], 'fred', start, end)
It gave me data from 2010 onwards.
SP500.head()
sp500
DATE
2010-05-03 1202.26
2010-05-04 1173.60
2010-05-05 1165.90
2010-05-06 1128.15
2010-05-07 1110.88
Is there a way to pull the complete history? Also is it possible to pull data at daily/weekly/monthly/quarterly frequency. It does not have to be datareader, it can be any other function that can accomplish this.