【问题标题】:Get Financial Option Data with YQL使用 YQL 获取金融期权数据
【发布时间】:2011-06-22 15:46:51
【问题描述】:

我正在使用 YQL 检索金融期权数据。比如:

select * from yahoo.finance.options where symbol="AAPL" and expiration="2011-07"

但是,上述查询返回optionsChain 的数据。

有没有办法只检索特定选项符号的记录,例如symbol=AAPL110716C00155000?

感谢您的宝贵时间。

【问题讨论】:

    标签: option yql financial


    【解决方案1】:

    除了“远程过滤器”(symbolexpiration)之外,您还可以对从yahoo.finance.options 返回的结果集应用“本地过滤器”,以获得所需的符号。

    select option
    from yahoo.finance.options
    where symbol = "AAPL" 
      and expiration = "2011-07" 
      and option.symbol = "AAPL110716C00155000" 
    

    有关过滤查询结果的更多信息,请参阅 YQL 文档中的 Filtering Query Results (WHERE) 页面。

    【讨论】:

    • YQL 似乎有问题。另一个可以尝试的是 Google 也有一个 Option API。如果有人正在寻找替代方案,我有一个教程:jarloo.com/google-stock-options-api
    • @sala 链接已损坏
    【解决方案2】:

    我刚刚得到了所有 optionsChain 的数据:

    select * from yahoo.finance.options where symbol="A" and expiration="2012-10"
    

    然后,只需使用 JSON Parser 来解析 optionsChain 的数据并得到我想要的数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多