1.1.3 • Published 3 years ago

coinlayer-wrapper v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

A node wrapper for the CoinLayer Crypto API.

npm npm install size

NPM

Installation:

npm:https://www.npmjs.com/package/coinlayer-wrapper

npm i coinlayer-wrapper

Existing Methods:

  • livedata(currency,crypto) - Returns Live Cryptocurrency Data
  • histdata(data, currency, crypto) - Returns Historical Data from 2011 - Date Given

Setup:

const crypto = require('coinlayer-wrapper')
const coin = new crypto(token)
//You can get your API Token from https://coinlayer.com

Simple Example:

const crypto = require('coinlayer-wrapper')
const coin = new crypto(token)

const cur = 'usd';
const cryp = 'btc';
const data = coin.livedata(cur, cryp)

console.log(data)
//Sends an object with the live cryptocurrency

/*{
  rate: 32806.429893,
  high: 36557.84,
  low: 31583.7,
  vol: 247761373.242442,
  cap: 614565508506.3904,
  sup: 18733081,
  change: -2906.1135490000015,
  change_pct: -8.137514914667895
}

Historical Data Example

const date = '2018-04-29'
const cur = 'usd';
const cryp = 'btc';
const data = coin.histdata(date,cur, cryp)

console.log(data)
List of all available country currencies: https://coinlayer.com/target

List of all available crypto currencies: https://coinlayer.com/symbols

Quick Note:
If you get a socket error, it's on the API side,it has been going on and off, so just keep that in mind
1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.1.2

3 years ago

1.0.91

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago