npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-crypto-api

v1.0.8

Published

Provide an api to consume data from multiple cryptocurrencies markets

Downloads

16

Readme

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);