How to work with Google Finance?

Edward D. picture Edward D. · Jul 17, 2012 · Viewed 29.7k times · Source

I want to develop a small application to get stock price from Google Finance automatically and store it in my local machine for future analysis.

Can anyone give me some clue how to get started?

I know some C#. Will it be suitable for this purpose?

Thank you in advance.

Answer

rajaram_s picture rajaram_s · Aug 2, 2012

The Google Finance Gadget API has been officially deprecated since October 2012, but as of April 2014, it's still active:

http://www.google.com/finance/info?q=NASDAQ:ADBE

Note that if your application is for public consumption, using the Google Finance API is against Google's terms of service.

This gives a JSON response which can be parsed using a simple JSON parser in C# after chopping off the first two chars ('//').

For downloading historic data again, you could use the Google APIs.

http://www.google.com/finance/historical?q=NASDAQ:ADBE&startdate=Jan+01%2C+2009&enddate=Aug+2%2C+2012&output=csv

gives out a CSV of end of day stock prices from startdate to enddate. Use a simple CSV parser to get meaningful data out of this stored on your db. However, this format=csv option does not work for a few stock exchanges.