yql Web 服务是否有记录的已知方式截断数据请求?
我正在研究股市日终供稿。我在一个请求中传递多个股票代码。大约 400 左右时,我收到一个错误,指出字符串太长。但任何低于这个值的东西都可以正常运行,但返回的符号比我要求的要少。我收到了我请求的大约 30-36% 的符号。更重要的是,我发送多少并不重要……如果我发送 100,我会收到 36;如果我发送 100,我会收到 36。如果我发送 10,我会得到 3。
有谁知道该服务器返回/实现的数据的格式,或者我可以找到的方法吗?只要我能可靠地理解它,我就可以以任何形式使用它。这是一个带有一个符号“A”的示例字符串:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22A%22%2C%22A%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
任何其他有助于理解 yql 表/数据源的实现的帮助都会很棒。
编辑:
我应该提到,低于预期的计数是在解析返回的 xml 之后,过滤掉关键子元素(例如“LastTradeDate”和“symbol”)具有空值的元素。
I'm working with the stock market end of day feed. I pass multiple ticker symbols in one request. Around 400 or so I get an error that the string is too long. But anything less than that runs fine, but returns less symbols than I requested. I get back about 30-36% of the symbols I request. The kicker is that it doesn't matter how many I send... if I send 100, I get 36; if I send 10, I get 3.
Does anyone know the formatting of data returned/ implemented by that server, or a way I can find out? I'm fine to work with it in whatever form it takes, as long as I reliably understand it. Here's a sample string with one symbol "A":
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22A%22%2C%22A%22)&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys
Any other help in understanding the implementations of yql tables/ data sources would be great.
Edit:
I should mention that the lower than expected count is after parsing the xml returned, filtering out elements that have null values for key child elements such as "LastTradeDate" and "symbol."
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的问题确实出在我传递的查询字符串中。我在代码中对数据请求进行了日期处理,并且仅返回最新的交易日期数据点。所以显然我需要运行一个单独的过程来查询历史价格。感谢您的帮助。
供将来参考:yahoo.finance.quotes 仅返回最近交易日的数据。yahoo.finance.historicaldata 可以按日期查询。
My problem was indeed in the query string I was passing. I date requests in my code for data, and only the latest trading date data points were being returned. So apparently I need to run a separate procedure to query historical prices. Thanks for the help.
For future reference: yahoo.finance.quotes returns only the data from the latest trading day.. yahoo.finance.historicaldata can be queried by date.