Google Stock API

It’s not very well known and Google has no support or docs for it, but there is an elusive Google Stock API. Like most of Google’s API’s it’s REST based. (I wish all API’s were, as I hate SOAP)

Please note this API no longer appears to work. I’m leaving this information here for historical purposes. Here is the new Google Stock API you can use:

Real-Time Google Stock API

The API will give you the following:

  • Stock Symbol
  • Company Name
  • Exchange
  • Exchange Timezone
  • Exchange UTC Offset
  • Exchange Closing
  • Divisor? (I assume this is the number of decimals)
  • Currency
  • Last
  • High
  • Low
  • Volume
  • AVG Volume
  • Market Cap
  • Open
  • Yesterdays Close
  • Change
  • Percent Change
  • Delay
  • Trade Timestamp
  • Trade Date (in UTC)
  • Trade Time (in UTC)
  • Current Date (in UTC)
  • Current Time (in UTC)
  • Link to Google Finance for this stock
  • Link to Google Finance for this stocks chart
  • Daylight Savings Flag


API Url Formatting

The API is very simple. It only has a single parameter that accepts a stock ticker.

Here’s an example:

It should return:

<!--?xml version="1.0"?-->
<xml_api_reply version="1">

		<pretty_symbol data="AAPL"/>
		<symbol_lookup_url data="/finance?client=ig&q=AAPL"/>

		<exchange_timezone data="ET"/>
		<exchange_utc_offset data="+05:00"/>
		<exchange_closing data="960"/>

		<avg_volume data="12682"/>
		<market_cap data="295281.14"/>

		<y_close data="323.66"/>

		<perc_change data="-0.54"/>
		<trade_timestamp data="54 seconds ago"/>
		<trade_date_utc data="20101231"/>
		<trade_time_utc data="184724"/>
		<current_date_utc data="20101231"/>
		<current_time_utc data="184818"/>
		<symbol_url data="/finance?client=ig&q=AAPL"/>
		<chart_url data="/finance/chart?q=NASDAQ:AAPL&tlf=12"/>
		<disclaimer_url data="/help/stock_disclaimer.html"/>
		<ecn_url data=""/>
		<isld_last data="323.00"/>
		<isld_trade_date_utc data="20101231"/>
		<isld_trade_time_utc data="143001"/>
		<brut_last data=""/>
		<brut_trade_date_utc data=""/>
		<brut_trade_time_utc data=""/>
		<daylight_savings data="false"/>

As you can see it’s nice simple XML, very well formated, so it’s makes getting the data out a snap.


Getting Multiple Stock Symbols

You can get multiple stock symbols at once by repeating the stock parameter in the url. (thanks to Patrick Fisher (see comments))
Here is an example of the response Google finance returns:

<!--?xml version="1.0"?-->
<xml_api_reply version="1">

		<pretty_symbol data="AAPL"/>
		<symbol_lookup_url data="/finance?client=ig&q=AAPL"/>

		<exchange_timezone data="ET"/>
		<exchange_utc_offset data="+05:00"/>
		<exchange_closing data="960"/>

		<avg_volume data="25140"/>
		<market_cap data="535126.61"/>

		<y_close data="568.18"/>

		<perc_change data="0.72"/>
		<trade_timestamp data="40 seconds ago"/>
		<trade_date_utc data="20120509"/>
		<trade_time_utc data="161528"/>
		<current_date_utc data="20120509"/>
		<current_time_utc data="161608"/>
		<symbol_url data="/finance?client=ig&q=AAPL"/>
		<chart_url data="/finance/chart?q=NASDAQ:AAPL&tlf=12"/>
		<disclaimer_url data="/help/stock_disclaimer.html"/>
		<ecn_url data=""/>
		<isld_last data=""/>
		<isld_trade_date_utc data=""/>
		<isld_trade_time_utc data=""/>
		<brut_last data=""/>
		<brut_trade_date_utc data=""/>
		<brut_trade_time_utc data=""/>
		<daylight_savings data="true"/>

		<pretty_symbol data="GOOG"/>
		<symbol_lookup_url data="/finance?client=ig&q=GOOG"/>

		<exchange_timezone data="ET"/>
		<exchange_utc_offset data="+05:00"/>
		<exchange_closing data="960"/>

		<avg_volume data="2668"/>
		<market_cap data="199486.59"/>

		<y_close data="612.79"/>

		<perc_change data="-0.14"/>
		<trade_timestamp data="1 minute ago"/>
		<trade_date_utc data="20120509"/>
		<trade_time_utc data="161455"/>
		<current_date_utc data="20120509"/>
		<current_time_utc data="161608"/>
		<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=""/>
		<isld_trade_date_utc data=""/>
		<isld_trade_time_utc data=""/>
		<brut_last data=""/>
		<brut_trade_date_utc data=""/>
		<brut_trade_time_utc data=""/>
		<daylight_savings data="true"/>

