Question

I have been working on this for a week now and can't get certin data from YQL console. I am trying to get the Change of an exchange rate. It seems to work on Yahoo here, http://uk.finance.yahoo.com/q?s=GBPUSD=X, but not here, select * from yahoo.finance.quotes where symbol in ("GBPUSD=X")

Anyone have any solutions?

Was it helpful?

Solution

The API only returns the currency spot price and the "top of book" quotes. I use quotes cause you are talking about forex and it can be hard to know the true top of book price. Since their API does not show you change you will have to poll the service and compute the change on you side.

OTHER TIPS

YQL definitely works with stock quotes. You have to append the following string to the query:

&diagnostics=true&env=http%3A%2F%2Fdatatables.org%2Falltables.env

The full query is:

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22MSFT%22%29&diagnostics=true&env=http%3A%2F%2Fdatatables.org%2Falltables.env

To obtain a full query URL from a YQL query:

  • Browse to the Yahoo YQL query console.
  • Create a query, e.g. select * from yahoo.finance.quotes where symbol in ("MSFT")
  • Copy the full URL under "The Rest Query". This will work in any browser (or desktop app that uses YQL).

It seems like that the table yahoo.finance.quotes does not exist anymore. I was able to query stock quotes using 'select * from yahoo.finance.quotes where symbol in ("YHOO", "MSFT")'. I can't do that anymore now.

Why don't you try using the finance quotes API. Here is a sample to get a quote:

http://download.finance.yahoo.com/d/quotes.txt?s=GBPUSD=X&f=snd1l1yr

More info at http://www.gummy-stuff.org/Yahoo-data.htm

Unfortunatly, the CSV approach doesn't always work. Some values, e.g. ask size, is returned with commas in the value itself if it is over a 1000, i.e.for 12345, the CSV will contain 12,345. and since you can't change the delimiter, it's very difficult to parse. YQL is definatly the better approach. I can't, however, find the currency of the quote.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top