@xrates/btc-usd
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Exchange Rates: BTC - USD

Historical exchange rates for the BTC/USD pair.

Installation

npm install --save @xrates/btc-usd

Usage

const btcToUsd = require('@xrates/btc-usd')

console.log(btcToUsd.lookup('2014-10-15'))
//=> 7.2696

API

lookup(date: string | Date): number

Get the exchange rate for the specified date. The return value is a number that fits the description "1 BTC = ? USD".

If the specified date falls outside the span of the provided data, a RangeError will be thrown.

Source

The data is collected from the CoinDesk Bitcoin Price Index, via their official API.

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 the following text (with the link):

Powered by CoinDesk

Readme

Keywords

none

Package Sidebar

Install

npm i @xrates/btc-usd

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

27.4 kB

Total Files

14

Last publish

Collaborators

  • linusu