You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

R语言yahoofinancer包API请求失败(401客户端错误)求助

Yahoo Finance API请求返回401客户端错误问题

之前可正常运行的请求如今出现以下报错:

Yahoo Finance API request failed
Status: 401
Type: Client error
Mesage: 
Description:  
Error: 

已尝试的操作:

  • 重启R与RStudio
  • 切换至旧版本R
  • 测试yahoofinancer包的各类接口请求,结果如下:
glimpse(St_Ticker$quote)                 # 正常返回数据
St_Ticker$quote$shortName            # 正常返回数据
St_Ticker$quote$trailingPE           # 正常返回数据
St_Ticker$quote$forwardPE            # 正常返回数据
St_Ticker$quote$dividendYield        # 正常返回数据
glimpse(St_Ticker$financial_data)        # 请求失败
glimpse(St_Ticker$get_cash_flow(frequency = "annual", clean_names = TRUE))  # 请求失败
glimpse(St_Ticker$get_history())
my_history <- St_Ticker$get_history()
filter(my_history, date >= "2023-07-01")   # 正常返回数据
glimpse(St_Ticker$grading_history)       # 请求失败
glimpse(St_Ticker$index_trend)           # 请求失败
glimpse(St_Ticker$key_stats)             # 请求失败
glimpse(St_Ticker$price)                 # 请求失败
glimpse(St_Ticker$recommendation_trend)  # 请求失败
glimpse(St_Ticker$recommendations)       # 返回带评分的数据
St_Ticker$recommendations            # 正常返回数据
St_Ticker$recommendations$symbol     # 正常返回数据
glimpse(St_Ticker$set_symbol)            # 返回设置symbol的函数
glimpse(St_Ticker$summary_detail)        # 请求失败

本人对URL操作和网页抓取不熟悉,恳请各位提供解决思路。

内容的提问来源于stack exchange,提问作者Marc Trudeau

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 09:12:44