简体   繁体   English

有没有办法使用 Coinbase API 获取以太坊价格数据?

[英]Is there a way to get Ethereum price data using the Coinbase API?

Is there a way to get Ethereum price data using the Coinbase API?有没有办法使用 Coinbase API 获取以太坊价格数据? I've looked at the documentation and I only see a way to get Bitcoin price data.我查看了 文档,我只看到了一种获取比特币价格数据的方法。

Found the answer thanks to Roland Starke .感谢Roland Starke找到了答案。

Here it is for those who are interested: https://api.coinbase.com/v2/prices/ETH-USD/spot这是给那些有兴趣的人: https : //api.coinbase.com/v2/prices/ETH-USD/spot

This is curl for get any crypto price这是获取任何加密货币价格的卷曲

curl https://api.coinbase.com/v2/prices/ETH-USD/spot

If you want other crypto price change ETH-USD for something else.如果您想要其他加密货币价格更改 ETH-USD 以换取其他东西。 You can also change /spot for buy and sell:您还可以更改 /spot 进行买卖:

curl https://api.coinbase.com/v2/prices/ETH-USD/buy
curl https://api.coinbase.com/v2/prices/ETH-USD/sell

You will get respones with json data like:您将收到 json 数据的响应,例如:

{"data":{"base":"ETH","currency":"USD","amount":"3254.6"}}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM