1

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.

enter image description here

PS: I tried CLJ15.NYM Symbol for Crude Oil using yahoo.finance.quotes table in the YQL Console, but it did not work.

Juni Brosas
  • 1,425
  • 2
  • 14
  • 24

1 Answers1

2

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

Community
  • 1
  • 1
Daniel
  • 2,950
  • 2
  • 25
  • 45
  • I wonder why it did not work last time, but it works checking on your answer. – Juni Brosas Apr 26 '15 at 09:38
  • That link has a lot of confusing stuff in it - like two select statements mixed, and triggers an XXS error. When I go to the Yahoo console, I get this for those selections: https - query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quote%20where%20symbol%20in%20(%22CLK15.NYM%22%2C%20%22HOK15.NYM%22%2C%20%22NGK15.NYM%22%2C%20%22RBK15.NYM%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback= – JosephK May 21 '16 at 11:51
  • And here is the link to console, without the other symbols: https - developer.yahoo.com/yql/console/?q=select%20*%20from%20yahoo.finance.quote%20where%20symbol%20in%20%28%22CLK15.NYM%22%2C%20%22HOK15.NYM%22%2C%20%22NGK15.NYM%22%2C%20%22RBK15.NYM%22%29&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys – JosephK May 21 '16 at 12:00