BitcoinIndex

From BitcoinWiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

Bitcoin Index is a Bitcoin realtime price index owned by Coinut. It provides a highly available and robust Bitcoin realtime price index (updated every tens of milliseconds) with free REST and WebSocket APIs access. It is good for merchants or traders to use.

How to use[edit]

Get Bitcoin Real Time Price Index[edit]

To get the realtime index through their REST API, just try to visit the following URL. You can either open the following URL in your browser to check the result or try their sample code here: https://github.com/coinut/api/blob/master/bitcoin-index/nodejs/restApiCall.js, and for other REST APIs below, you can do the same to try out. <source lang="text"> https://bitcoinindex.io/btcusd </source> The result will be like the following <source lang="javascript"> {"status":["OK"],"index":3399.48797346,"timestamp":"2017-08-09T03:55:00.379Z"} </source>

Convert BTC to USD[edit]

To convert BTC to USD, you can use their REST API like the following. <source lang="text"> https://bitcoinindex.io/btcusd/convert/1.5/BTC </source> And a result like the following will be returned <source lang="javascript"> {"status":["OK"],"index":3395.30917644,"timestamp":"2017-08-09T04:06:28.900Z","convertedAmount":5092.96,"convertedTo":"USD","result":"1.5 BTC = 5092.96 USD"} </source>

Convert USD to BTC[edit]

Similarly, use the following to convert USD to BTC <source lang="text"> https://bitcoinindex.io/btcusd/convert/100.32/USD </source> And a result like the following will be returned <source lang="javascript"> {"status":["OK"],"index":3395.37064784,"timestamp":"2017-08-09T04:05:15.386Z","convertedAmount":0.02954611,"convertedTo":"BTC","result":"100.32 USD = 0.02954611 BTC"} </source>

Get Realtime Streaming Data[edit]

Although you can visit their REST API to get Bitcoin price every few seconds, it would be much better to use WebSocket to achieve high frequency sub-second updates. Simply check out their WebSocket API here: https://github.com/coinut/api/blob/master/bitcoin-index/nodejs/index.js

High Availability[edit]

BitcoinIndex tries to achieve 99.999% uptime (five-nine availability) so that you can use the service nearly all the time. Their backend servers are located in different continents to ensure that the service will not be interrupted by regional network outage, and at the same time, they ensure strong consistency of the data between those replicated servers so no matter where you visit their service, you will get exactly the same result.

Source[edit]

http://bitcoin.it/

See Also on BitcoinWiki[edit]