Yahoo Finance API with AJAX

There used to be Yahoo financial webservice where you could get historical stock data. API requests looked like

 http://finance.yahoo.com/webservice/v1/symbols/COALINDIA.NS/quote?format=json

and you got nice REST .json response. But this service has disappeared in middle of 2016. Only thing you get now, is Not a valid parameter response.  Here is stackoverflow question with details.

Nowadays there is Yahoo Query Language (YQL), but the financial API is still undocumented and not officially supported. Query for gathering historical data for AAPL look’s like:

select * from yahoo.finance.historicaldata where symbol = "AAPL" and startDate = "2016-01-01" and endDate = "2017-01-01"

You can try it at YQL Console. Notice that generated link contains env key at the end of THE REST QUERY url. It’s because it is community table you are querying.

...&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=For

If you want to make AJAX request you have to include env in your query like so:

Related Post

Free Better Battery Stats and Time Remaining for M... Better Battery Stats and Time Remaining for Mac OS TL;DR; Do you miss the time remaining indicator on your MacBook, MacBook Air, or MacBook Pro? He...
MacBook wifi issue – OS X keeps reconnecting Last few weeks I was facing annoying wifi problems. My mac was reconnecting every 5 minutes. On top of that BSSID was reseting so I saw BSSID changing...
FAQ: Mac OS X Services HEIC to JPG on Right-Click Service Q: Where’d all my services go? I don’t see anything in the Services menu. A: If you don’t select anything before...
PPTP VPN on MAC OS X Sierra, High Sierra and Mojav... PPTP VPN for Mac OS X Introduction PPTP VPN is no longer supported on macOS Sierra and High Sierra and that is just fine, because there are some se...
Translate Selected Text to English on Right Click ... TL;DR; Need instant translation right in context menu? You can accomplish it for free with one line of code in Automator, or you can proc...
Convert HEIC to PNG on Right Click for Free Convert HEIC to PNG on Right-Click In iOS 11 Apple is replacing the PNG image format with the new HEIC alternative. But what to do when device or pr...
Buy me a coffeeOut of coffee 😱, please help!