0

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

This price seems to be the current price

  • Does this answer your question? [Coinbase API v2 Getting Historic Price for Multiple Days](https://stackoverflow.com/questions/51417285/coinbase-api-v2-getting-historic-price-for-multiple-days) – Ezra Jul 04 '21 at 04:14

1 Answers1

0

This question already has answers. Copy and pasted from here: Coinbase API v2 Getting Historic Price for Multiple Days

Any reason you aren't using coinbase pro?

The new api is very easy to use. Simply add the get command you want followed by the parameters separated with a question mark. Here is the new historic rates api documentation: https://docs.pro.coinbase.com/#get-historic-rates

The get command with the new api most similar to prices is "candles". It requires three parameters to be identified, start and stop time in iso format and granularity which is in seconds. Here is an example:

https://api.pro.coinbase.com/products/BTC-USD/candles?start=2018-07-10T12:00:00&stop=2018-07-15T12:00:00&granularity=900

EDIT: also, note the time zone is not for your time zone, I believe its GMT.

Ezra
  • 471
  • 3
  • 14