Skip to content
All library documents

Downloading S&P 500 Historical Data from Google Finance

Article Quant Q&A · Author: CAPGuy

Summary

This discussion explains why Google Finance’s historical data download worked for some securities but not for the S&P 500 index. The index page lacked the CSV download link available on an ETF page, so adding a CSV output parameter did not provide the index data. The suggested workaround was to scrape the displayed data, with the caveat that scraping is generally less reliable than a supported download.

A reply also compares data sources, claiming Yahoo’s adjusted stock histories could contain split-adjustment errors and that a Google data link provided accurate data but limited the history to 16 years. These are anecdotal claims from the discussion rather than a documented validation or systematic comparison; availability and behavior may also change over time.

Key ideas

  • Google Finance exposed CSV downloads for some securities but not for the S&P 500 index page.
  • Scraping the index page was proposed as a workaround, though it may be unreliable.
  • A reply claimed Yahoo split adjustments could be biased and Google data was limited to 16 years.
  • The data quality claims are anecdotal and are not supported by a systematic comparison.

Tags

Full text
# Downloading S&P historical data from Google


# Downloading S&P historical data from Google












Since Yahoo has decided to yank their API for the foreseeable future, I'm attempting to switch to Google finance. I'm having trouble downloading a .csv file for GSPC (S&P 500), despite there clearly being a website and table set up for it. The website is here:

https://www.google.com/finance/historical?q=INDEXSP:.INX

Theoretically, I should be able to add "&output=csv" to it, and it should download it as a .csv:

https://www.google.com/finance/historical?q=INDEXSP:.INX&output=csv

No dice. Does anyone know what is going on here? Thanks in advance.

## Answer by amdopt (score 2)

https://quant.stackexchange.com/a/34306

You can't download the S&P data from Google finance like you can with stock or ETF data.

If you navigate to https://www.google.com/finance/historical?q=NYSEARCA%3ASPY&ei=L-keWcHYIdGSmgHtu5rYDw you will notice the link to download to a .csv on the right. If you add &output=csv to the above URL it will download the SPY data to a .csv

Compare this to https://www.google.com/finance/historical?q=INDEXSP%3A.INX&ei=D-keWcn2JIeEmAGJ14qwCA This link for S&P 500 Index data does not have the link on the right to download to .csv. You would have to scrape it out which is never ideal.

## Answer by Mike Fouche (score 0)

https://quant.stackexchange.com/a/36025

Don't bother with Yahoo data - it's skewed. I used the backdoor approach and am able to download data without a problem. But quite a few of the data files had inaccurate stock data - it's as though their algorithm to adjust for splits has biasing over time. Google is 100% accurate but it's limited to 16 years of data - at least the link that I use.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.