Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to differentiate between stock symbols with same name in Google stock API

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?

like image 640
Rockstart Avatar asked Nov 11 '22 19:11

Rockstart


1 Answers

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" } ] 
like image 62
Andy Avatar answered Nov 15 '22 07:11

Andy