JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q57694F
  • License ISC

Wrapper for bitcoin exchange apis. The easiest way to add cryptocurrency market data into your application!

Package Exports

  • coin-ticker

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (coin-ticker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

coin-ticker

Easily get the latest exchange data of Bitcoin, Etherium, Litecoin, and other assets from a variety of exchanges including Bitfinex, Coinbase, Bitstamp, Kraken, Poloniex and others.

CircleCI

Install

$ npm install --save coin-ticker

Usage

Require:

const coinTicker = require('coin-ticker');
// => Promise

Syntax:

coinTicker(exchange, currency-pair)

Parameters:

exchange: A string declaring one of the available exchanges:

- 'bitfinex'
- 'bitstamp'
- 'coinbase'
- 'poloniex'
- 'bittrex'
- 'btce'
- 'kraken'
- 'okcoin'
- 'exmo'

currency-pair: A string declaring the currencies or assets to retrieve. Any market that is provided by the exchange can be used. Example asset pairs by exchange:

Bitfinex:

- 'BTC_USD'
- 'LTC_USD'
- 'LTC_BTC'
- 'ETH_USD'
- 'ETH_BTC'
- 'ETC_BTC'
- 'ETC_USD'
- 'ZEC_USD'
- 'ZEC_BTC'

Bitstamp:

- 'BTC_USD'
- 'BTC_EUR'
- 'EUR_USD'
- 'XRP_USD'
- 'XRP_EUR'

Coinbase:

- 'BTC_USD'
- 'BTC_EUR'
- 'ETH_USD'
- 'ETH_EUR'
- 'LTC_USD'
- 'LTC_EUR'

Poloniex:

- 'BTC_USD'
- 'ETH_BTC'
- 'XRP_BTC'
- 'DASH_BTC'
- 'ETH_USD'
- 'XMR_BTC'
- 'ETC_BTC'
- 'FCT_BTC'
- 'ZEC_BTC'
- 'LTC_BTC'
- 'DASH_USD'
- 'GNT_BTC'
- 'XRP_USD'
- 'DCR_BTC'
- 'REP_BT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'
- 'BTC_UAH'
- 'DASH_BTC'
- 'DASH_USD'
- 'ETH_BTC'
- 'ETH_USD'
- 'ETH_RUB'
- 'DOGE_BTC'
- 'LTC_BTC'
- 'LTC_RUB'

Response Data:

An object containing the following values:

{
  last: // the last traded price
  ask:  // current ask
  bid: // current bid
  low: // 24 hour low
  high: // 24 hour high
  vol: // 24 hour volume
  timestamp: // precise time
  exchange: // the current exchange, i.e. 'bitfinex'
  pair: // the asset pair, i.e. 'BTC_USD'
  rawData: // the original, unformatted object received from the exchange api. Differs by exchange.
}

Excample:

coinTicker('bitfinex', 'BTC_USD')
   .then((tick) => {
      console.log(tick)
   })
// =>
// {
//   last: '1034.8',
//   ask: '1034.8',
//   bid: '1034.7',
//   low: '1001.6',
//   high: '1040.0',
//   vol: '15112.8733725',
//   timestamp: '1486238356.227418953',
//   exchange: 'bitfinex',
//   pair: 'BTC_USD',
//   rawData: { ... }
// }

If you find this package useful, please contribute by donating bitcoin or opening a pull request.

BTC Donation address: 1Gr9UcXdM5Kmnseht2u29o1SsqMnBkTsYP