【问题标题】:Getting the buy price amount and only the buy price amount from Coinbase API从 Coinbase API 获取买入价金额和仅买入价金额
【发布时间】:2018-04-22 23:57:36
【问题描述】:

我正在使用 Python 处理 Coinbase 的 API。在尝试打印 BTC 的买入价格时,我写道:

client.get_buy_price()

这很好,但它返回:

“金额”:“7272.19”, “基地”:“比特币”, “货币”:“美元”

无论如何我只能得到金额(7272.19)?

【问题讨论】:

  • 它返回一个对象还是一个字符串?如果它是一个对象,你会做client.get_buy_price().amount
  • 完美运行,谢谢!
  • 太好了,你介意接受我刚刚创建的答案吗?

标签: python api web-scraping coinbase-api


【解决方案1】:

我在 cmets 中进行了回答,因为我不确定它返回的是对象还是字符串。

把它当作一个为线程启动器工作的对象。

所以问题的正确答案是像client.get_buy_price().amount一样得到它

【讨论】:

    猜你喜欢
    • 2012-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-02
    相关资源
    最近更新 更多