4

I can currently issue the following request: https://api.coinbase.com/v2/prices/spot?currency=USD and receive a json response with the current (spot) price of BitCoin (BTC).

What I want is to retrieve that information for Ether (ETH). I note that the HTTP request that I am using does not specify BTC, it just defaults to that.

I have reviewed the Coinbase API without success in locating an answer.

I was just wondering if anyone is aware of an HTTP request to obtain that data, or if this request is not currently supported via HTTP.

tia

David Tansey
  • 5,813
  • 4
  • 35
  • 51
  • Thank you David, that is exactly what I was looking for. Not sure why I was unable to locate the calls you provided in your response, apparently I didn't look long enough and/or in the right place. – renenielsen Sep 25 '17 at 20:11

1 Answers1

3

The Coinbase API docs, https://developers.coinbase.com/api/v2#get-spot-price shows the following URI structure for getting the spot price for Bitcoin (BTC) or Ethereum (ETH), which is different from what you have posted.

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

The part of the url indicated as :currency_pair is a string containing the symbol for the coin, a hyphen and then 'USD', such as BTC-USD or ETH-USD.

I am able to get BTC and ETH spot prices from the api with the following:

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

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

David Tansey
  • 5,813
  • 4
  • 35
  • 51