访问共同基金报价
我一直在寻找如何在 C# 中检索金融报价,在本例中是加拿大共同基金。
似乎有两个主要的信息来源,雅虎和谷歌!似乎还有两种首选方法:API 和 HTML 报废。我更喜欢 API 方法,但我愿意接受任何建议。
我发现 Yahoo api 非常好用,但是尽管它适用于“MSFT”等股票,但无法检索“RBCCANADIANI.TO”等共同基金的数据。由于某种原因,该符号仅适用于网站本身。
Google 的 API 似乎需要设置投资组合并登录才能检索报价,我宁愿避免登录并在可能的情况下使用完全开放的 API。
HTML 抓取引入了一系列全新的复杂性,要求用户在 html 页面上找到价格等信息。请注意,Google 的 html (http://www.google.com/finance?q=MUTF_CA:RBF556) 返回正确的页面,但查看 html 源代码会发现价格不是在易于识别的标签中(id 未设置) !)。
有没有人尝试过类似的事情,我感觉我在这里错过了一些东西:)
非常感谢
I have been looking for a while at how to retrieve financial quotes in c#, in this case, Canadian mutual funds.
It seems there are 2 main sources of information for this, Yahoo and Google! Also there seems to be 2 preferred methods, API and HTML scrapping. My preference would be for an API method, but I am open to any suggestion.
I have found the Yahoo api to be very nice to use, however although it works for stocks like "MSFT" it fails to retrieve the data for mutual funds like "RBCCANADIANI.TO". For some reason this symbol only works on the web site itself.
Google's API seems to requires to have a portfolio set up and login in order to retrieve quotes, I would prefer to avoid logins and use a completly opened api if possible.
HTML scraping introduce a totally new set of complications, asking the user to locate on an html page where the price is and such. Note that Google's html (http://www.google.com/finance?q=MUTF_CA:RBF556) returns the right page, but a look at the html source shows that the price is not in an easily identifiable tag (id not set!).
Has anybody tried similar things, I have the feeling I am missing something here :)
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在寻找定价数据,我建议您使用 IQFeed 之类的服务。我已经使用他们作为客户一段时间了,他们确实有共同基金数据(尽管我不使用它)。如果你不想付钱,你可能不得不刮掉它。
If you are looking for pricing data I would suggest a service like IQFeed. I have used them as a client for some time and they do have mutual fund data (although I don't use it). If you don't want to pay for it you will probably have to scrape it.
我成功执行了以下 YQL 查询:
这是针对 Royal Global Precious Metals 基金的。
共同基金有 LastTradePriceOnly 字段,但没有像股票那样的 Bid 字段。我从雅虎财经页面上的符号查找中获取了该符号。
I am having success with the following YQL query:
This is for Royal Global Precious Metals fund.
Mutual funds have a LastTradePriceOnly field but no Bid field like stocks have. I got the symbol from the Symbol Lookup on the Yahoo finance page.