5

我正在尝试使用 YQL 从雅虎获取股票期权链。我在 YQL 控制台中试过这个命令:

select * from yahoo.finance.options

但是,我收到此错误 XML:

<?xml version="1.0" encoding="UTF-8"?>
<error xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:lang="en-US">
    <diagnostics>
        <publiclyCallable>true</publiclyCallable>
    </diagnostics> 
    <description>No definition found for Table yahoo.finance.options</description>
</error>

看起来这个表已经不存在了。有谁知道正确的表是什么?

4

4 回答 4

3

您必须至少提供一个where clause才能使此查询正常工作。像这样:

select * from yahoo.finance.options where  symbol='MMM'

或者,

select * from yahoo.finance.options where  symbol='A'

或者,

select * from yahoo.finance.options where  symbol='YHOO'

All the above queries work fine. If you want more specific data then you have to provide more conditions to filter out your desired data out of the whole data.

于 2012-10-18T14:14:44.947 回答
1

yahoo.finance.options 是一个社区表。要阅读有关社区表的信息,请查看此处。从我刚刚发布的链接中:

为了将 YQL 与社区表一起使用,您必须传入 datatables env 文件。您可以在 YQL 控制台上作为 YQL 语句的一部分执行此操作,或者通过传入查询参数来执行此操作。

可以在这里找到用于测试的 YQL 控制台

于 2012-10-08T17:26:40.510 回答
1

Something I just figured out today is that you can just use this to get the option data from yahoo

https://query2.finance.yahoo.com/v7/finance/options/SPXS?straddle=true
于 2017-01-05T06:54:37.080 回答
0

Since the middle of 2014 YQL has the problem, so the option chain from yahoo.finance with scraping could be get by the following codes with: Python and Matlab

于 2015-04-09T21:35:03.050 回答