YQL 财务数据不可用

发布于 2024-10-07 13:51:38 字数 305 浏览 4 评论 0原文

我已经为此工作了一个星期,但无法从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

夏夜暖风 2024-10-14 13:51:38

YQL 绝对适用于股票报价。您必须将以下字符串附加到查询中:

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

完整查询是:

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

要从 YQL 查询获取完整查询 URL:

  • 浏览到 雅虎 YQL 查询控制台
  • 创建一个查询,例如 select * from yahoo.finance.quotes where symbol in ("MSFT")
  • 复制“The Rest Query”下的完整 URL。这适用于任何浏览器(或使用 YQL 的桌面应用程序)。

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).
毅然前行 2024-10-14 13:51:38

似乎表 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.

温柔戏命师 2024-10-14 13:51:38

您为什么不尝试使用财务报价 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

无声情话 2024-10-14 13:51:38

不幸的是,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.

洒一地阳光 2024-10-14 13:51:38

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文