coinbase / coinbase-python

DEPRECATED — Coinbase Python API
Apache License 2.0
528 stars 217 forks source link

Coinbase - get_spot_price - historical #50

Closed jsartre closed 6 years ago

jsartre commented 7 years ago

Must be a newbie question. Trying to fetch the historical daily spot prices on coinbase. Using the python implementation of the api as follows.

https://developers.coinbase.com/api/v2#get-spot-price

price = client.get_spot_price(currency_pair= 'BTC-USD', date='2016-05-10')

Result (actually today's price):

    2016-5-10
{
  "amount": "5613.84",
  "base": "BTC",
  "currency": "USD"
}

I get the current spot price. Could anyone shade some light on what I am missing? Thanks!

ShakataGaNai commented 7 years ago

The coinbase API doesn't show any historical endpoints (that I've seen). Look around: https://developers.coinbase.com/api/v2#get-spot-price

joshblum commented 6 years ago

@jsartre historical data is shown with the get_spot_price endpoint but as #49 points out there is a bug with how params are passed on GET requests currently. This should be fixed by #54

joshblum commented 6 years ago

@jsartre you might also want to checkout the get_historic_prices endpoint, it's undocumented but you can checkout the requests made at www.coinbase.com

sds commented 6 years ago

54 has been merged, so you should be able to get historical prices now.