Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get stock quotes as JSON from Yahoo Finance with Start and End dates

I have been attempting to get a stock quote history from a specific symbol (BHP.AX) with a specific start and end date.

Here is my attempted query:

select * from yahoo.finance.quotes where symbol in ("BHP.AX") and startDate = "2014-01-01" and endDate = "2014-06-16"

I was testing it in the YQL console here: https://developer.yahoo.com/yql/console/

Am I missing something? Because the console does not seem to be spitting out the correct data.

like image 204
Fizzix Avatar asked Dec 20 '22 14:12

Fizzix


1 Answers

Am I missing something?

Yeah, yahoo.finance.quotes is part of community tables, so to test it out in YQL console, tick the Community tables checkbox.

Your YQL REST URL will be

https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22BHP.AX%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
like image 73
Sathyajith Bhat Avatar answered Dec 24 '22 00:12

Sathyajith Bhat