python - 如何获取 IEX 云中可用的扇区列表
问题描述
我正在使用 IEX 云 API,并尝试使用扇区规范来使用集合过滤器。为此,我需要一个可用扇区的列表。我可以获得标准普尔 500 指数股票的收盘价。但我想瞄准所有全球矿业股。理想情况下,我可以使用 SIC 代码,但这不能用作收集过滤器。
GET /ref-data/sectors
但是我的python代码
batch_api_call_url=f'https://sandbox.iexapis.com/stable/stock/market/ref-data/sectors&token={IEX_CLOUD_API_TOKEN}'
data = requests.get(batch_api_call_url)
不起作用。
任何建议或参考将不胜感激。
解决方案
该 URL 似乎不正确 - 它不应包含 /stock/market/。
这是一个工作请求示例:
batch_api_call_url = f'https://cloud.iexapis.com/stable/ref-data/sectors?token={IEX_CLOUD_API_TOKEN}'
data = requests.get(batch_api_call_url)
推荐阅读
- python - 一次迭代被浪费了,并且没有得到正确的输出。(Python)
- python - 在 python 直方图上绘制两个系列的问题
- android - 查看 Recycler 的模型查看项目
- node.js - NodeJS原型函数不等待结果
- python - 如何正确打印 for 循环(Python)的整个结果?
- javascript - NodeJS Sqlite db.each 未运行
- delphi - 复制字典的正确方法是什么?
- c# - Aspose.Total for .NET 是否支持 .Net Core?
- search - Google 自定义搜索问题:由于达到每日限制,请求受到限制
- html - 如何显示图像全屏直到加载页面完成?