- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试制作一个简单的 GUI,用于从 Alpha Vantage 收集几组历史股票数据。我收到此错误:
File "d:\GIT\StockAI\main.py", line 34, in run
data = ts.get_daily(symbol=stock, outputsize='full')
File "C:\Users\benlu\Anaconda3\lib\site-packages\alpha_vantage\alphavantage.py", line 178, in _format_wrapper
data = call_response[data_key]
KeyError: 'Time Series (Daily)'
我不完全确定那是什么意思,我在谷歌搜索这个问题时遇到了一些问题。我认为这是我所缺少的相当简单的东西。此外,输出格式设置为 pandas,如果这很重要的话。这是(希望如此)所有相关代码:
stockList = ["AAPL", "AMZN", "GOOG", "GOOGL", "MSFT", "JPM", "JNJ", "BA"]
for stock in stockList:
data = ts.get_daily(symbol=stock, outputsize='full')
data[0].to_csv(stock + '.csv')
它似乎随机工作;它会收集一些 .csv 文件,然后看似随机地停止......任何人都可以帮助我吗?我将不胜感激!
最佳答案
根据我的经验,当超过免费套餐限制时会发生这种情况。您每分钟只能调用 API 5 次。该错误非常具有误导性,但它与免费套餐有关。
要解决此问题,您只需在 5 次调用后添加超时,或获取高级 API。
来自网站支持页面的信息:
Are there usage/frequency limits for the API service?
We are proud to provide free API service for our global community of users and recommend that you make API requests sparingly (up to 5 API requests per minute and 500 requests per day) to achieve the best server-side performance. If you would like to target a larger API call volume, please visit premium membership.
Note: If you are a student or educator, chances are that your school already has a data partnership with Alpha Vantage. If not, please ask your school/library administrator to contact partnerships@alphavantage.co for a special partnership plan for educational institutions.
关于python - Alpha Vantage "KeyError: ' 时间序列(每日 )'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56500547/
Alpha Vantage API 不提供纳斯达克指数的报价(不再?)。我感兴趣的所有其他 indizes 似乎都很有魅力。 例如,调用以下 URL(隐藏 API key )将提供 S&P 的报价(符
这个对 NASDAQ Composite 的 API 调用曾经起作用。现在它只返回一个空的 JSON。 {} .没有错误信息。 https://www.alphavantage.co/query?fu
我有一个 Alpha Vantage API key ,但在解析数据时遇到了问题。我不确定如何解析数据,因为有 JSON 和 CSV 选项。 CSV 似乎是一个下载文件,我不是每次想更新股票价格时都尝
我正在尝试将 Alpha Vantage 查询中的值传递到 pandas df 中,以便我可以提取某些值。 当我运行一个简单的 1 个符号查询时,我可以轻松地将信息传递到 df 中。之后,我可以转置
我正在尝试从我的 API 调用中循环遍历 JSON,并在我的 React 应用程序中绘制每个最高交易价格(最终目标是创建一个图表)。问题是,我需要事先知道确切的时间戳字符串,因为 API 不是数字结构
有人可以向我展示一个关于如何从 Alpha Vantage 获取数据而不是通过 JavaScript 显示数据的代码示例吗? 我在显示 json 数据时遇到问题。 最佳答案 我根据在 stackove
例如,如果我想列出 NASAQ 上的所有股票及其收盘价,有没有一种方法可以在不为每只股票使用 API 的情况下做到这一点? 我的意思是,您使用 API URL 中公司的股票代码提取公司的数据。如果纳斯
我正在使用 Alpha Vantage API 获取股票市场数据。然而,这个 API 似乎只提供一系列数据,这些数据也隐含在其恰当命名的函数(如 TimeSeries)中。这意味着如果我从 API 请
我想试试 Alpha Vantage's API在 Python 中,但我想使用 Anaconda 而不是 pip 来安装它。不过,我对 conda 还很陌生。 我在 conda 中搜索了 alpha
我正在寻找可用于发布天气的标准数据格式 data collected通过 Davis Instrument Vantage Pro 2 weather station . 这是为了遵守 openDat
我正在尝试从 Alpha Vantage API 获取最新的盘中价格。目前是周五,东欧时间晚上 9:16。我正在尝试购买特斯拉股票。市场仍然开放。但是,API 调用只返回我昨天的数据。可能是什么问题?
使用以下代码,我没有从 alphavantage 获取任何数据,我收到以下 API 错误: "Error Message": "Invalid API call. Please retry or vi
outputsize='compact' 给出了过去 100 天,而 outputsize='full' 给出了整个历史,这是太多的数据。知道如何编写提取特定时期的代码吗? ts=TimeSeries
我试图通过调用 alphavantage 的 API 为公司获取 JSON。对于某些公司数据,它有效,而对于某些公司,它却失败了。 例如,对于这个查询,它的工作原理是: https://www.alp
我是 Ajax 和 JSON 的新手。我在解析来自 Alpha Vantage API 的 Json 数据时遇到问题。我的项目是在 html5 小部件中使用 jive 平台创建一个股票小部件,并且我有
我有这段代码并可以运行它,但我想更改源代码以获取 alpha 优势?这个 API 是: https://www.alphavantage.co/query?function=TIME_SERIES_D
我们正在尝试在内部具有 Tomcat 服务器的 Informatica Application Server 上安装 compuware vantage analyzer。 我在本地机器上安装了控制台
我一直在使用 Romel Torres 的 alpha_vantage 包,但也想直接从 python 中使用 Alpha Vantage API(提供更强大的功能)和此处描述的包请求 CALL wi
我正在尝试制作一个简单的 GUI,用于从 Alpha Vantage 收集几组历史股票数据。我收到此错误: File "d:\GIT\StockAI\main.py", line 34, in r
我正在尝试从 Alpha Vantage 收集股票数据,但我一直收到错误消息?我正在使用 Alpha Vantage 来提取数据。我的代码如下: import pandas_datareader.da
我是一名优秀的程序员,十分优秀!