Coinbase API 调用以获取加密货币现货价格

Coinbase API call to get crypto spot prices

刚开始探索 CoinBase APIs.
我发现

我需要以编程方式获取某些加密货币的当前现货价格,我在旧 API 中找到了一个端点:https://api.coinbase.com/v2/prices/
这是获取价格的正确 API 调用吗? 在新的 Coinbase Cloud APIs 之一中是否有等效的端点?

可以使用现货价格api

https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-spot-price

示例:https://api.coinbase.com/v2/prices/BTC-USD/spot

或者您可以使用代码 api(我认为这是更好的选择)

https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductticker

示例:https://api.pro.coinbase.com/products/BTC-USD/ticker