5

I am using the following Google rest API to get stock data for a given symbol SYMBOL.

https://www.google.com/ig/api?stock=<SYMBOL NAME>

But there are certain symbols like "TCS" which has multiple company names in different parts of the world.eg: TECSYS Ltd in TSE and Tata Consultancy Services iN NSE.

How do I alter the query to get the TCS data in NSE stock Exchange.

Also is there any way to get the list of available symbols from Google?

Rockstart
  • 2,337
  • 5
  • 30
  • 59

2 Answers2

1

This answer is in regard to @Ashwin 's bounty:

The URL provided by @Rockstart is part of Google's deprecated Finance / iGoogle API. It's been deprecated for several years.

However, as of July 2014, there is another method that still works - though it is also part of the deprecated finance API, so it probably won't stick around forever.

The method to get a specific stock is to add the stock exchange's name to the call:

http://www.google.com/finance/info?q=NYSE:TCS

As of the time I posted this answer, this response is returned:

// [ { "id": "348018767532275" ,"t" : "TCS" ,"e" : "NYSE" ,"l" : "20.67" ,
"l_fix" : "20.67" ,"l_cur" : "20.67" ,"s": "0" ,"ltt":"4:01PM EDT" ,
"lt" : "Jul 25, 4:01PM EDT" ,"lt_dts" : "2014-07-25T16:01:16Z" ,
"c" : "-0.33" ,"c_fix" : "-0.33" ,"cp" : "-1.57" ,"cp_fix" : "-1.57" ,
"ccol" : "chr" ,"pcls_fix" : "21" } ] 
Andy
  • 49,085
  • 60
  • 166
  • 233
0

Regarding the second question, you may use

https://www.google.com/finance/match?matchtype=matchall&q=tcs

to get a list of symbols with "TCS" in their name, e.g.

{
  "matches": [
    {
      "t": "TCS",
      "n": "Tata Consultancy Services Limited",
      "e": "NSE",
      "id": "784961"
    },
    {
      "t": "TCS",
      "n": "Container Store Group Inc",
      "e": "NYSE",
      "id": "348018767532275"
    },
    '*snip*...'
  ]
}

And then you may use @Andy's call to get information about a symbol in a specific exchange.

codehead
  • 2,077
  • 16
  • 20