1

I would also like the the result to be precise to hour (or minute).

It is for a java program.

I have looked around, but the service I have found could not satisfy my need: http://www.coindesk.com/api/: only precise to date

https://api.coinbase.com/v1/prices/historical?page=1 (from https://community.coinbase.com/t/past-bitcoin-exchange-rates/1725): need to adjust page number to find the desired time (at which one wants the value of exchange rate)

http://api.bitcoincharts.com/v1/csv/: I am not exactly sure what it does, but it seems that one needs to download different files from this site containing "USD" in the file names, check in all the files before finding the desired time

0

You can use winkdex.com api, it accepts a unix timestamp as a parameter. http://docs.winkdex.com/#price

4
  • It says that price is "The value of the WinkDex at the requested time in 0.01 USD". What is the value of WinkDex and what does it have anything to do with Bitcoin?
    – Aqqqq
    Mar 14 '17 at 18:48
  • 1
    WinkDex is a bitcoin price index. It takes the information from several of the largest bitcoin exchanges and consolidates it into an average price.
    – presstab
    Mar 14 '17 at 20:15
  • The timestamp has an entry like: 2017-03-15T08:05:00Z. Am I correct that Z represent that the time is in UTC? What does the "T" in the middle mean?
    – Aqqqq
    Mar 15 '17 at 20:17
  • 2
    @Aqqqq it's the ISO 8601 format. The T seems to act as a delimiter to separate the date and time. There's a whole wikipedia page dedicated to this time format: en.wikipedia.org/wiki/ISO_8601 . Z does indicated UTC time.
    – Abdussamad
    Mar 16 '17 at 7:33
0

The CoinGecko API is what you are looking for. Here an example request:

https://api.coingecko.com/api/v3/coins/bitcoin/history?date=28-06-2021

You can pipe it through jq:

curl https://api.coingecko.com/api/v3/coins/bitcoin/history?date=28-06-2021 | jq .market_data.current_price.usd

Which gives you 39076.59377063225. The exchange rate of bitcoin at the 28th of June 2021 in USD. It is not possible to get values for minutes/hours, just for days, as far as I am aware).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.