Example: http://www.google.com/ig/api?stock=AAPL&stock=GOOG


ASP.NET Example

Here is a quick example of using the Google Stock API with your ASP.NET C# apps. This example has only a single page and a quick form. You enter the stock symbol into the box and click the button and it will return the details via the Google Stock API.

Default.aspx ASP.NET Code

<%@ Page Title="Home Page" Language="C#"  AutoEventWireup="true"     CodeBehind="Default.aspx.cs" Inherits="GoogleStockApi.Default" %></pre>
<form id="getQuote">
<h1>Stock Quote Service</h1>

<div>Company: <%=Company %></div>
<div>Company: <%=Exchange %></div>
<div>High: <%=High %></div>
<div>Low: <%=Low %></div>
<div>Last: <%=Last %></div>

Default.aspx.cs C# Code

using System;
using System.Web.UI;
using System.Xml.Linq;

namespace GoogleStockApi
    public partial class Default : Page
        public string Company { get; set; }
        public string Exchange { get; set; }
        public double Last { get; set; }
        public double High { get; set; }
        public double Low { get; set; }

        protected void Page_Load(object sender, EventArgs e)
            if (Request.Form["symbol"] != null)
                string symbol = Request.Form["symbol"];

        private void FetchQuote(string symbol)
            string url = "http://www.google.com/ig/api?stock=" + Server.UrlEncode(symbol);
            XDocument doc = XDocument.Load(url);
            Company = GetData(doc, "company");
            Exchange = GetData(doc, "exchange");
            Last = Convert.ToDouble(GetData(doc, "last"));
            High = Convert.ToDouble(GetData(doc, "high"));
            Low = Convert.ToDouble(GetData(doc, "low"));

        private string GetData(XDocument doc, string name)
            return doc.Root.Element("finance").Element(name).Attribute("data").Value;


