【问题标题】:How to get yahoo finance stock data?如何获取雅虎财经的股票数据?
【发布时间】:2015-06-11 18:12:49
【问题描述】:

我在 deevloper.yahoo.com 和 yql 控制台 https://developer.yahoo.com/yql/console 上创建了 API。

勾选显示社区表并搜索财务。

我得到了股票数据的结果。这里我得到了 josn 和 xml 格式的历史数据的准确数据。

历史数据链接 yahoo.finance.historicaldata。

就像我得到了所有数据

http://finance.yahoo.com/q/hp?s=AAPL+Historical+Prices 这个股票的其余查询是

yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20%3D%20%22YHOO%22%20and%20startDate%20%3D%20%222009-09-11%22%20and%20endDate%20%3D%20%222010-03-10%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=

当我尝试其他股票如 yahoo.finance.balancesheet 和其他股票时

我看到我在 url 中发送的参数是错误的,特别是在其他股票期权的条件下

谁能说出其他股票期权的确切网址是什么?

【问题讨论】:

    标签: yahoo-finance


    【解决方案1】:

    你似乎想要的是:

    https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2009-09-11" and endDate = "2010-03-10"&format=json&diagnostics=true&env=store://datatables.org/alltableswithkeys&callback=
    

    您可以将该 URL 提供给例如wget,它会返回一个 JSON 数据块。

    我从哪里得到那个网址?我启动YQL Console 并选中显示社区表。接下来,我输入了您的查询(上面的 q 参数)并收到返回的有效 JSON。最后,我走到页面底部,那里以绿色显示 THE REST QUERY,然后直接复制了 URL。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-06
      • 1970-01-01
      相关资源
      最近更新 更多