Introducing the Google Finance API
Google February 18th, 2007 - By HaochiThere aren’t really much APIs for stocks out there, fortunately, Google provides you a free, yet powerful API to access the stock data that used in Google Finance. (Update once every 5 min, and up to 20 min of delay.)
With the help of a feature (new trick, Google called it) that Google added to the Spreadsheets late last year, GoogleFinance, and with the Spreadsheets API, we can obtain the data easily in XML and JSON format. Demo using the JSON format can be found here. (GOOG data are used in the examples)
I will probably writing some tutorials, perhaps doing a screen cast on how to use this in the real world. (such as on a web page) :) But until then, you should take a look at the Spreadsheet Data API Reference Guide, and the help page for GoogleFinance function in the Spreadsheets. (if you are interested in using this API)
note: this is not really an official API that Google provides.



February 18th, 2007 at 11:51 pm
Hi,
I also put up a fun script gspreadsheet that lets you run anything through the spreadsheet api:
http://www.almaer.com/blog/archives/001382.html
e.g.
% gspreadsheet ‘GoogleFinance(”GOOG”)’
467.3
Cheers,
Dion Almaer
Google Open Source Program
code.google.com
February 19th, 2007 at 12:43 am
Sweet - too bad a few hosting provider supports Ruby.
Looking forward for a PHP version. (Maybe I should start using the Zend library for GData, definitely…)
February 21st, 2007 at 6:04 am
Its really good to have this API.
February 28th, 2007 at 10:33 am
Hello,
I want to use Google finance api on my site. Its written in this link http://www.almaer.com/blog/archives/001382.html that it must be in ruby. I have ruby installed on my site. But dont know how do i save a ruby file and also call the same data from a html file to make it visible to world. Can you provide detailed instructions……….i am in urgent need !
March 16th, 2007 at 11:56 am
What about forex quotes? Any chances?
March 16th, 2007 at 5:00 pm
Doesn’t seem like Google Finance supports that… If you can find it in the Help Center and it says it does, then it does.
September 28th, 2007 at 5:22 pm
Is it possible to use the Python API to subscribe to a quote feed or download some quote data?
December 3rd, 2007 at 1:14 pm
I’m curious about who provides this stock data to Google. Is it StrikeIron? Whichever company it is, Google must be using their API.
January 15th, 2008 at 2:58 am
Google and Yahoo both get their financial data from CSI (commodity systems inc)
February 16th, 2008 at 12:33 pm
Will you be publishing this tutorial or a webcast anytime soon? Thanks.
April 21st, 2008 at 3:06 pm
Hi,
I’d like your API to expose the following two things that i don’t see in your (spreadsheet) api reference:
1. top 10 holdings of a mutual fund — this would be VERY helpful.
2. the morningstar rating of a particular fund.
thanks,
amir
April 21st, 2008 at 3:08 pm
eh… i just realized the morningstar rating is there… nvm that… i’d still like to see the top 10 holdings though.
thanks!
June 2nd, 2008 at 6:13 pm
Any chance of accessing more than stock quotes? Such as filings, revenue, market cap, past stock performance, etc..?
July 5th, 2008 at 5:29 pm
That’s all nice, but does anyone know how to just connect to google finance through a tcp, and simply leach the data into your own program, like the web browser client does?
July 17th, 2008 at 1:36 am
If anyone is interested I just wrote a blog entry on how to use the Google Finance API with Groovy (a scripting language similar to Java): http://www.fiascode.com/programming/putting-google-finance-to-rest-with-groovy/
July 23rd, 2008 at 11:36 am
Just for good measure I’ve also rewrote my previous blog entry using Ruby:
http://www.fiascode.com/programming/putting-google-finance-to-rest-with-ruby/
August 12th, 2008 at 2:30 pm
What about using the igoogle way ?
http://www.google.com/finance/info?client=ig&q=AAPL
returns:
// [ { “id”: “22144″ ,”t” : “AAPL” ,”e” : “NASDAQ” ,”l” : “177.65″ ,”l_cur” : “177.65″ ,”ltt”:”2:22PM EDT” ,”lt” : “Aug 12, 2:22PM EDT” ,”c” : “+4.09″ ,”cp” : “2.36″ ,”ccol” : “chg” } ]
in javascript that’s a comment…
I wonder how to retrieve it using javascript only.
August 12th, 2008 at 3:22 pm
http://www.google.com/finance/info?client=ig&q=AAPL
returns:
// [ { “id”: “22144″ ,”t” : “AAPL” ,”e” : “NASDAQ” ,”l” : “176.66″ ,”l_cur” : “176.66″ ,”ltt”:”3:21PM EDT” ,”lt” : “Aug 12, 3:21PM EDT” ,”c” : “+3.10″ ,”cp” : “1.79″ ,”ccol” : “chg” } ]
I wonder how to get it in javascript…
Because that is a comment in javascript..