如何使用历史数据访问Yahoo Finance YQL查询 [英] How to Access Yahoo Finance YQL query with historical data

查看:359
本文介绍了如何使用历史数据访问Yahoo Finance YQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是YQL的新手.也许这是非常琐碎的,但是我无法弄清楚.我知道,例如,如何使用YQL控制台从Yahoo/YQL查询当前的股票数据:

http://developer.yahoo.com/yql/console/

查询字符串:

select * from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT") 

但是,如果我想说昨天或一周前的相同数据怎么办?我尝试过诸如

select * from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT") and date=20120913

但是它似乎不起作用.

任何建议都值得赞赏!

解决方案

您使用了错误的表格.

select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2009-09-11" and endDate = "2010-03-10"

或者,您可以为此使用 stockretriever.py .在源代码中,您可以找到历史数据的解决方法. /p>

I'm new to YQL. Perhaps this is very trivial, but I couldn't quite figure this out. I know, for instance, how to query current stock data from Yahoo/YQL using the YQL console:

http://developer.yahoo.com/yql/console/

with the query string:

select * from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT") 

However, what if I want, say, the same data from yesterday, or a week ago? I tried things such as

select * from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT") and date=20120913

But it doesn't appear to work.

Any suggestion is appreciated!

解决方案

You're using the wrong table.

select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2009-09-11" and endDate = "2010-03-10"

Alternatively, you could use stockretriever.py for this. In the source code, you can find a workaround for historical data.

这篇关于如何使用历史数据访问Yahoo Finance YQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