我试图从雅虎金融检索期权数据使用YQL。非常奇怪的问题是,我可以为其他符号下载所需的选项数据,比如AAPL (Apple)和MSFT (微软),而不是谷歌(Google)。
这是我的查询和结果。显然,我可以检索AAPL和MSFT的数据,但是GOOG不见了。这不仅适用于yahoo.finance.option_contracts,也适用于所有其他与选项相关的表,包括yahoo.finance.options。我很肯定这与查询限制无关,因为下面显示的查询只会检索不到10个GOOG的结果。
select * from yahoo.finance.option_contracts where symbol in ( 'GOOG', 'AAPL', 'MSFT')
{
"query": {
"count": 2,
"created": "2014-03-03T15:00:45Z",
"lang": "en-US",
"diagnostics": {
"url": [
{
"execution-start-time": "0",
"execution-stop-time": "1",
"execution-time": "1",
"content": "http://www.datatables.org/yahoo/finance/yahoo.finance.option_contracts.xml"
},
{
"execution-start-time": "4",
"execution-stop-time": "1057",
"execution-time": "1053",
"content": "http://finance.yahoo.com/q/op?s=MSFT"
},
{
"execution-start-time": "5",
"execution-stop-time": "3571",
"execution-time": "3566",
"content": "http://finance.yahoo.com/q/op?s=AAPL"
},
{
"error": "Connect Failure",
"execution-start-time": "5",
"execution-stop-time": "10017",
"execution-time": "10012",
"content": "http://finance.yahoo.com/q/op?s=GOOG"
},
{
"error": "Connect Failure",
"execution-start-time": "5",
"execution-stop-time": "10017",
"execution-time": "10012",
"content": "http://finance.yahoo.com/q/op?s=GOOG"
}
],
"publiclyCallable": "true",
"javascript": [
{
"execution-start-time": "3",
"execution-stop-time": "1074",
"execution-time": "1070",
"instructions-used": "18571",
"table-name": "yahoo.finance.option_contracts"
},
{
"execution-start-time": "3",
"execution-stop-time": "3616",
"execution-time": "3612",
"instructions-used": "31142",
"table-name": "yahoo.finance.option_contracts"
},
"Exception: Read timed out, url: http://finance.yahoo.com/q/op?s=GOOG",
{
"execution-start-time": "3",
"execution-stop-time": "10017",
"execution-time": "10013",
"instructions-used": "31142",
"table-name": "yahoo.finance.option_contracts"
}
],
"user-time": "10018",
"service-time": "19447",
"build-version": "0.2.2157"
},
"results": {
"option": [
{
"symbol": "AAPL",
"contract": [
"2014-03",
"2014-04",
"2014-05",
"2014-06",
"2014-07",
"2014-10",
"2015-01",
"2016-01"
]
},
{
"symbol": "MSFT",
"contract": [
"2014-03",
"2014-04",
"2014-05",
"2014-06",
"2014-07",
"2014-10",
"2015-01",
"2016-01"
]
}
]
}
}
}总之,每次我试图检索GOOG的选项数据时,我只会得到“读取超时”错误的空结果。对于其他选项符号,如AAPL和MSFT,我得到了我想要的。
有人知道为什么会这样吗?
发布于 2014-08-29 23:34:04
这肯定与谷歌( Google )有关,谷歌在谷歌()和谷歌()的两个标签(见http://finance.yahoo.com/news/google-trades-under-2-tickers-225300863.html)下交易:谷歌和谷歌。
YQL不承认谷歌,但将接受新的代号GOOGL。我怀疑YQL查询错误是因为在寻找GOOG时意外地得到了两个代码,而不是一个。
如果你要求谷歌( GOOG )提供雅虎金融( Yahoo!Finance )的报价,这是可行的。
https://stackoverflow.com/questions/22150029
复制相似问题