Google 财经 API 出现问题

发布于 2024-08-28 09:33:38 字数 1582 浏览 7 评论 0原文

当我尝试使用 google Finance api 购买股票时,出现异常:

运行:

Enter user ID: ****@gmail.com

Enter user password: ******

Enter transaction type: Buy

Enter transaction date (yyyy-mm-dd): 2010-03-10

Enter number of shares (optional, e.g. 100.0): 

Enter price (optional, e.g. 141.14): 12.0

Enter commission (optional, e.g. 20.0): 23.0

Enter currency (optional, e.g. USD, EUR, JPY): USD

Enter any notes: Notes

Enter portfolio ID: 
1

Enter ticker (EXCHANGE:SYMBOL): 
NASDAQ:INFY

Inserting Entry at location: http://finance.google.com/finance/feeds/default/portfolios/1/positions/NASDAQ:INFY/transactions

The server had a problem handling your request.
com.google.gdata.util.ServiceForbiddenException: Forbidden

Exception message unavailable
        at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:561)
        at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
        at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:536)
        at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:515)
        at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
        at com.google.gdata.client.Service.insert(Service.java:1347)
        at com.google.gdata.client.GoogleService.insert(GoogleService.java:599)
        at financetester.Main.insertTransactionEntry(Main.java:169)
        at financetester.Main.main(Main.java:81)
BUILD SUCCESSFUL (total time: 1 minute 4 seconds)

When i am trying to buy shares using google finance api I am getting an exception:

run:

Enter user ID: ****@gmail.com

Enter user password: ******

Enter transaction type: Buy

Enter transaction date (yyyy-mm-dd): 2010-03-10

Enter number of shares (optional, e.g. 100.0): 

Enter price (optional, e.g. 141.14): 12.0

Enter commission (optional, e.g. 20.0): 23.0

Enter currency (optional, e.g. USD, EUR, JPY): USD

Enter any notes: Notes

Enter portfolio ID: 
1

Enter ticker (EXCHANGE:SYMBOL): 
NASDAQ:INFY

Inserting Entry at location: http://finance.google.com/finance/feeds/default/portfolios/1/positions/NASDAQ:INFY/transactions

The server had a problem handling your request.
com.google.gdata.util.ServiceForbiddenException: Forbidden

Exception message unavailable
        at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:561)
        at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
        at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:536)
        at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:515)
        at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
        at com.google.gdata.client.Service.insert(Service.java:1347)
        at com.google.gdata.client.GoogleService.insert(GoogleService.java:599)
        at financetester.Main.insertTransactionEntry(Main.java:169)
        at financetester.Main.main(Main.java:81)
BUILD SUCCESSFUL (total time: 1 minute 4 seconds)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文