node-coindesk-api

1.0.0 • Public • Published

CoinDesk Bitcoin Price Index API

Simple module to query the CoinDesk Bitcoin Price Index API

Usage

$ npm install node-coindesk-api

Then, start querying the Coindesk API:

const coindesk = require('node-coindesk-api')
 
coindesk.getCurrentPrice().then(function (data) {
  // data.bpi.USD.rate_float === 1015.0275 !!!
})

API

  • getCurrentPrice(): Returns current bitcoin prices.
  • getSupportedCurrencies(): Returns all supported currencies.
  • getHistoricalClosePrices(options): Returns historical prices where options is an object with optional properties:
    • index: USD or CNY.
    • index: USD or CNY.
    • currency: any valid currency sting (see above).
    • start, end: Date objects
    • yesterday: boolean to shorten the query.

See Coindesk BPI API docs for more information.

Note on using the Coindesk BPI API

Read Coindesk's note on their docs:

You are free to use this API to include our data in any application or website as you see fit, as long as each page or app that uses it includes the text “Powered by CoinDesk”, linking to our price page.

License

WTFPL

$ npm version <major|minor|patch>    # updates package.json and applies tag 
$ npm publish                        # lints, builds and publishes 
$ git push --follow-tags             # don't forget to push the code and tags! 

Package Sidebar

Install

npm i node-coindesk-api

Weekly Downloads

1

Version

1.0.0

License

WTFPL

Last publish

Collaborators

  • gabmontes