我在使用 Coinbase.com API 调用历史数据时遇到了一些问题。
以前,我得到了一个可变长度的天数,它与终端屏幕上的可用空间量相匹配,请求 URL 如下所示:
https://api.coinbase.com/v2/prices/historic?currency=USD&days=76
Run Code Online (Sandbox Code Playgroud)
这将拉取过去 76 天的价格历史记录。旧输出的一个例子在这里:https : //gist.github.com/KenDB3/f071a06ab3ef1a899d3cd8df8b40a049#file-coinbase-historic-days-example-2017-12-23-json
这几天前停止工作。我能得到的最接近的是这个请求 URL(虽然我没有得到我想要的数据):
https://api.coinbase.com/v2/prices/BTC-USD/historic?days=76
Run Code Online (Sandbox Code Playgroud)
输出可以在这里看到:https : //gist.github.com/KenDB3/f071a06ab3ef1a899d3cd8df8b40a049#file-coinbase-historic-days-example-2018-07-19-json
在第二个示例中,它仅显示查询当天不同时间的价格。我真正想要的是第一个示例输出,它每天给出一个价格,可以追溯到请求的天数。
这个连接的项目在这里:https : //github.com/KenDB3/SyncBTC
无效链接:https : //api.coinbase.com/v2/prices/historic?currency=BTC-USD&days=76 (无结果) https://api.coinbase.com/v2/prices/BTC-USD /historic?2018-07-15T00:00:00-04:00 (不提取7/15/2018 的数据)