2

I would like to get a history of the bitcoin price. For example I would like to be able to provide a start_date and end_date for a search/filter. Are there any open source and trusted api with almost accurate prices for this?

I have noticed that coinbase only returns the spot/current price and I cannot pass more params to filter

curl https://api.coinbase.com/v2/prices/spot?currency=USD

I have also used coindesk but the prices are not accurate.

https://api.coindesk.com/v1/bpi/historical/close.json?start=2019-08-10&end=2020-08-11&currency=zar
Community
  • 1
  • 1
Thabo
  • 1,303
  • 2
  • 19
  • 40

2 Answers2

3

bitcom.com does not provide historical prices, it is wallet and kinda banking services.

API for pro.bitcom.com, (crypto exchange) provides to historical prices.

https://docs.pro.coinbase.com/#get-historic-rates

Yuri Ginsburg
  • 2,302
  • 2
  • 13
  • 16
1

I would recommend you to use the CoinMarketCap API if what you want are historical prices.

There are also libraries like ccxt where you can probably find this information as well.

However you have keep in mind that due to the number of exchanges these prices are approximations, and there is not sucha thing as a "unique" price for bitcoin.

Let's try
  • 1,044
  • 9
  • 20
  • Hey, thank you, that was really helpful. But what do you mean when you say "there is not such a thing as a 'unique' price for bitcoin". Did you mean there is no definite price, since the price of bitcoin is determined by the various exchanges? – Thabo Aug 25 '20 at 15:01
  • 1
    Yes, exactly that. The aggregators like ConMarketCap, get prices from a group of exchanges and create Index-like prices. Upvote if it was helpful =). – Let's try Aug 25 '20 at 15:04