The secret Google Stock API

The secret google stock api for NASDAQAre you looking for NASDAQ stock information, then maybe the secret Google Stock API can be helpful.

This API is not a part of the official Google API family, which means that the usage rights are unclear, and the API isn’t supported by Google.

However the API is very useful, so I’ll illustrate the possibilities with the API in this post.

The Google Stock API

The Google tock API can be accessed by using a url in the following format:

http://www.google.com/ig/api?stock=goog

Where “goog” is the 4 letter NASDAQ stock code.

As far as I have tested the API only works with NASDAQ, but stocks from other stock exchanges might also be supported.

The request provides the following response:


<xml_api_reply version="1">
<finance module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
<symbol data="GOOG"/>
<pretty_symbol data="GOOG"/>
<symbol_lookup_url data="/finance?client=ig&q=GOOG"/>
<company data="Google Inc."/>
<exchange data="Nasdaq"/>
<exchange_timezone data="ET"/>
<exchange_utc_offset data="+05:00"/>
<exchange_closing data="960"/>
<divisor data="2"/>
<currency data="USD"/>
<last data="437.74"/>
<high data="442.89"/>
<low data="436.00"/>
<volume data="1226772"/>
<avg_volume data="3153"/>
<market_cap data="139414.28"/>
<open data="441.62"/>
<y_close data="439.49"/>
<change data="-1.75"/>
<perc_change data="-0.40"/>
<delay data="0"/>
<trade_timestamp data="2 minutes ago"/>
<trade_date_utc data="20100702"/>
<trade_time_utc data="185508"/>
<current_date_utc data="20100702"/>
<current_time_utc data="185708"/>
<symbol_url data="/finance?client=ig&q=GOOG"/>
<chart_url data="/finance/chart?q=NASDAQ:GOOG&tlf=12"/>
<disclaimer_url data="/help/stock_disclaimer.html"/>
<ecn_url data=""/>
<isld_last data="441.69"/>
<isld_trade_date_utc data="20100702"/>
<isld_trade_time_utc data="132955"/>
<brut_last data=""/>
<brut_trade_date_utc data=""/>
<brut_trade_time_utc data=""/>
<daylight_savings data="true"/>
</finance>
</xml_api_reply>

As you can see, the API contains a lot of very detailed information about the stock, and links to further information on Google Finance.

As mentioned in the start of this post, the API isn’t officially supported by Google, and therefore usage rights and support isn’t clear.

However if you want to test the API further, you can get inspiration to a PHP implementation from this script that works with the Google weather API.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
fold-left fold-right
About the author
Jørgen Nicolaisen has been passionately interested in everything online since 1995. His experience is based on working with small hobby projects as well as high volume websites. Jørgen is currently focused on the PHP based programming framework - Codeigniter, and WordPress naturally

One Reply to The secret Google Stock API

  1. DAemon says:

    Google, when they announced this API, said that they can only license it for use in gadgets, due to ‘data licensing restrictions’. At least, I’m pretty sure that it’s this API!

    More information at http://googlefinanceblog.blogspot.com/2007/10/api-gadgets-and-tabs-oh-my.html

    You may be better off using the Yahoo! YQL solution, detailed at http://www.yqlblog.net/blog/2009/06/02/getting-stock-information-with-yql-and-open-data-tables/

Comments are now closed for this article.