CoinBase API - et_exchange_rates and get_currencies failure.

£可爱£侵袭症+ 提交于 2019-12-13 04:07:56

问题


Hi when writing a simple python script to test Coinbase Features as per documentation I am getting the following results:

get_exchange_rates(currency='GBP')

I encounter a similar problem when I try to get the price of a given currency that is not BTC-USD:

price = client.get_buy_price(currency_pair = 'BTC-GBP')
print(price)

RESULT:

{ "amount": "13788.39", "base": "BTC", "currency": "USD" }

Is this a problem with the API, or am I doing this incorrectly?

**Additional info:**Using API keys with all functionality allowed.


回答1:



It looks like is a known bug which hasn't been published yet. It defaults all the currency pairs to BTC-USD.
You may try instead using requests.get() providing the required headers for authentication or even follow the provided example on the developers site.



来源:https://stackoverflow.com/questions/48255624/coinbase-api-et-exchange-rates-and-get-currencies-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!