Categories:   Finance


  • Posted: January 11, 2011 22:15


    Thanks for this, very helpful. I was looking at easy ways to use Google's Finance API!
  • Posted: January 17, 2011 08:00

    How to parse Google Finance in PHP « Simon Irmančnik

    [...] on. In contrast of the stock API, the result isn’t formatted in a pretty XML sequence, it rather uses a custom [...]
  • Posted: January 31, 2011 08:51


    Very helpful info. thanks a lot
  • Posted: February 6, 2011 17:20


    Thanks, simple, and useful!
  • Posted: February 17, 2011 16:18

    Patrick Fisher

    You can get multiple records at a time like so: http://www.google.com/ig/api?stock=AAPL&stock=GOOG
  • Posted: February 17, 2011 21:52

    Anmol Kumar

    Hi, I was looking for this only. But How can I get stock list of an exchange? In Query string how can I pass exchange name? Please suggest. Regards, Anmol Kumar kr.anmol@gmail.com
  • Posted: March 8, 2011 05:05


    Hi, Could you guide , how i can retrieve the AAPL stock details using google in PHP. Thank you
  • Posted: March 14, 2011 08:03

    Krishnapratap Vedula

    Hello Kelias, 1. I want to retrieve NSE 50 stocks data from Google Finance in my ASP.NET Web Service & use it in Silverlight 4 Ticker made by me. Till now am using Yahoo Finance data but it is delayed & many times retrieves data as zero which is not possible. 2. I want to retrieve World Indices from Google Finance. 3. How can I retrieve Nifty 50 & World Indices data as Web Service in ASP.NET 4 & Silverlight 4? Kindly, help me with it. I tried to retrieve stock details with this URL http://www.google.com/ig/api?stock=NSE:ACC but nor showing any data in XML while this URL http://www.google.com/finance?q=NSE%3AACC%2C+NSE%3ABHEL shows data on the page but don't know how to retrieve it in ASP.NET 4 & Silverlight 4 web app. Thanks. Best Regards, Krishnapratap Vedula
  • Posted: May 27, 2011 07:17


    Thanks so much for this, very helpful for some jquery I was working on!
  • Posted: June 3, 2011 09:21


    does this give you real time data?
  • Posted: July 2, 2011 14:47


    hi. good info. You can get the same kind of xml from yahoo but with much more information. try this: http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22bdt.l%22%29&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys. they pulled the info out of the yahoo api (you can not find it documented anymore) was just lucky to get it a couple of weeks before.
  • Posted: July 2, 2011 14:49


    you can change the bdt.l (it's a symbol that will work with google finance but not with yahoo finance) to any other you may like. aapl, msft,.... what ever
  • Posted: July 4, 2011 04:01


    How to use jsp and servlet to rewrite this program?
  • Posted: October 24, 2011 02:42


    Hi, first of all thanks for such a wonderful article here. It is so simple to understand. Can you also guide us to get stock exchange value? for example. BSE value, NSE value etc. Till now, every thing is for stock value, not stock exchange value. thanks in advance, Harsh
    • Posted: October 24, 2011 08:45


      If I understand correctly your looking to get the price of the index such as the Dow Jones Industrial Average? If so you just need to pass the correct ticker in like so: http://www.google.com/ig/api?stock=DJI
  • Posted: October 27, 2011 07:24

    Adnan latif

    This info very helpful can anybody please tell me that how to get current stock price in this xml we get low,high and last i want to get current stock price for a ticker. thanks
  • Posted: December 2, 2011 21:52


    Does anybody know how to get data from Google Fiance API for stock market indexes such as Dow Jones, S&P 500, London's FTSE, Paris CAC, Frankfurt DAX, etc?
  • Posted: December 3, 2011 17:06


    Anyone know if there are any special tags we can use in the URL to specify the data that is received??
  • Posted: December 14, 2011 21:19

    kamlendra kumar

    I was just looking for this onr and will congrats you for such a wonderful article. though this retrieves not only american stocks quote it retrieves world wide stock quote perhaps, there comes problem to retrieve some of those stocks which symbols are same in NYSE and other country's stock symbol such as ACC, HCC, INFY, ITC of NSE of india. I"ve tried it to retrieve using nse:acc this also not works. there is a kind request do you have any solution of this problem? if yes please suggest us. thanks for such wonderful article...
  • Posted: January 11, 2012 00:25


    Can I use google API to feed data in commercial application. They say you need to take written permission. How do I do that
  • Posted: January 31, 2012 23:57

    Sagar Patel

    Thanks so much. It was very helpful. can u tell me how can i get historic data. I want to use it for making graphs in my application. thanks....
    • Posted: February 1, 2012 08:04


      I have an article that shows how to get historical stock data from Yahoo and it includes a class to parse the results: http://www.jarloo.com/get-historical-stock-data/ Hope this helps.
  • Posted: February 9, 2012 15:16


    @SUCHIGEORGE For PHP I use xpath (if you're using v5+). Here an example code. ? $xml = simplexml_load_file('http://www.google.com/ig/api?stock=AAPL'); $finance = $xml->xpath("/xml_api_reply/finance"); ? ?= $finance[0]->temp_f['data'];? ?= $finance[0]->condition['data'];?
  • Posted: February 9, 2012 15:20


    @SUCHIGEORGE Sorry, forgot to change the code that I use with google's weather api. ? $xml = simplexml_load_file('http://www.google.com/ig/api?stock=AAPL'); $finance = $xml->xpath("/xml_api_reply/finance"); ? ?= $finance[0]->symbol['data'];? ?= $finance[0]->last['data'];? FYI: The question marks are either preceded or followed by a
  • Posted: February 13, 2012 04:28

    Sagar Patel

    Thanx guys, I tried this But I have a problem that in my case there is same name for multiple roots in xml file and i want price from each stock. U can check here i don't how to differentiate between two Finance roots. please help to sort this out. Thanks so much....
    • Posted: February 13, 2012 10:06


      You just need to loop through the two roots. There will be a collection of "finance" Elements. Here is a quick LINQ example of iterating them and return the results.
      XDocument doc = XDocument.Load("http://www.google.com/ig/api?stock=goog&stock=aapl");
      var data = from e in doc.Root.Elements("finance")
          select new
      			Symbol = e.Element("symbol").Attribute("data").Value,
      			Last = Convert.ToDecimal(e.Element("last").Attribute("data").Value),
      			High = Convert.ToDecimal(e.Element("high").Attribute("data").Value),
      			Low = Convert.ToDecimal(e.Element("low").Attribute("data").Value),
      			Open = Convert.ToDecimal(e.Element("open").Attribute("data").Value)
      foreach (var price in data)
  • Posted: February 18, 2012 11:20

    Sagar Patel

    Thanks So much.. It worked.. Can u please tell me how can i get real time data because this data refreshes after 3-4 minutes and 8-10 minutes in some company's cases.. I think Google refreshes maximum every minute though it's Late. Then why it is not reflecting in their APIs.... Thanks for your guidance....
  • Posted: February 29, 2012 11:08


    Can this URLs be used commercially for free ?
    • Posted: February 29, 2012 12:18


      I wouldn't suggest using it commercially. This is an UNOFFICIAL API, so there is no guarantee it will even be around tomorrow.
  • Posted: March 11, 2012 00:46

    Wayne D

    There is also a way of downloading historical data from Google using another undocumented approach. I found this link useful (http://www.codeproject.com/Articles/221952/Simple-Csharp-DLL-to-download-data-from-Google-Fin) This does have the advantage of allowing you to download data from many different exchanges (which you can't do with Yahoo and some methods using Google). However, there is a problem with the approach... Unlike Yahoo, Google doesn't include the Adjusted price. This can make for some very crazy numbers when there's a stock split. My gutt is telling me that the best approach for getting all the information one may want will involve a combination of approaches.
  • Posted: April 1, 2012 03:55


    How to calculate 2 years avearge return on a stock
  • Posted: May 2, 2012 09:03


    This api is not updated in real time. if you watch it closely it updates every 2 minutes. If you catch it at the exact moment of the update, then it's real time, otherwise it can be delayed up to 120 seconds. Still very useful for data mining.
  • Posted: May 3, 2012 09:49


    For those looking to get Index info like The Dow, simply use a period in front of the symbol... i.e. .dji Works great EXCEPT, fo some reason, this data is 15 minutes delayed. Unlike the stock date which is much more real time...
  • Posted: May 6, 2012 06:19


    Dla listy okolo 2500 symboli serwis smigal ok. Po takiej porcji chcialem zapuscic proces na nowo ale dostaje The remote server returned an error: (503) Server Unavailable. :) Od czasu do czasu pojawia sie Captcha na stronce przed wyswietleniem xml-a (jesli wiecie o co mi chodzi) :) Jakies pomysly na obejscie error code: 503?
    • Posted: May 6, 2012 07:15


      I don't get a 503 error when I try it. Perhaps Google had some maintenance or something when you ran? If I try http://www.google.com/ig/api?stock=AAPL it works fine.
  • Posted: May 17, 2012 21:03


    This is good example but has one defect; Example , I want get IBM of London but respond IBM of Newyork. It is not enough only stock symbol, needs market name. How to get IBM of London. Help me.
  • Posted: June 14, 2012 07:26

    Joe C

    Hi All, thanks for this great thread. I am a Business Systems Analyst so not very familiar with XML but trying to use this code in a SharePoint 2010 XML viewer web part. Is that possible? I don't see any absolute path to the source data within the XML that would tell it to go to Google. and I am struggling with the corresponding .xslt Any thoughts on how I could achieve this? Thanks
    • Posted: June 14, 2012 10:00


      Sorry but I haven't worked with SharePoint in years.
  • Posted: July 15, 2012 03:26

    由SSIS取得WebService資訊並更新至DB | 不認真寫部落格

    [...] 2. Kelly Elias – Google Stock API [...]
  • Posted: July 30, 2012 23:06

    由google stock API製作自己的股票報價單 | TDN Blog

    [...] Jarloo [...]
  • Posted: August 29, 2012 09:56


    So... *IS* the Google Stock API the same thing (or subsection) as the Google Finance API? ie - is the Stock API going to disappear in October (2012) along with all the Finance API?
  • Posted: September 12, 2012 03:01


    How to get the API for NSE: LT
  • Posted: September 25, 2012 04:47

    shahid iqbal

    Will this stock api of google will also be Deprecated as the google finance api… Any body having an idea about this pls answer… thanks in advance
  • Posted: November 23, 2012 06:10

    Abdelrahaman Aly

    Hey can i have historic data with the service???
  • Posted: January 3, 2013 21:09


    i tried to consume this web service via ADF mobile. Using http://www.google.com/ig/api?stock=AAPL gives a response as unable to connect to www.google.com at port: xx : java.net.connectException:Connection Timed Out.. may be my question is not very related to you, but it would be great if you could help me on this.
  • Posted: January 28, 2013 02:23

    Arpit Makhiyaviya

    please anyone teli me how to get the symbols of shares ?
  • Posted: February 3, 2013 01:10


    The issue with getting data from Yahoo or Google is that any web service they provide is for "personal use only". Therefore, publishing on a commercial site or app could be considered a violation of their terms of service. It's fine for a blog or something but once you get a little more usage, it just isn't enough. Anyway, I've been using FinancialContent's XML API for my iOS application and it works great. The sales rep Stephen there enlightened me on the intellectual property issues. Xignite is another good provider that I've used.
  • Posted: August 26, 2013 19:01


    Hi, How can I return a stock that list in ASX exchange ? The stock I want has symbol "CDI“ which stands for Challenger Diversified Property Group which referring to CDI Corp, but the API only return the one in NYSE.
  • Posted: September 5, 2013 02:29


    I also have the problem of not being able to specify the exchange. I want to look at LON:CEY, but it does not always return the LON figures. Problem is when two stocks, on two different exchanges, have the same symbol. Any ideas on how you can get around this? Thanks.
  • Posted: October 5, 2013 18:40

    Rob M.

    I am led to believe that support for this API will cease to function on Nov 1st, 2013. Functionality that represents the migration of this API lies within Google App Scripts using the Google App Engine. I have searched for apps that provide a similar level of XML stock quotes, and as of yet have been unsucceful. Do you have any clue as to where and/or what url supports a similar REST API as you have outlined here? Any feedback would be appreciated.
  • Posted: January 14, 2014 01:52


    How to get the list of stock exchanges name of different country using Finance api, How can i get it using asp.net?
  • Posted: January 14, 2014 01:53


    How to get the list of stock exchanges name of different country using Finance api, How can i get it using asp.net? Please help
  • Posted: January 31, 2014 00:56


    can u please help me how can i fetch NSE quotes i.e. NIFTY in my website using php and ajax. I am able to fetch ftse and n225 but just go through many pages and codes but i am not able to do that.
  • Posted: February 4, 2014 09:34


    This doesn't appear to work anymore, redirects to Google's homepage :( Apparently the Yahoo API might be the best option available...
  • Posted: February 8, 2014 22:44


    the api http://www.google.com/ig/api?stock=AAPL is no longer availble...so i suggest admin to remove this page...
  • Posted: February 9, 2014 15:22

    Rob M.

    As I noted earlier, the support for iGoogle, of which this API is a part of, ceased to function on the date I stipulated. I have written a Google App Script which replicates this API. However, due to the new restrictions placed on the Finance API by Google's data providers, the quota keeps you from obtaining the entire market data throughout the day. As a matter of fact, the restrictions prohibit a single user from getting a single read of the entire market in one day. Therefore, to use a Google App Script, which utilizes the same Finance API referenced here, a user MUST work from a watchlist not exceeding 25 symbols retrieved not more than 78 times a day (that's once every five minutes) . Those 25 symbols may change throughout the day, but I have run into the dreaded "daily quota exceeded" message many times. I am not sure what the exact quotas are, but they are enough to make using this API not very feasible. As with everything, there are always workarounds. The simplest being a group of users working together, each with their own copy of the script on Google App Script and pooling the quotes from the different symbols into a shared resource that can referenced by everyone in the group/investing club. Finally, it should be noted that the quota resets itself every night. Last question to think about, whoever can afford to trade more than 25 different stocks a day can afford to pay for the stock data (Google may not be the cheapest place to do that).
  • Posted: February 15, 2014 02:46


    i Have Error 'doctype' is an unexpected token. The expected token is 'DOCTYPE'. Line 1, position 3.