1.0.0 • Published 6 years ago
worldcoinindex-api v1.0.0
worldcoinindex-api
Simple WorldCoinIndex API wrapper for Node.js
WorldCoinIndex API documentation can be found at https://www.worldcoinindex.com/apiservice
Installation
npm install worldcoinindex-api
Usage
const WorldCoinIndex = require('worldcoinindex-api');
const client = new WorldCoinIndex('your key goes here');
client.getTicker('eth', 'btc').then(console.log).catch(console.error);
client.getTickers(['eth', 'ltc'], 'btc').then(console.log).catch(console.error);
client.getMarkets('btc').then(console.log).catch(console.error);
Tests
npm test
API
Table of Contents
constructor
Creates an instance of WorldCoinIndex
Parameters
key
string WorldCoinIndex API key
Examples
const client = new WorldCoinIndex('toe48ute93m34notarealkey');
getTicker
Get ticker information
Parameters
Examples
const client = new WorldCoinIndex('key goes here');
client.getTicker('eth', 'btc').then(console.log).catch(console.error);
client.getTicker('ltc', 'btc').then(console.log).catch(console.error);
Returns Object ticker information
getTickers
Get information on multiple tickers
Parameters
Examples
const client = new WorldCoinIndex('key goes here');
client.getTickers(['eth', 'ltc'], 'btc').then(console.log).catch(console.error);
client.getTickers(['ven'], 'btc').then(console.log).catch(console.error);
Returns Object information on multiple tickers
getMarkets
Get market information
Parameters
fiat
string currency to get information about
Examples
const client = new WorldCoinIndex('key goes here');
client.getTicker('btc').then(console.log).catch(console.error);
client.getTicker('eth').then(console.log).catch(console.error);
Returns Object market information
Contributing
Contributions welcome!