YQL 财务数据不可用
我已经为此工作了一个星期,但无法从 YQL 控制台获取某些数据。我正在尝试更改汇率。它似乎在雅虎上工作,http://uk.finance.yahoo.com /q?s=GBPUSD=X,但不是在这里,从 yahoo.finance 选择 *。报价(“GBPUSD=X”)中的符号
有人有任何解决方案吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
YQL 绝对适用于股票报价。您必须将以下字符串附加到查询中:
完整查询是:
要从 YQL 查询获取完整查询 URL:
select * from yahoo.finance.quotes where symbol in ("MSFT")
YQL definitely works with stock quotes. You have to append the following string to the query:
The full query is:
To obtain a full query URL from a YQL query:
select * from yahoo.finance.quotes where symbol in ("MSFT")
似乎表 yahoo.finance.quotes 不再存在。我能够使用“select * from yahoo.finance.quotes where symbol in ("YHOO", "MSFT")”来查询股票报价。我现在不能再这样做了。
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.
您为什么不尝试使用财务报价 API。以下是获取报价的示例:
http: //download.finance.yahoo.com/d/quotes.txt?s=GBPUSD=X&f=snd1l1yr
更多信息请访问 http://www.gummy-stuff.org/Yahoo-data.htm
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
不幸的是,CSV 方法并不总是有效。某些值(例如询问大小)如果超过 1000,则在值本身中以逗号形式返回,即对于 12345,CSV 将包含 12,345。由于无法更改分隔符,因此很难解析。 YQL 绝对是更好的方法。但是,我无法找到报价的货币。
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.
API 仅返回货币现货价格和“账面顶部”报价。我使用报价是因为您正在谈论外汇,并且很难知道图书价格的真实顶部。由于他们的 API 不会显示更改,因此您必须轮询服务并计算您这边的更改。
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.