Git Product home page Git Product logo

node-crypto-api's Introduction

node-crypto-api

NPM

Provide an api to consume data from multiple cryptocurrencies markets:

1) Cexio
2) CoinMarketCap
3) Bittrex
4) Cryptonator
5) Kraken

Kraken

const { Kraken } = require('node-crypto-api');

const kraken = new Kraken();

//ticker
kraken.ticker('XBT', 'USD')
    .then(console.log)
    .catch(console.error);

Cexio

const { Cexio } = require('node-crypto-api');

const cexio = new Cexio();

//ticker
cexio.ticker('BTC', 'USD')
    .then(console.log)
    .catch(console.error);

//socket
const cexioSocket = cexio.socket();

cexioSocket.send({ "e": "subscribe", "rooms": [ "tickers" ] });

cexioSocket.onMessage = function(res) {
	console.log(JSON.parse(res));
}

cexioSocket.init();

CoinMarketCap

const { CoinMarketCap } = require('node-crypto-api');

const coinMarketCap = new CoinMarketCap();

//ticker
coinMarketCap.ticker('bitcoin')
    .then(console.log)
    .catch(console.error);

//tables scrapping
coinMarketCap.markets('bitcoin')
    .then(console.log)
    .catch(console.error);

coinMarketCap.historicalData('bitcoin', { start : 20171230, end : 20180105 })
    .then(console.log)
    .catch(console.error);

coinMarketCap.exchanges('bithumb')
    .then(console.log)
    .catch(console.error);

Rest Api

Ticker
coinMarketCap.ticker()

Params:

@ currency  : string
@ queryString : {
    limit : number
    start : number
    convert : 'string' 
}
Global
coinMarketCap.global()

Params:

@ currency  : string
@ queryString : {
    convert : 'string' 
}

Table scrapping

Top 100 currencies
coinMarketCap.home()
All currencies
coinMarketCap.all()
Coins
coinMarketCap.coins()
Get Total Supply
coinMarketCap.totalSupply()
Non Mineable
coinMarketCap.nonMineable()
Tockens
coinMarketCap.tokens()
Markets
coinMarketCap.markets()

Params:

@ currency  : string
Historial Data
coinMarketCap.historicalData()

Params:

@ currency  : string
@ queryString : {
    start : number
    end : number
}
Exchanges
coinMarketCap.exchanges()

Params:

@ market  : string

Cryptonator

const { Cryptonator } = require('node-crypto-api');

const cryptonator = new Cryptonator();

//ticker
cryptonator.ticker('btc', 'usd')
    .then(console.log)
    .catch(console.error);

Rest Api

Ticker

Return the the price, volume and price change

cryptonator.ticker()

Params:

@ base   : string
@ target : string
Full

Return list of prices from multiple markets

cryptonator.full()
Currencies

Return a list of the suported currencies

cryptonator.currencies()

Bittrex

const { Bittrex } = require('node-crypto-api');

const bittrex = new Bittrex();

//ticker
bittrex.getticker('BTC', 'LTC')
    .then(console.log)
    .catch(console.error);

node-crypto-api's People

Contributors

alenkart avatar

Forkers

furcalor

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.