0

我已经为 R 尝试了两个加密货币 API 包,将其命名为:

  1. coinmarketcapr 包
  2. riingo <- 包含在 tidyquant 我真的想获得加密货币的更新历史数据,我的目标是通过一些时间序列分析来预测事情,但是使用这些包我不断收到错误消息,对于 coinmarketcapr 这是可以理解的,因为显然我的 API 订阅计划没有'不涵盖历史数据,但对于 riingo,消息显示就像这样......
> riingo_crypto_latest("btcusd", resample_frequency = "10min", base_currency = NULL)
Request failed [401]. Retrying in 1.6 seconds...
Request failed [401]. Retrying in 1.5 seconds...
Error: There was an error, but riingo isn't sure why. See Tiingo msg for details.
Tiingo msg) Invalid token.

有人可以帮助我吗?或者可能建议其他来源获取加密货币历史数据?提前感谢您的任何回答!

PS 我已经插入了 API 密钥,所以不是身份验证问题。

4

1 回答 1

0

如果您尝试在加密货币交易所抓取有关新列表的信息和一些更有用的信息,您可能会对使用此 API 感兴趣:

https://rapidapi.com/Diver44/api/new-cryptocurrencies-listings/

R中的示例请求:

library(httr)

url <- "https://new-cryptocurrencies-listings.p.rapidapi.com/new_listings"

response <- VERB("GET", url, add_headers(x_rapidapi-host = 'new-cryptocurrencies-listings.p.rapidapi.com', x_rapidapi-key = 'your-api-key', '), content_type("application/octet-stream"))

content(response, "text")

它包括一个端点,其中包含来自最大交易所的新列表和一个非常有用的端点,其中包含有关交易所的信息,您可以在该交易所购买特定硬币和该硬币的价格。您可以使用此信息进行交易。当货币开始在 Binance、KuCoin、Huobi 等热门交易所上市时,价格上涨约 20-30%

于 2021-11-05T00:06:49.137 回答