【问题标题】:Is it possible to get the price of bitcoin in USD from the coinbase API for a specific time in the past?是否可以从 coinbase API 获取过去特定时间的美元比特币价格?
【发布时间】:2021-09-15 09:01:26
【问题描述】:

获取https://api.coinbase.com/v2/prices/:currency_pair/spot

这个价格好像是现价

【问题讨论】:

标签: coinbase-api


【解决方案1】:

这个问题已经有了答案。从这里复制粘贴:Coinbase API v2 Getting Historic Price for Multiple Days

您没有使用 coinbase pro 的任何原因?

新的 api 非常易于使用。只需添加所需的 get 命令,后跟用问号分隔的参数。这是新的历史汇率 API 文档:https://docs.pro.coinbase.com/#get-historic-rates

与价格最相似的新api的get命令是“蜡烛”。它需要识别三个参数,iso格式的开始和停止时间以及以秒为单位的粒度。这是一个例子:

https://api.pro.coinbase.com/products/BTC-USD/candles?start=2018-07-10T12:00:00&stop=2018-07-15T12:00:00&granularity=900

编辑:另外,请注意时区不是您的时区,我相信它的 GMT。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-03
    • 2023-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-15
    相关资源
    最近更新 更多