api - 我正在尝试为股票代码“AAPL”构建数据字典但是我遇到了这个错误消息 HTTPError:HTTP 错误 400:
问题描述
这是函数 apple_dict=f.build_dict('AAPL')
这是主脚本
def profile_data_(self,symbol): """ 从 API 中提取给定股票代码的指标数据
Parameters
----------
symbol : A ticker symbol (str) e.g. 'MSFT','FB','AAPL', or 'TWTR'
Returns
-------
None. Updates the self.profile with the data.
"""
if not self.key_registered:
print("API key not registered yet.")
return None
url = "https://financialmodelingprep.com/api/v3/"+'?apikey='+self.key
response = urlopen(url)
data = response.read().decode("utf-8")
self.profile = json.loads(data)
return json.loads(data)
解决方案
推荐阅读
- android - 如何使用 AppCompatActivity 使 Actionbar 的选项菜单的波纹效果不超过圆角边界?
- pandas - groupby.median() 和 groupby.transform('median') 有什么区别
- ruby-on-rails - 【Rails】如何在route.rb中写入子目录路径?
- javascript - Mutation Observer 观察其子元素发生变化的父 DOM 元素
- ios - 如何在我的 Swift 应用程序中向多个单一联系人发送短信?
- flutter - 如何在 Flutter Web 中使用 lib assets_audio_player
- flutter - 每 50 毫秒 Flutter 任务
- session - NextJs 受 Next Auth 保护的 API
- python - Python Django:为什么 Google OAuth2 令牌在过期时间后有效?
- java - 动态模板(Sendgrid APIs)中嵌入的内嵌图像