Is it possible to get ALL results in a SELECT statement using the YQL without specifying a where clause.
For example, this block of code will give me stock information for these companies:
SELECT * FROM yahoo.finance.quotes WHERE symbol in ('YHOO','AAPL','GOOG','MSFT')
But, I am wanting an entire list of every single stock in the Yahoo database (something like this)
SELECT * FROM yahoo.finance.quotes
Why is this not working? When I do it in YQL console(https://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys), it tells me 'Cannot find required keys in where clause; expecting required keys: (symbol)'. Do I always have to use a where clause? If this is the case, then this doesn't seem very useful. If anybody knows a way to get all the stocks without a clause, I'd greatly appreciate some help.
Related
I am trying to generate a continuous query in influxDB. The query is to fetch the hits per second by doing (1/response time) of the value which i am already getting for another series (say series1).
Here is the query:
select (1000/value) as value from series1 group by time(1s) into api.HPS;
My problem is that the query "select (1000/value) as value from series1 group by time(1s)" works fine and provide me results but as soon as I store the result into continuous query, it starts to give me parse error.
Please help.
Hard to give any concrete advice without the actual parse error returned and perhaps the relevant log lines. Try providing those to the mailing list at influxdb#googlegroups.com or email them to support#influxdb.com.
There's an email on the Google Group that might be relevant, too. https://groups.google.com/d/msgid/influxdb/c99217b3-fdab-4684-b656-a5f5509ed070%40googlegroups.com
Have you tried using whitespace between the values and the operator? E.g. select (1000 / value) AS value....
I have been trying to use YQL to access the fundamentals of listed companies. But what is showing up in the Yahoo finance page is not being returned from YQL queries. Specifically I need to retrieve data from balance sheet and income statement, a sample query for Apple in YQL is like:
SELECT * FROM yahoo.finance.balancesheet WHERE symbol='AAPL'
This, however, only returns a time frame (quarterly), and nothing else.
Link to YQL console of my sample query is here
Is the data inaccessible to YQL or is there anything wrong with the way I am running the query? How can I get a complete list of data as in http://finance.yahoo.com/q/bs?s=AAPL through YQL?
Your query used to work fine. However, a month or two ago, a number of yahoo.finance YQL "tables" stopped working.
IOW, you are doing it right, but YQL is broken.
If you mouse over the yahoo.finance.balancesheet entry in the left column of the YQL console, buttons labeled desc and src appear. If you click src, it fetches the scraping code for you: http://www.datatables.org/yahoo/finance/yahoo.finance.balancesheet.xml. To make the E4X JavaScript legible, right-click and select View Source or use wget or curl from the command line.
Notice that the code fetches http://finance.yahoo.com/q/bs?s=AAPL&quarterly and then uses an XPath query to find the data:
var query = y.xpath(rawresult, "//table[#class='yfnc_tabledata1']/tr/td/table/tr");
If you fetch the page into your browser and inspect the HTML, you find that there is indeed a table with class yfnc_tabledata1. However, it has no tr direct child. Apparently, Yahoo must have decided to add a tbody element. That probably explains why the query no longer scrapes any data.
The code page lists Ryan Hoium as the author. A little googling leads to the github repository where the code lives, alongside the code for the other Yahoo Finance tables.
Sadly, only the yahoo.finance.sectors table has received recent attention. The change was to add double slashes to its XPath expression. Double-slashes relax the "direct child" requirement, allowing, for example, tr to still be found even if there is an intervening tbody. However, it appears the new version has not been pushed out to the public site.
I am working on a small widget for my projects which basically looks like this. Futures for Yahoo Finance
How can I get the data for Natural Gas, Gasoline, Crude Oil, Heating Oil and their Change?. I want to retrieve those data via json maybe and create a box widget or a ticker. The Image attached is what I am trying to make. Thank you.
PS: I tried CLJ15.NYM Symbol for Crude Oil using yahoo.finance.quotes table in the YQL Console, but it did not work.
You can type the symbol in the same way you would type in a stock. Getting data from Yahoo Finance provides you with a good example of how to use stock symbols with yql.
For those exact 4, it would look like this:
select * from yahoo.finance.quote where symbol in ("CLK15.NYM", "HOK15.NYM", "NGK15.NYM", "RBK15.NYM")
Note: you can use yahoo.finance.quote or yahoo.finance.quotes
we are very interested to use YQL but unfortunately the query is not supported for Indian stock market , we are building one large web app where wee need to show BSE and NSE tickers with live updates , so we thought to use yahoo financial services but I have tried a lot in the console the below line but this is return with zero data
select * from yahoo.finance.quotes where symbol IN("^BSESN")
For that result we can't able to use yql , I have also change the symbol ^BSESN with other Indian company names like reliance ,tata but nothing is shown, feeling very poor......
select * from yahoo.finance.quotes where symbol IN("^BSESN") ---- not working any idea or suggestion will helpful to me
Thanks in advance
Yahoo's YQL shows uneven performance for bourses outside the West. For example:
You can obtain historical data for Reliance Industries from yahoo.finance.historicaldata using YQL as follows: select * from yahoo.finance.historicaldata where symbol in ('RIL.BO')
You cannot get stock quote from yahoo.finance.quotes using YQL as follows: select * from yahoo.finance.quotes where symbol in ("RIL.BO")
Try it!
I found out about YQL and would like to use it to get a list of financial sectors. I went to the YQL console and tried to use the yahoo.finance.sectors table:
select * from yahoo.finance.sectors
The results are "null". I'm assuming the data is available. What is wrong with the way I'm calling YQL?