4

Following is my query using YQL, data is fetched using Yahoo finance, I am using the symbols for the stocks traded on the Indian NSE, BSE

http://query.yahooapis.com/v1/public/yql?q=select  * from yahoo.finance.quotes where 
symbol in ("AIAENG.NS","ATULAUTO.NS")&env=http://datatables.org/alltables.env&format=json

Strange thing is this query always return null data (Invalid data) for all the fields, even when the symbol that I am using is correct and can be used on the Yahoo finance for querying the details. In fact same is for another Indian exchange BSE, with respective symbols AIAENG.BO, ATULAUTO.BO

However if I replace the with US Nasdaq symbols like "YHOO","AAPL","GOOG","MSFT", it works without an issue.

Mrinal Kamboj
  • 11,300
  • 5
  • 40
  • 74
  • Does this answer your question? [Download history stock prices automatically from yahoo finance in python](https://stackoverflow.com/questions/12433076/download-history-stock-prices-automatically-from-yahoo-finance-in-python) – Nad Pat Sep 03 '21 at 17:44

3 Answers3

8

If someone's still looking out, and not satisfied with nsetools (because lack of historical data), here is the latest link I found to be working:

https://query1.finance.yahoo.com/v8/finance/chart/CDSL.NS

Replace CDSL with appropriate symbol.

Sanket Patel
  • 366
  • 2
  • 9
6

If yahoo finance is not your compulsion, then you can use this project.

http://nsetools.readthedocs.org/en/latest/

This is well documented and uses NSE as a data source which is most reliable.

Vivek Jha
  • 1,520
  • 3
  • 16
  • 26
  • thanks, I am not tied to Yahoo, my requirement is for a C# program, which consumes the Json data and use it update an excel sheet of my stick holding. Currently I am using Google Finance, but that's not quite reliable. For using your Python utility, I need to figure out if I can call it from my C# program, as I have never worked with Python. Please let me know if you have some idea – Mrinal Kamboj Jan 04 '15 at 07:09
  • Honestly speaking even I don't know how to call a python program in a c environment. In worst case I would suggest it to write a shell based program using the python utility and then call it through the c. I think c can easily call she'll based programs. But I feel that there must be more elegant way to achieve this. – Vivek Jha Jan 04 '15 at 15:16
  • Huh? If you can run a shell then you can run Python. – tripleee Feb 08 '21 at 07:10
  • it doesn't give historic data – troy_achilies Dec 29 '21 at 00:41
0

Late in the game but adding my response just in case if anybody looking for an easiest way to get the near real time quote(up to 10 tickers) by using Google Finance REST call.

http://finance.google.com/finance/info?q=NSE:AIAENG,NSE:ATULAUTO

And the acronym description can be found here http://qsb-mac-plugins.googlecode.com/svn-history/r4/trunk/stock-quoter/trunk/StockQuoter.py

Senthil
  • 1,499
  • 16
  • 17