尝试使用get_currency_exchange_daily
黄金现货价格提取历史黄金价格时出现错误。
这是引发错误的python代码示例ValueError: Invalid API call. Please retry or visit the documentation (https://www.alphavantage.co/documentation/) for FX_DAILY.
from alpha_vantage.foreignexchange import ForeignExchange
# Your key here
key = 'XXX'
ts = ForeignExchange(key)
price, meta = ts.get_currency_exchange_daily(from_symbol='XAU', to_symbol='USD')
虽然这个 python 代码执行得很好
from alpha_vantage.foreignexchange import ForeignExchange
# Your key here
key = 'XXX'
ts = ForeignExchange(key)
price, meta = ts.get_currency_exchange_rate(from_currency='XAU', to_currency='USD')
我正在使用 Anaconda 环境中的 Python 3.8.2 运行它,尽管它不应该有所作为。非常感谢帮助。