Giter Site home page Giter Site logo

coin-ticker's Introduction

coin-ticker

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

CircleCI

Install

$ npm install --save coin-ticker

Usage

Require:

const coinTicker = require('coin-ticker');

Syntax:

coinTicker(exchange, currency-pair)

Parameters:

exchange: A string declaring one of the available exchanges:

* 'bitfinex'
* 'bitstamp'
* 'poloniex'
* 'btce'
* 'kraken'
* 'okcoin'
* 'exmo'

currency-pair: An optional string declaring the currencies or assets to retrieve. Default is 'btcusd'.

Available asset pairs by exchange:

Bitfinex:

* 'btcusd'
* 'ltcusd'
* 'ltcbtc'
* 'ethusd'
* 'ethbtc'
* 'etcbtc'
* 'etcusd'
* 'rrtusd'
* 'rrtbtc'
* 'zecusd'
* 'zecbtc'

Bitstamp:

* 'btcusd'
* 'btceur'
* 'eurusd'
* 'xrpusd'
* 'xrpeur'

Poloniex:

* 'btcusd'
* 'ethbtc'
* 'xrpbtc'
* 'dashbtc'
* 'ethusd'
* 'xmrbtc'
* 'etcbtc'
* 'fctbtc'
* 'zecbtc'
* 'ltcbtc'
* 'dashusd'
* 'gntbtc'
* 'xrpusd'
* 'dcrbtc'
* 'repbtc'
* 'maidbtc'
* 'lskbtc'
* 'xmrusd'
* 'dogebtc'
* 'ampbtc'
* 'xembtc'
* 'sjcxbtc'
* 'etcusd'
* 'steembtc'
* 'etceth'
* 'navbtc'
* 'sysbtc'
* 'gnteth'
* 'zecusd'
* 'ltcusd'

BTC-e:

* 'btcusd'
* 'btcrur'
* 'btceur'
* 'ltcbtc'
* 'ltcusd'
* 'ltcrur'
* 'ltceur'
* 'nmcbtc'
* 'nmcusd'
* 'nvcbtc'
* 'nvcusd'
* 'usdrur'
* 'eurusd'
* 'eurrur'
* 'ppcbtc'
* 'ppcusd'
* 'dshbtc'
* 'dshusd'
* 'ethbtc'
* 'ethusd'
* 'etheur'
* 'ethltc'
* 'ethrur'

Kraken:

* 'etcbtc'
* 'etceur'
* 'etcusd'
* 'ethbtc'
* 'ethcad'
* 'etheur'
* 'ethgbp'
* 'ethjpy'
* 'ethusd'
* 'ltcbtc'
* 'ltceur'
* 'ltcusd'
* 'btccad'
* 'btceur'
* 'btcgbp'
* 'btcjpy'
* 'btcusd'

Okcoin:

* 'btcusd'
* 'ltcusd'

Exmo:

* 'btcusd'
* 'btceur'
* 'btcrub'
* 'btcuah'
* 'dashbtc'
* 'dashusd'
* 'ethbtc'
* 'ethusd'
* 'ethrub'
* 'dogebtc'
* 'ltcbtc'
* 'ltcrub'

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. 'btcusd'
}

Excamples:

Get the current ticker data of ETH/USD from BTC-e:

coinTicker('btce', 'ethusd');

Get the current ticker data of BTC/USD from Bitfinex:

coinTicker('bitfinex'); // when no asset pair is specified, coinTicker will default to 'btcusd'

Example response data:

{
  last: '1034.8',
  ask: '1034.8',
  bid: '1034.7',
  low: '1001.6',
  high: '1040.0',
  vol: '15112.8733725',
  timestamp: '1486238356.227418953',
  exchange: 'bitfinex',
  pair: 'btcusd'
}

coin-ticker's People

Contributors

alepop avatar zoeydawn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.